mars.dataframe.Series.dt.strftime

Series.dt.strftime(*args, **kwargs)

Convert to Index using specified date_format.

Return an Index of formatted strings specified by date_format, which supports the same string format as the python standard library. Details of the string format can be found in python string format doc.

参数

date_format (str) – Date format string (e.g. “%Y-%m-%d”).

返回

NumPy ndarray of formatted strings.

返回类型

ndarray

参见

to_datetime

Convert the given argument to datetime.

DatetimeIndex.normalize

Return DatetimeIndex with times to midnight.

DatetimeIndex.round

Round the DatetimeIndex to the specified freq.

DatetimeIndex.floor

Floor the DatetimeIndex to the specified freq.

实际案例

>>> import mars.dataframe as md
>>> rng = md.date_range(md.Timestamp("2018-03-10 09:00"),
...                     periods=3, freq='s')
>>> rng.strftime('%B %d, %Y, %r').execute()
Index(['March 10, 2018, 09:00:00 AM', 'March 10, 2018, 09:00:01 AM',
       'March 10, 2018, 09:00:02 AM'],
      dtype='object')