Python是进行数据分析的一种出色语言,主要是因为以数据为中心的python软件包具有奇妙的生态系统。 Pandas是其中的一种,使导入和分析数据更加容易。
 Pandas  TimedeltaIndex.is_monotonic_decreasing属性返回True如果索引值单调递减。它返回True即使值相等。
用法: TimedeltaIndex.is_monotonic_decreasing
返回:布尔值
示例1:采用TimedeltaIndex.is_monotonic_decreasing属性,以检查TimedeltaIndex对象是否单调递减。
# importing pandas as pd 
import pandas as pd 
  
# Create the TimedeltaIndex object 
tidx = pd.TimedeltaIndex(data =['1 days 02:04:00', '1 days 02:03:00',  
                               '1 days 02:02:00', '1 days 02:01:00']) 
  
# Print the TimedeltaIndex 
print(tidx)输出:

现在,我们将检查TimedeltaIndex对象是否单调递减。
# check if tidx is monotonic decreasing or not 
tidx.is_monotonic_decreasing输出:

正如我们在输出中看到的,TimedeltaIndex.is_monotonic_decreasing属性已返回True表示tidx对象中的值单调递减。
示例2:采用TimedeltaIndex.is_monotonic_decreasing属性,以检查TimedeltaIndex对象是否单调递减。
# importing pandas as pd 
import pandas as pd 
  
# Create the TimedeltaIndex object 
tidx = pd.TimedeltaIndex(data =['-1 days 2 min 3us', '1 days 06:05:01.000030', 
                                                 '-1 days + 23:59:59.999999']) 
  
# Print the TimedeltaIndex 
print(tidx)输出:

现在,我们将检查TimedeltaIndex对象是否单调递减。
# check if tidx is monotonic decreasing or not 
tidx.is_monotonic_decreasing输出:

正如我们在输出中看到的,TimedeltaIndex.is_monotonic_decreasing属性已返回False指示tidx对象中的值不是单调递减。
相关用法
- Python pandas.map()用法及代码示例
 - Python Pandas Series.eq()用法及代码示例
 - Python Pandas DataFrame.where()用法及代码示例
 - Python Pandas dataframe.pow()用法及代码示例
 - Python Pandas Series.between()用法及代码示例
 - Python Pandas Series.ne()用法及代码示例
 - Python Pandas Panel.abs()用法及代码示例
 - Python Pandas Series.lt()用法及代码示例
 - Python Pandas Series.le()用法及代码示例
 - Python Pandas.Categorical()用法及代码示例
 - Python Pandas Timestamp.now用法及代码示例
 - Python Pandas Series.dt.second用法及代码示例
 - Python Pandas Timestamp.day用法及代码示例
 - Python Pandas PeriodIndex.day用法及代码示例
 - Python Pandas dataframe.mod()用法及代码示例
 
注:本文由纯净天空筛选整理自Shubham__Ranjan大神的英文原创作品 Python | Pandas TimedeltaIndex.is_monotonic_decreasing。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
