I have two lists, each one with the same number of dataframes that I imported from csv files.
So "dataframes" has 12 dataframes and "Dataframes potential" has also 12 Dataframes.
They have the same number of rows and I would like to concatenate them (pair of each one).
dataframes
[ Name people ... Tcs_sys_sup_C Tcs_sys_re_C
DATE ...
2011-01-01 00:00:00 B10540 42.0 ... 0.0 0.0
2011-01-01 01:00:00 B10540 42.0 ... 0.0 0.0
2011-01-01 02:00:00 B10540 42.0 ... 0.0 0.0
2011-01-01 03:00:00 B10540 42.0 ... 0.0 0.0
2011-01-01 04:00:00 B10540 42.0 ... 0.0 0.0
... ... ... ... ... ...
2011-12-31 19:00:00 B10540 41.0 ... 0.0 0.0
2011-12-31 20:00:00 B10540 41.0 ... 0.0 0.0
2011-12-31 21:00:00 B10540 42.0 ... 0.0 0.0
2011-12-31 22:00:00 B10540 42.0 ... 0.0 0.0
2011-12-31 23:00:00 B10540 42.0 ... 0.0 0.0
[8760 rows x 136 columns],
Name people ... Tcs_sys_sup_C Tcs_sys_re_C
DATE ...
2011-01-01 00:00:00 B10549 1.0 ... 0.0 0.0
2011-01-01 01:00:00 B10549 1.0 ... 0.0 0.0
2011-01-01 02:00:00 B10549 1.0 ... 0.0 0.0
2011-01-01 03:00:00 B10549 1.0 ... 0.0 0.0
2011-01-01 04:00:00 B10549 1.0 ... 0.0 0.0
... ... ... ... ... ...
2011-12-31 19:00:00 B10549 1.0 ... 0.0 0.0
2011-12-31 20:00:00 B10549 1.0 ... 0.0 0.0
2011-12-31 21:00:00 B10549 1.0 ... 0.0 0.0
2011-12-31 22:00:00 B10549 1.0 ... 0.0 0.0
2011-12-31 23:00:00 B10549 1.0 ... 0.0 0.0
[8760 rows x 136 columns],.....
and Dataframes potential
[ SC_FP_walls_south_Q_kWh ... T_SC_re_C
Date ...
2011-01-01 00:00:00 0.0 ... NaN
2011-01-01 01:00:00 0.0 ... NaN
2011-01-01 02:00:00 0.0 ... NaN
2011-01-01 03:00:00 0.0 ... NaN
2011-01-01 04:00:00 0.0 ... NaN
... ... ... ...
2011-12-31 19:00:00 0.0 ... NaN
2011-12-31 20:00:00 0.0 ... NaN
2011-12-31 21:00:00 0.0 ... NaN
2011-12-31 22:00:00 0.0 ... NaN
2011-12-31 23:00:00 0.0 ... NaN
[8760 rows x 18 columns],
SC_FP_walls_south_Q_kWh ... T_SC_re_C
Date ...
2011-01-01 00:00:00 0.0 ... NaN
2011-01-01 01:00:00 0.0 ... NaN
2011-01-01 02:00:00 0.0 ... NaN
2011-01-01 03:00:00 0.0 ... NaN
2011-01-01 04:00:00 0.0 ... NaN
... ... ... ...
2011-12-31 19:00:00 0.0 ... NaN
2011-12-31 20:00:00 0.0 ... NaN
2011-12-31 21:00:00 0.0 ... NaN
2011-12-31 22:00:00 0.0 ... NaN
2011-12-31 23:00:00 0.0 ... NaN
[8760 rows x 18 columns],....
I tried a very simple
frames=[dataframes_potencial_process,dataframes]
pd.concat(frames)
TypeError: cannot concatenate object of type '<class 'list'>'; only Series and DataFrame objs are valid
Thank you
final= pd.concat(dfs + dfs_potential, axis =1). For case 2, use[pd.concat([dfs[i], dfs_potential[i]], axis=1) for i in len(dfs)]