pandas 1.4.2

ParametersReturns
to_time(arg, format=None, infer_time_format=False, errors='raise')

Use infer_time_format if all the strings are in the same format to speed up conversion.

Parameters

arg : string in time format, datetime.time, list, tuple, 1-d array, Series
format : str, default None

Format used to convert arg into a time object. If None, fixed formats are used.

infer_time_format: bool, default False :

Infer the time format based on the first non-NaN element. If all strings are in the same format, this will speed up conversion.

errors : {'ignore', 'raise', 'coerce'}, default 'raise'
  • If 'raise', then invalid parsing will raise an exception

  • If 'coerce', then invalid parsing will be set as None

  • If 'ignore', then invalid parsing will return the input

Returns

datetime.time

Parse time strings to time objects using fixed strptime formats ("%H:%M", "%H%M", "%I:%M%p", "%I%M%p", "%H:%M:%S", "%H%M%S", "%I:%M:%S%p", "%I%M%S%p")

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/times.py#19
type: <class 'function'>
Commit: