How to concatenate multiple csv to xarray and define coordinates?

后端 未结 2 1394
攒了一身酷
攒了一身酷 2020-12-22 12:30

I have multiple csv-files, with the same rows and columns and their contained data varies depending on the date. Each csv-file is affiliated with a different date, listed in

2条回答
  •  一整个雨季
    2020-12-22 13:15

    Try these:

        import glob
        import pandas as pd
    
        path=(r'ur file')
        all_file = glob.glob(path + "/*.csv")
        li = []
        for filename in all_file:
        df = pd.read_csv(filename, index_col=None, header=0)
        li.append(df)
        frame = pd.concat(li, axis=0, ignore_index=True)
    

提交回复
热议问题