从 csv 读取时解析日期

你可以指定包含日期的列,以便在从 csv 读取时 pandas 会自动解析它们

pandas.read_csv('data_file.csv', parse_dates=['date_column'])