How do I create a dataframe using a dictionary in pandas

0 votes
I was just wondering how to create a dataframe using a dictionary. I know how to create one using a list but not using a dictionary. Any help will be appreciated.

Thanks!
Nov 18, 2019 in Python by Hannah
• 18,520 points
793 views

1 answer to this question.

0 votes

Hi @Hannah,

You need to define your dictionary first

dictionary = {'fruits':['apples','banana','mangoes'],'count':[10,15,20]}
df = pd.DataFrame(dictionary)
dictionary
answered Nov 18, 2019 by Eric

Related Questions In Python

+2 votes
4 answers

How can I replace values with 'none' in a dataframe using pandas

Actually in later versions of pandas this ...READ MORE

answered Aug 13, 2018 in Python by bug_seeker
• 15,510 points
122,466 views
0 votes
0 answers

how do sort the columns in a dataframe using the pandas?

can you give an example using dataframe? READ MORE

May 6, 2019 in Python by Waseem
• 4,540 points
661 views
0 votes
1 answer

How to create Pandas series from numpy array?

Hi. Refer to the below command: import pandas ...READ MORE

answered Apr 1, 2019 in Python by Pavan
3,521 views
0 votes
1 answer
0 votes
1 answer

How to create Pandas series from dictionary?

Here's a sample script: import pandas as pd import ...READ MORE

answered Apr 1, 2019 in Python by Prateek
2,337 views
0 votes
2 answers
+1 vote
1 answer

how do i get a optimal cutoff value(directly in the form of numeric) from roc curves?

The optimal CutOff value is the point ...READ MORE

answered Oct 17, 2019 in Python by Saira
3,373 views
+1 vote
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP