![]() |
VOOZH | about |
The Series.dt.time attribute returns a NumPy array containing time values of the timestamps in a Pandas series.
Output:
Syntax: Series.dt.time
Parameter : None
Returns : NumPy array containing time values
To extract the time value from the DateTime Pandas Series we use the dt.time attribute of the Pandas library.
Let us understand better with an example:
Use the Series.dt.time attribute to return the time property of the underlying data of the given Series object.
Output
Now we will use Series.dt.time attribute to return the time property of the underlying data of the given Series object.
Output :
👁 Extracted hour part from timestamp
As we can see in the output, the Series.dt.time attribute has successfully accessed and returned the time property of the underlying data in the given series object.