Skip to content

Commit 9533a91

Browse files
Merge pull request #250885 from RamanathanChinnappan-MSFT/patch-73
(AzureCXP) fixes MicrosoftDocs/azure-docs#114460
2 parents eaa21c0 + 1aa5456 commit 9533a91

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/hdinsight/spark/apache-spark-ipython-notebook-machine-learning.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ This application uses a Spark [ML pipeline](https://spark.apache.org/docs/2.2.0/
144144
```PySpark
145145
# SystemInfo here is a combination of system ID followed by system age
146146
Document = Row("id", "SystemInfo")
147-
test = sc.parallelize([(1L, "20 25"),
148-
(2L, "4 15"),
149-
(3L, "16 9"),
150-
(4L, "9 22"),
151-
(5L, "17 10"),
152-
(6L, "7 22")]) \
147+
test = sc.parallelize([("1L", "20 25"),
148+
("2L", "4 15"),
149+
("3L", "16 9"),
150+
("4L", "9 22"),
151+
("5L", "17 10"),
152+
("6L", "7 22")]) \
153153
.map(lambda x: Document(*x)).toDF()
154154
```
155155
@@ -160,7 +160,7 @@ This application uses a Spark [ML pipeline](https://spark.apache.org/docs/2.2.0/
160160
prediction = model.transform(test)
161161
selected = prediction.select("SystemInfo", "prediction", "probability")
162162
for row in selected.collect():
163-
print row
163+
print (row)
164164
```
165165
166166
The output is similar to:

0 commit comments

Comments
 (0)