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
  • 6,380
  • 5
  • 22
  • 45
PPP
  • 213
  • 2
  • 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
  • 12,086
  • 10
  • 64
  • 109