0

I am having multiple dataframes of identical size and identical headers. They are each from a different date. I am looking for an elegant way to store these dataframes representing different timesteps and be able to index using the dates and columns. Later on, it must be easy to call a specific column from the dataframe representing date xx/xx/xxxx.

More info on the format: Dataframe 14/09/1984, headers: a b m n R err (each columns has 1342 lines) Dataframe 15/09/1984, headers: a b m n R err (each columns has 1342 lines) Dataframe 16/09/1984, headers: a b m n R err (each columns has 1342 lines) .... I also have a vector with the dates with the same length as the amount of dataframes.

In addition: a b m n are always identical. R and err are different in each dataframe.

  • you can create a new column for each df containing `date` and join all the dataframes. later you can call specific column values as `df[df.date=="xx/xx/xxxx/"].col` – lego king Apr 03 '19 at 18:42
  • Welcome to StackOverflow. Try to add some exmaple data so we can help you better. Heres more information on how to make a good `pandas` question: https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples – Erfan Apr 03 '19 at 18:45
  • Thanks Kapil, is there no way to cross directly my 1x12 date vector dataframe and my 12 dataframes of size 6x1342 then? I considered your option, but found it a bit unelegant to have to copy the same date 1342 times in each dataframe... – Sarah Garre Apr 03 '19 at 19:17
  • I now do `ERT_data['dates'] = dattime.iloc[i,0]` to loop over the 12 dates with i and adding to each dataframe the respective date as column indeed. – Sarah Garre Apr 03 '19 at 21:05

0 Answers0