程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

pandas 構造時間值

編輯:Python


pd.Timestamp pd.to_datetime(train[‘time’]) Property

Description

year

The year of the datetime

month

The month of the datetime

day

The days of the datetime

hour

The hour of the datetime

minute

The minutes of the datetime

second

The seconds of the datetime

microsecond

The microseconds of the datetime

nanosecond

The nanoseconds of the datetime

date

Returns datetime.date (does not contain timezone information)

time

Returns datetime.time (does not contain timezone information)

timetz

Returns datetime.time as local time with timezone information

dayofyear

The ordinal day of year

day_of_year

The ordinal day of year

weekofyear

The week ordinal of the year

week

The week ordinal of the year

dayofweek

The number of the day of the week with Monday=0, Sunday=6

day_of_week

The number of the day of the week with Monday=0, Sunday=6

weekday

The number of the day of the week with Monday=0, Sunday=6

quarter

Quarter of the date: Jan-Mar = 1, Apr-Jun = 2, etc.

days_in_month

The number of days in the month of the datetime

is_month_start

Logical indicating if first day of month (defined by frequency)

is_month_end

Logical indicating if last day of month (defined by frequency)

is_quarter_start

Logical indicating if first day of quarter (defined by frequency)

is_quarter_end

Logical indicating if last day of quarter (defined by frequency)

is_year_start

Logical indicating if first day of year (defined by frequency)

is_year_end

Logical indicating if last day of year (defined by frequency)

is_leap_year

Logical indicating if the date belongs to a leap year

pd.Timestamp


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved