Python Pandas TimedeltaIndex.summary()
Python是一种进行数据分析的伟大语言,主要是因为以数据为中心的Python包的奇妙生态系统。Pandas就是这些包中的一个,它使导入和分析数据变得更加容易。
Pandas TimedeltaIndex.summary()函数返回给定TimedeltaIndex对象的汇总表示。该摘要包含条目总数、第一个条目和最后一个条目。
语法: TimedeltaIndex.summary(value = None)
参数 :
value : 用来填补漏洞的标量值(例如0)。这个值不能是一个列表式的。
返回:摘要
示例#1:使用TimedeltaIndex.summary()函数来查找给定的TimedeltaIndex对象的摘要。
# importing pandas as pd
import pandas as pd
# Create the TimedeltaIndex object
tidx = pd.TimedeltaIndex(data =['3 days 10:22:56', '1 days 06:05:01.000030',
'19 days 12:22:56','1 days 02:00:00',
'21 days 06:15:01.000030'],name ='Old_object')
# Print the TimedeltaIndex object
print(tidx)
输出 :
现在我们将使用TimedeltaIndex.summary()函数来返回tidx对象的摘要。
# find summary of tidx
tidx.summary()
输出 :
正如我们在输出中看到的,TimedeltaIndex.summary()函数已经返回了给定TimedeltaIndex对象的完整摘要。
示例#2:使用TimedeltaIndex.summary()函数来查找给定的TimedeltaIndex对象的摘要。
# importing pandas as pd
import pandas as pd
# Create the TimedeltaIndex object
tidx = pd.TimedeltaIndex(data =['06:05:01.000030', '3 days 06:05:01.000030',
'22 day 2 min 3us 10ns', '+23:59:59.999999',
'13 days 06:05:01.000030', '+12:19:59.999999'])
# Print the TimedeltaIndex object
print(tidx)
输出 :
现在我们将使用TimedeltaIndex.summary()函数来返回tidx对象的摘要。
# find summary of tidx
tidx.summary()
输出 :
正如我们在输出中看到的,TimedeltaIndex.summary()函数已经返回了给定TimedeltaIndex对象的完整摘要。