pyspark.pandas.Index.is_all_dates

財產 索引。 is_all_dates

返回如果所有索引的數據類型是datetime。記住,因為pandas-on-Spark不支持多個索引的數據類型,所以datetime返回True,如果任何類型的數據。

例子

> > >datetime進口datetime
> > >idx=ps指數([datetime(2019年,1,1,0,0,0),datetime(2019年,2,3,0,0,0)))> > >idxDatetimeIndex (“2019-01-01”,“2019-02-03”, dtype =“datetime64 (ns)”,頻率=沒有)
> > >idxis_all_dates真正的
> > >idx=ps指數([datetime(2019年,1,1,0,0,0),沒有一個])> > >idxDatetimeIndex (' 2019-01-01 ', ' NaT, dtype =“datetime64 (ns)”,頻率=沒有)
> > >idxis_all_dates真正的
> > >idx=ps指數([0,1,2])> > >idxInt64Index ([0, 1, 2) dtype =“int64”)
> > >idxis_all_dates