Python Pandas TimedeltaIndex.ceil
Python是一种进行数据分析的伟大语言,主要是因为以数据为中心的Python包的奇妙生态系统。Pandas就是这些包中的一个,它使导入和分析数据变得更加容易。
Pandas TimedeltaIndex.ceil()函数将TimedeltaIndex对象的索引ceil到指定的freq。该函数将频率作为一个参数,我们希望对其进行取值。
语法: TimedeltaIndex.ceil(freq)
参数 :
freq : freq string/object
返回:相同类型的索引
示例#1:使用TimedeltaIndex.ceil()函数将给定的TimedeltaIndex对象的值上限为指定频率。
输出 :
现在,我们将使用TimedeltaIndex.ceil()函数将该值削成微小的频率。
输出 :
正如我们在输出中看到的,TimedeltaIndex.ceil()函数已经返回了一个新的索引对象,其中包含了以所需频率为上限的数值。
示例#2:使用TimedeltaIndex.ceil()函数将给定的TimedeltaIndex对象的值上限为指定频率。
输出 :
现在,我们将使用TimedeltaIndex.ceil()函数将该值截断为每日频率。
输出 :
正如我们在输出中看到的,TimedeltaIndex.ceil()函数已经返回了一个新的索引对象,其中包含了以所需频率为上限的数值。