Python Pandas PeriodIndex.minute

Python Pandas PeriodIndex.minute

Python是一种进行数据分析的伟大语言,主要是因为以数据为中心的Python包的奇妙生态系统。Pandas就是这些包中的一个,它使导入和分析数据变得更加容易。

Pandas PeriodIndex.minute属性返回一个索引对象,包含给定PeriodIndex对象中每个时期的分钟值。

语法 :

PeriodIndex.minute

参数:

返回:索引对象

例子#1:使用PeriodIndex.minute属性来找出给定PeriodIndex对象中每个时期的分钟值。

# importing pandas as pd
import pandas as pd
  
# Create the PeriodIndex object
pidx = pd.PeriodIndex(start ='2003-12-21 08:45 ',
               end ='2003-12-21 8:55', freq ='T')
  
# Print the PeriodIndex object
print(pidx)

输出 :
Python Pandas PeriodIndex.minute

现在我们将使用PeriodIndex.minute属性来找出pidx中每个时期的分钟值。

# find minute value
pidx.minute

输出 :
Python Pandas PeriodIndex.minute
正如我们在输出中看到的,PeriodIndex.minute属性有一个索引对象,包含给定PeriodIndex对象中每个时期的分钟值。

示例#2:使用PeriodIndex.minute属性来找出给定PeriodIndex对象中每个时期的分钟值。

# importing pandas as pd
import pandas as pd
  
# Create the PeriodIndex object
pidx = pd.PeriodIndex(start ='2016-02-1 11:32', 
           end ='2016-02-01 11:55', freq ='T')
  
# Print the PeriodIndex object
print(pidx)

输出 :
Python Pandas PeriodIndex.minute

现在我们将使用PeriodIndex.minute属性来找出pidx中每个时期的分钟值。

# find minute value
pidx.minute

输出 :
Python Pandas PeriodIndex.minute

正如我们在输出中看到的,PeriodIndex.minute属性有一个索引对象,包含给定PeriodIndex对象中每个时期的分钟值。

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程