1

I am trying to create a list of dataframes.

I print my dataframe normally and it works fine.

    print(df)

however if I create a list to store my df, it does not seem to work coz it prints 'None' from listOfDataframe.

    # Create list of data frame using list
    listOfDataframe = []
    listOfDataframe = listOfDataframe.append(df)
    print(listOfDataframe)

whats happening and How do I fix it?

chen abien
  • 257
  • 1
  • 6

1 Answers1

0

There is no need to reassign a list after appending something to it. It changes it automatically:

# Create list of data frame using list
listOfDataframe = []
listOfDataframe.append(df)
print(listOfDataframe)

It is returning None simply because the append method returns None.

See Henry Ecker's comments.

Jaeden
  • 332
  • 2
  • 4
  • 16