panda dataframe to list

df.values.tolist()

Here is what the above code is Doing:
1. We’re creating a list of all the values in the dataframe.
2. We’re converting the list to a numpy array.
3. We’re reshaping the array into a 2D array.
4. We’re converting the 2D array into a list.