holdenk commented on code in PR #60577:
URL: https://github.com/apache/spark/pull/60577#discussion_r4620815406
##########
python/pyspark/pandas/frame.py:
##########
@@ -3890,13 +3890,20 @@ def between_time(
A
2018-04-09 00:00:00 1
2018-04-12 01:00:00 4
+
+ Use ``axis=1`` to select columns whose labels fall between the two
times:
+
+ >>> psdf = ps.DataFrame([[1, 2, 3, 4]], columns=idx)
+ >>> psdf.between_time('0:15', '0:45', axis=1)
+ 2018-04-10 00:20:00 2018-04-11 00:40:00
+ 0 2 3
"""
axis = validate_axis(axis)
- if axis != 0:
- raise NotImplementedError("between_time currently only works for
axis=0")
-
- if not isinstance(self.index, ps.DatetimeIndex):
+ if axis == 1:
+ if not isinstance(self.columns, pd.DatetimeIndex):
+ raise TypeError("Index must be DatetimeIndex")
Review Comment:
Should this be columns/axis here instead?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]