@@ -1966,30 +1966,35 @@ def normalize(self):
1966
1966
"""
1967
1967
Convert times to midnight.
1968
1968
1969
- When using DatetimeIndex, the time can be converted to midnight i.e.
1969
+ The time component of the date-timeise converted to midnight i.e.
1970
1970
00:00:00. This is useful in cases, when the time does not matter.
1971
1971
Length is unaltered. The timezones are unaffected.
1972
1972
1973
+ This method is available on Series with datetime values under
1974
+ the ``.dt`` accessor, and directly on DatetimeIndex.
1975
+
1973
1976
Returns
1974
1977
-------
1975
- normalized : DatetimeIndex
1978
+ DatetimeIndex or Series
1979
+ The same type as the original data. Series will have the same
1980
+ name and index. DatetimeIndex will have the same name.
1976
1981
1977
1982
See Also
1978
1983
--------
1979
- DatetimeIndex. floor : Floor the DatetimeIndex to the specified freq.
1980
- DatetimeIndex. ceil : Ceil the DatetimeIndex to the specified freq.
1981
- DatetimeIndex. round : Round the DatetimeIndex to the specified freq.
1984
+ floor : Floor the datetimes to the specified freq.
1985
+ ceil : Ceil the datetimes to the specified freq.
1986
+ round : Round the datetimes to the specified freq.
1982
1987
1983
1988
Examples
1984
1989
--------
1985
- >>> df = pd.DatetimeIndex(start='2014-08-01 10:00', freq='H',
1986
- ... periods=3, tz='Asia/Calcutta')
1987
- >>> df
1990
+ >>> idx = pd.DatetimeIndex(start='2014-08-01 10:00', freq='H',
1991
+ ... periods=3, tz='Asia/Calcutta')
1992
+ >>> idx
1988
1993
DatetimeIndex(['2014-08-01 10:00:00+05:30',
1989
1994
'2014-08-01 11:00:00+05:30',
1990
1995
'2014-08-01 12:00:00+05:30'],
1991
1996
dtype='datetime64[ns, Asia/Calcutta]', freq='H')
1992
- >>> df .normalize()
1997
+ >>> idx .normalize()
1993
1998
DatetimeIndex(['2014-08-01 00:00:00+05:30',
1994
1999
'2014-08-01 00:00:00+05:30',
1995
2000
'2014-08-01 00:00:00+05:30'],
0 commit comments