pandas 1.4.2

ParametersReturns
_box_as_indexlike(dt_array: 'ArrayLike', utc: 'bool | None' = None, name: 'Hashable' = None) -> 'Index'

Parameters

dt_array: 1-d array :

Array of datetimes to be wrapped in an Index.

tz : object

None or 'utc'

name : string, default None

Name for a resulting index

Returns

result : datetime of converted dates
  • DatetimeIndex if convertible to sole datetime64 type

  • general Index otherwise

Properly boxes the ndarray of datetimes to DatetimeIndex if it is possible or to generic Index instead

Examples

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/tools/datetimes.py#205
type: <class 'function'>
Commit: