@@ -61,18 +61,41 @@ def strftime(self, date_format):
61
61
return np .asarray (self .format (date_format = date_format ),
62
62
dtype = compat .text_type )
63
63
strftime .__doc__ = """
64
+ Convert to string array using specified date_format.
65
+
64
66
Return an array of formatted strings specified by date_format, which
65
67
supports the same string format as the python standard library. Details
66
68
of the string format can be found in `python string format doc <{0}>`__
67
69
68
70
Parameters
69
71
----------
70
72
date_format : str
71
- date format string (e.g. "%Y-%m-%d")
73
+ Date format string (e.g. "%Y-%m-%d").
72
74
73
75
Returns
74
76
-------
75
- ndarray of formatted strings
77
+ numpy.ndarray
78
+ NumPy array of formatted strings
79
+
80
+ See Also
81
+ --------
82
+ pandas.to_datetime : Convert the given argument to datetime
83
+ DatetimeIndex.normalize : Return DatetimeIndex with times to midnight.
84
+ DatetimeIndex.round : Round the DatetimeIndex to the specified freq.
85
+ DatetimeIndex.floor : Floor the DatetimeIndex to the specified freq.
86
+
87
+ Examples
88
+ --------
89
+ >>> import datetime
90
+ >>> data = pd.date_range(datetime.datetime(2018,3,10,19,27,52),
91
+ ... periods=4, freq='B')
92
+ >>> df = pd.DataFrame(data, columns=['date'])
93
+ >>> df.date[1]
94
+ Timestamp('2018-03-13 19:27:52')
95
+ >>> df.date[1].strftime('%d-%m-%Y')
96
+ '13-03-2018'
97
+ >>> df.date[1].strftime('%B %d, %Y, %r')
98
+ 'March 13, 2018, 07:27:52 PM'
76
99
""" .format ("https://docs.python.org/3/library/datetime.html"
77
100
"#strftime-and-strptime-behavior" )
78
101
0 commit comments