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, 2020 in Python by akhtar
• 38,180 points
116 views

1 answer to this question.

0 votes

Hi@akhtar,

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, 2020 by MD
• 95,140 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,930 points
295 views
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, 2020 in Python by Roshni
• 10,420 points
234 views
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
2,231 views
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
• 58,100 points
235 views
0 votes
2 answers
+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 1,983 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
1,522 views
0 votes
1 answer
0 votes
1 answer