Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5839#discussion_r29545478
--- Diff: python/pyspark/sql/dataframe.py ---
@@ -1289,6 +1289,17 @@ def cast(self, dataType):
raise TypeError("unexpected type: %s" % type(dataType))
return Column(jc)
+ @ignore_unicode_prefix
+ def between(self, lowerBound, upperBound):
+ """ A boolean expression that is evaluated to true if the value of
this
+ expression is between the given columns.
+
+ >>> df[df.col1.between(lowerBound, upperBound)].collect()
+ [Row(col1=5, col2=6, col3=8)]
+ """
+ jc = (self >= lowerBound) & (self <= upperBound)
+ return Column(jc)
--- End diff --
actually I think you no longer need to wrap it in Column, since it is
already a Python column.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]