How to create Pandas dataframe from Python list?

0 votes

Hi. I have a list in Python, how can I create a dataframe using that list? Please mention the code.

Apr 5 in Python by Raj
37 views

1 answer to this question.

0 votes

You can do it like this:

import  pandasas pd
name=[‘John’,’mike’,’Eric’,’Rachel’]
df=pd.DataFrame(name, columns=[‘Name’])
answered Apr 5 by Likhita

Related Questions In Python

0 votes
1 answer

How to create a train and test sample from one dataframe using pandas?

Hi, The below written code can help you ...READ MORE

answered Jul 3 in Python by Taj
• 920 points
18 views
0 votes
1 answer

How to create LIST from CSV file in Python?

You can use the pandas library for this which ...READ MORE

answered Jul 15 in Python by Karan
10 views
0 votes
1 answer

How to convert a Pandas GroupBy object to DataFrame in Python

g1 here is a DataFrame. It has a hierarchical index, ...READ MORE

answered Nov 12, 2018 in Python by Nymeria
• 3,500 points
3,732 views
0 votes
1 answer

How to create and read from a temporary file in Python?

Hi, there is a very simple solution ...READ MORE

answered Jan 29 in Python by Nymeria
• 3,500 points
37 views
0 votes
1 answer

How to rename columns in pandas (Python)?

It is easy by just adding ".columns" ...READ MORE

answered Apr 30, 2018 in Data Analytics by DeepCoder786
• 1,700 points
75 views
0 votes
1 answer

What is the Difference in Size and Count in pandas (python)?

The major difference is size includes NaN ...READ MORE

answered Apr 30, 2018 in Data Analytics by DeepCoder786
• 1,700 points
653 views
0 votes
2 answers
0 votes
1 answer

Converting a pandas data-frame to a dictionary

Emp_dict=Employee.to_dict('records') You can directly use the 'to_dict()' function ...READ MORE

answered May 23, 2018 in Data Analytics by Bharani
• 4,550 points
1,013 views
0 votes
1 answer

How to create empty pandas dataframe only with column names?

You can do it like this: df=pd.DataFrame(columns=["Name","Old","New ...READ MORE

answered Apr 5 in Python by Hari
65 views
0 votes
1 answer

How to create blank csv file in pandas?

Try this code: open("User data.csv", 'w') Where User data.csv ...READ MORE

answered Apr 5 in Python by Will
260 views