pandas 1.4.2

Returns
normalize(self) -> 'DatetimeArray'

The time component of the date-time is converted to midnight i.e. 00:00:00. This is useful in cases, when the time does not matter. Length is unaltered. The timezones are unaffected.

This method is available on Series with datetime values under the .dt accessor, and directly on Datetime Array/Index.

Returns

DatetimeArray, DatetimeIndex or Series

The same type as the original data. Series will have the same name and index. DatetimeIndex will have the same name.

Convert times to midnight.

See Also

ceil

Ceil the datetimes to the specified freq.

floor

Floor the datetimes to the specified freq.

round

Round the datetimes to the specified freq.

Examples

This example is valid syntax, but we were not able to check execution
>>> idx = pd.date_range(start='2014-08-01 10:00', freq='H',
...  periods=3, tz='Asia/Calcutta')
... idx DatetimeIndex(['2014-08-01 10:00:00+05:30', '2014-08-01 11:00:00+05:30', '2014-08-01 12:00:00+05:30'], dtype='datetime64[ns, Asia/Calcutta]', freq='H')
This example is valid syntax, but we were not able to check execution
>>> idx.normalize()
DatetimeIndex(['2014-08-01 00:00:00+05:30',
               '2014-08-01 00:00:00+05:30',
               '2014-08-01 00:00:00+05:30'],
               dtype='datetime64[ns, Asia/Calcutta]', freq=None)
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/arrays/datetimes.py#1073
type: <class 'function'>
Commit: