Skip to content

Commit 28f7bbc

Browse files
DylanGuedesdongjoon-hyun
authored andcommitted
[PYTHON] Changes input variable to not conflict with built-in function
Signed-off-by: DylanGuedes <djmgguedesgmail.com> ## What changes were proposed in this pull request? Changes variable name conflict: [input is a built-in python function](https://stackoverflow.com/questions/20670732/is-input-a-keyword-in-python). ## How was this patch tested? I runned the example and it works fine. Author: DylanGuedes <[email protected]> Closes apache#20775 from DylanGuedes/input_variable. (cherry picked from commit b6f837c) Signed-off-by: hyukjinkwon <[email protected]>
1 parent c1fb306 commit 28f7bbc

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

examples/src/main/python/ml/dataframe_example.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
"""
1919
An example of how to use DataFrame for ML. Run with::
20-
bin/spark-submit examples/src/main/python/ml/dataframe_example.py <input>
20+
bin/spark-submit examples/src/main/python/ml/dataframe_example.py <input_path>
2121
"""
2222
from __future__ import print_function
2323

@@ -35,18 +35,18 @@
3535
print("Usage: dataframe_example.py <libsvm file>", file=sys.stderr)
3636
exit(-1)
3737
elif len(sys.argv) == 2:
38-
input = sys.argv[1]
38+
input_path = sys.argv[1]
3939
else:
40-
input = "data/mllib/sample_libsvm_data.txt"
40+
input_path = "data/mllib/sample_libsvm_data.txt"
4141

4242
spark = SparkSession \
4343
.builder \
4444
.appName("DataFrameExample") \
4545
.getOrCreate()
4646

47-
# Load input data
48-
print("Loading LIBSVM file with UDT from " + input + ".")
49-
df = spark.read.format("libsvm").load(input).cache()
47+
# Load an input file
48+
print("Loading LIBSVM file with UDT from " + input_path + ".")
49+
df = spark.read.format("libsvm").load(input_path).cache()
5050
print("Schema from LIBSVM:")
5151
df.printSchema()
5252
print("Loaded training data as a DataFrame with " +

0 commit comments

Comments
 (0)