Pandas functions
Convert DataFrame To List β pd.df.values.tolist()
Convert Pandas DataFrame to list of lists
So you want to change your nicely formatted DataFrame to a list of lists? Maybe youβre trying to get it ready for another Data Science package that doesnβt recognize pandas DataFrames.
Pseudo Code: With your DataFrameβs values, change them into a list of lists.
Pandas DataFrame To List
.tolist() Parameters
None!
Now the fun part, letβs take a look at a code sample
Official Documentation (note this is for Series.tolist())