- 用法:- property DatetimeIndex.is_year_start
- 指示日期是否为一年的第一天。 - 系列或日期时间索引
- 与具有布尔值的原始数据相同的类型。系列将具有相同的名称和索引。 DatetimeIndex 将具有相同的名称。 
 
 - 返回:- 例子:- 此方法在具有日期时间值的系列上可用,位于 - .dt访问器下,并且直接在 DatetimeIndex 上可用。- >>> dates = pd.Series(pd.date_range("2017-12-30", periods=3)) >>> dates 0 2017-12-30 1 2017-12-31 2 2018-01-01 dtype:datetime64[ns]- >>> dates.dt.is_year_start 0 False 1 False 2 True dtype:bool- >>> idx = pd.date_range("2017-12-30", periods=3) >>> idx DatetimeIndex(['2017-12-30', '2017-12-31', '2018-01-01'], dtype='datetime64[ns]', freq='D')- >>> idx.is_year_start array([False, False, True])
相关用法
- Python pandas.DatetimeIndex.is_year_end用法及代码示例
- Python pandas.DatetimeIndex.is_quarter_start用法及代码示例
- Python pandas.DatetimeIndex.is_leap_year用法及代码示例
- Python pandas.DatetimeIndex.is_month_start用法及代码示例
- Python pandas.DatetimeIndex.is_month_end用法及代码示例
- Python pandas.DatetimeIndex.is_quarter_end用法及代码示例
- Python pandas.DatetimeIndex.day用法及代码示例
- Python pandas.DatetimeIndex.dayofweek用法及代码示例
- Python pandas.DatetimeIndex.to_frame用法及代码示例
- Python pandas.DatetimeIndex.normalize用法及代码示例
- Python pandas.DatetimeIndex.tz_convert用法及代码示例
- Python pandas.DatetimeIndex.month用法及代码示例
- Python pandas.DatetimeIndex.floor用法及代码示例
- Python pandas.DatetimeIndex.round用法及代码示例
- Python pandas.DatetimeIndex.month_name用法及代码示例
- Python pandas.DatetimeIndex.year用法及代码示例
- Python pandas.DatetimeIndex.nanosecond用法及代码示例
- Python pandas.DatetimeIndex.hour用法及代码示例
- Python pandas.DatetimeIndex.day_name用法及代码示例
- Python pandas.DatetimeIndex.tz_localize用法及代码示例
注:本文由纯净天空筛选整理自pandas.pydata.org大神的英文原创作品 pandas.DatetimeIndex.is_year_start。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
