0

I found this post: append multiple pandas data frames at once

I understand how this work:

import numpy as np
import pandas as pd

dates = np.asarray(pd.date_range('1/1/2000', periods=8))
df1 = pd.DataFrame(np.random.randn(8, 4), index=dates, columns=['A', 'B', 'C', 'D'])
df2 = df1.copy()
df3 = df1.copy()
df = df1.append([df2, df3])

print df

But how do I do it if I have +100 dataframes to append to df1?

df2, df3....df99,df100

I do have a list that has all of my dataframes:

list1 = [df1, df2,..., df100]

obs. My dataframes do not have the same columns.

For example:

print(list1[1]):

           email   spot      speed  d1   d2
0  tom@gmail.com  copenhagen  5     West North 


print(list[2]):

              email    spot speed    d1    d2    d3
 0  sasha@gmail.com    Malmo   17   South South North 

Many thanks for your help!

Toby
  • 13
  • 5

0 Answers0