Skip to content

Commit 1145ec4

Browse files
committed
Floating point funtimes with doctest
1 parent 2540101 commit 1145ec4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

python/pyspark/ml/feature.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -987,11 +987,14 @@ class QuantileDiscretizer(JavaEstimator, HasInputCol, HasOutputCol):
987987
>>> qds = QuantileDiscretizer(numBuckets=2,
988988
... inputCol="values", outputCol="buckets")
989989
>>> bucketizer = qds.fit(df)
990-
>>> bucketizer.getSplits()
991-
[-inf, 0.4, 1.5, inf]
990+
>>> splits = bucketizer.getSplits()
991+
>>> splits[0]
992+
-inf
993+
>>> splits[1]*10
994+
4
992995
>>> bucketed = bucketizer.transform(df).collect()
993-
>>> bucketed[0]
994-
Row(values=0.1, buckets=0.0)
996+
>>> bucketed[0].buckets
997+
0.0
995998
996999
.. versionadded:: 1.6.0
9971000
"""

0 commit comments

Comments
 (0)