Python是进行数据分析的一种出色语言,主要是因为以数据为中心的python软件包具有奇妙的生态系统。 Pandas是其中的一种,使导入和分析数据更加容易。
 Pandas  Period.end_time属性返回一个Timestamp对象,其中包含给定期间对象的结束时间。
用法: Period.end_time
参数:没有
返回:时间戳记对象
范例1:采用Period.end_time 属性以查找给定Period对象的结束时间。
# importing pandas as pd 
import pandas as pd 
  
# Create the Period object 
prd = pd.Period(freq ='D', year = 2001, month = 2, day = 21) 
  
# Print the Period object 
print(prd)输出:

现在我们将使用Period.end_time属性以查找prd对象的结束时间。
# return the end time 
prd.end_time输出:

正如我们在输出中看到的,Period.end_time 属性返回了一个Timestamp对象,该对象包含日期值以及给定时间段的结束时间。
范例2:采用Period.end_time属性以查找给定Period对象的结束时间。
# importing pandas as pd 
import pandas as pd 
  
# Create the Period object 
prd = pd.Period(freq ='Q', year = 2006, quarter = 1) 
  
# Print the object 
print(prd)输出:

现在我们将使用Period.end_time属性以查找prd对象的结束时间。
# return the end time 
prd.end_time输出:

正如我们在输出中看到的,Period.end_time 属性返回了一个Timestamp对象,其中包含日期值以及给定期间对象的结束时间。
相关用法
- Python pandas.map()用法及代码示例
- Python Pandas Series.str.len()用法及代码示例
- Python Pandas.factorize()用法及代码示例
- Python Pandas TimedeltaIndex.name用法及代码示例
- Python Pandas dataframe.ne()用法及代码示例
- Python Pandas Series.between()用法及代码示例
- Python Pandas DataFrame.where()用法及代码示例
- Python Pandas Series.add()用法及代码示例
- Python Pandas.pivot_table()用法及代码示例
- Python Pandas Series.mod()用法及代码示例
- Python Pandas Dataframe.at[ ]用法及代码示例
- Python Pandas Dataframe.iat[ ]用法及代码示例
- Python Pandas.pivot()用法及代码示例
- Python Pandas dataframe.mul()用法及代码示例
- Python Pandas.melt()用法及代码示例
注:本文由纯净天空筛选整理自Shubham__Ranjan大神的英文原创作品 Python | Pandas Period.end_time。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
