Python Pandas PeriodIndex.end_time
Python是一种进行数据分析的伟大语言,主要是因为以数据为中心的Python软件包的奇妙生态系统。Pandas就是这些包中的一个,使导入和分析数据变得更加容易。
Pandas PeriodIndex.end_time属性返回一个Index对象。该索引包含给定PeriodIndex对象中每个元素的周期结束时间。
语法 :
PeriodIndex.end_time
参数:无
返回:index
例子#1:使用PeriodIndex.end_time属性来查找给定PeriodIndex对象中每个元素的周期结束时间。
# importing pandas as pd
import pandas as pd
# Create the PeriodIndex object
pidx = pd.PeriodIndex(start ='2005-12-21 08:45 ',
end ='2005-12-21 11:55', freq ='H')
# Print the PeriodIndex object
print(pidx)
输出 :
现在我们将使用PeriodIndex.end_time属性来查找给定对象中每个元素的周期结束时间。
# return the end time of period
pidx.end_time
输出 :
正如我们在输出中看到的,PeriodIndex.end_time属性返回了一个Index对象,其中包含给定PeriodIndex对象中每个元素的结束时间。
示例#2:使用PeriodIndex.end_time属性来查找给定PeriodIndex对象中每个元素的周期结束时间。
# importing pandas as pd
import pandas as pd
# Create the PeriodIndex object
pidx = pd.PeriodIndex(start ='2011-02-14 04:30',
end ='2011-02-14 11:44', freq ='H')
# Print the PeriodIndex object
print(pidx)
输出 :
现在我们将使用PeriodIndex.end_time属性来查找给定对象中每个元素的周期结束时间。
# return the end time of period
pidx.end_time
输出 :
正如我们在输出中看到的,PeriodIndex.end_time属性返回了一个Index对象,其中包含给定PeriodIndex对象中每个元素的结束时间。