https://kedro.org/ logo
#questions
Title
# questions
p

Pablo Biosca

12/20/2023, 12:53 PM
Hi everyone, I´m loading a csv file as pandas dataset, some columns are dates [%m %d %Y] (US format) and I want to get them loaded as a date type with format [%Y %m %d], what should I add to the catalog YAML? or should I do the change in a node? ''' dataset: type: pandas.CSVDataset filepath: data\01_raw\DataSet.csv load_args: dtype: { 'Order ID': object, #columns set as object dtype 'Transaction ID': object, 'Listing ID': object, } '''
j

Juan Luis

12/20/2023, 12:57 PM
hey @Pablo Biosca! you can try adding the
parse_dates
parameter to
load_args
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html for example
Copy code
dataset:
  type: pandas.CSVDataset
  filepath: data\01_raw\DataSet.csv
  load_args:
    dtype: ...
    parse_dates: ["date_col1", "date_col2"]
p

Pablo Biosca

12/22/2023, 2:16 PM
Thank you!
🙌🏼 1