VOOZH about

URL: https://www.geeksforgeeks.org/pandas/pandas-series-dt-nanosecond/

⇱ Pandas Series dt.nanosecond | Get Nanoseconds From DateTime Series - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Pandas Series dt.nanosecond | Get Nanoseconds From DateTime Series

Last Updated : 11 Jul, 2025

Pandas dt.nanosecond attribute returns a NumPy array containing the nanosecond of the DateTime in the underlying data of the given series object. 

Example

Output

👁 dt.nanosecond output

Syntax

Syntax: Series.dt.nanosecond 

Parameter: None 

Returns: NumPy array containing nanosecond values

How to Extract Nanoseconds from DateTime in Pandas Series

To extract nanoseconds from DateTime in the Pandas Series we use the dt.nanosecond attribute of the Pandas library.

Let's understand it better with an example.

Example:

Use the Series.dt.nanosecond attribute to return the nanosecond of the DateTime in the underlying data of the given Series object.

Output :

👁 Image

As we can see in the output, the dt.nanosecond attribute has successfully accessed and returned the nanosecond of the DateTime in the underlying data of the given series object.

Comment

Explore