Skip to content

在运行get_day_gap_before时出现了问题 #23

@Duang735

Description

@Duang735

t7['day_gap_before'] = t7.date_received_date.apply(get_day_gap_before)
Traceback (most recent call last):

File "C:\Users\TangX\AppData\Local\Temp\ipykernel_10460\2415590082.py", line 1, in <cell line: 1>
t7['day_gap_before'] = t7.date_received_date.apply(get_day_gap_before)

File "F:\Anaconda_app\lib\site-packages\pandas\core\series.py", line 4433, in apply
return SeriesApply(self, func, convert_dtype, args, kwargs).apply()

File "F:\Anaconda_app\lib\site-packages\pandas\core\apply.py", line 1082, in apply
return self.apply_standard()

File "F:\Anaconda_app\lib\site-packages\pandas\core\apply.py", line 1137, in apply_standard
mapped = lib.map_infer(

File "pandas_libs\lib.pyx", line 2870, in pandas._libs.lib.map_infer

File "C:\Users\TangX\AppData\Local\Temp\ipykernel_10460\2229747806.py", line 6, in get_day_gap_before
this_gap = (date(int(date_received[0:4]),int(date_received[4:6]),int(date_received[6:8]))-date(int(d[0:4]),int(d[4:6]),int(d[6:8]))).days

ValueError: invalid literal for int() with base 10: 'Date'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions