Python:在数据框中将timedelta转换为int
问题描述:
我想在pandas数据框中创建一列,该列是timedelta列中天数的整数表示.是否可以使用"datetime.days",还是我需要做更多手动操作?
I would like to create a column in a pandas data frame that is an integer representation of the number of days in a timedelta column. Is it possible to use 'datetime.days' or do I need to do something more manual?
timedelta列
7天23:29:00
7 days, 23:29:00
天整数列
7