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 in Python by Hannah
• 17,070 points
37 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 by Eric

Related Questions In Python

+2 votes
2 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,360 points
8,554 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 in Python by Waseem
• 4,480 points
34 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 in Python by Pavan
259 views
0 votes
1 answer
0 votes
1 answer
+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 in Python by Saira
128 views
+1 vote
1 answer