+

Python | Pandas Period.minute

Period.minute Pandas Period.minute returns an integer value. The return value represents the number of minutes in this Period object.

Syntax: Period.minute

Parameters: None

Return: number of minutes

Example # 1: Use the Period.minute attribute to find the minute value present in this Period object.

# import pandas as pd

import pandas as pd

 
# Create Period object

prd = pd.Period (freq = `S` , year = 200 0 , month = 2 , day = 21 , hour = 8 , minute = 21 )

 
# Print Period object

print (prd)

Output:

Now we will use the Period.minute attribute to find out the minute value present in the prd object.

Output:

As we can see in the output, the Period.minute attribute returned 21, indicating that the minutes value present in this period object is 21.

Example # 2: Use the Period.minute attribute to find the minutes value present in this Period object.

# find the minute value
prd.minute

# import pandas as pd

import pandas as pd

 
# Create Period object

prd = pd.Period (freq = `T` , year = 2006 , month = 10 ,

  hour = 15 , minute = 49 )

 
# Print Period object

print (prd)

Output:

Now we will use the Period.minute attribute to find out the mine a specific value present in the prd object.

# find the minute
prd.minute

Output:

As we can see in the output, the Period.minute attribute returned 49, indicating that the minutes value present in the given period object is 49.

Get Solution for free from DataCamp guru