0

Is is possible to create multiple dataframes under pandas library?

The following codes is what I have tried but it doesn't work...

df1, df2 = pd.DataFrame()
Daniel Walker
  • 5,220
  • 3
  • 18
  • 39
PPP
  • 143
  • 10

1 Answers1

4

You could do something like this:

df1, df2 = (pd.DataFrame(),) * 2

Or, more explicitly:

df1, df2 = pd.DataFrame(), pd.DataFrame()

Or even:

df1 = df2 = pd.DataFrame()

See this answer for a great explanation.

blacksite
  • 11,076
  • 8
  • 58
  • 102