How to convert a dataframe into list?

0 votes

Hi Guys,

I have one dataframe in pandas. I want to convert this dataframe into list. How can I do that?

Apr 24 in Python by akhtar
• 11,270 points

1 answer to this question.

0 votes


You can convert your dataframe into list. For that you have to convert your dataframe into array and after that you can convert that array into list. You can use this below command.

$ dataframe.values.tolist()

Hope this will help.

answered Apr 24 by MD
• 24,500 points

Related Questions In Python

0 votes
1 answer

How to have values from a List1 into Columns Names and List 2 Values as Index for an Empty DataFrame

Try like this, it will give you ...READ MORE

answered Jul 10, 2019 in Python by Cherukuri
• 32,460 points
0 votes
1 answer

How to convert each list item into string in a column of data frame. ?

Hey, To split a string you can use ...READ MORE

answered Feb 5 in Python by Roshni
• 600 points
0 votes
1 answer

How can I convert a list of dictionaries from a CSV into a JSON object in Python?

You could try using the AST module. ...READ MORE

answered Apr 17, 2018 in Python by anonymous
0 votes
1 answer

How to split a string into a list?

You can use the function  text.split() This should be ...READ MORE

answered Jul 30, 2018 in Python by Priyaj
• 57,530 points
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 963 views
0 votes
0 answers
+4 votes
6 answers
0 votes
1 answer

How to convert one list into generator?

Hi@akhtar, Say, you have one list A. Now convert ...READ MORE

answered Apr 23 in Python by MD
• 24,500 points
0 votes
1 answer

How to convert sqlite format to CSV format?

Hi@akhtar, If you want to read SQLite format ...READ MORE

answered Feb 11 in Python by MD
• 24,500 points