How to convert a table (mXn) to a list of lists (rows of the table mentioned)?

data_science
python

#1

I mean a flat list but not an array.


#2

Hi Akshay,

When you say table, do you mean a pandas dataframe or something else?

Regards
Ankit


#3

A pandas dataframe.


#4

Hi @akshay.kotha

You can use tolist() to convert table into list of lists.


#5

I think it is df.values.tolist()