Python pandas: TypeError: Index(...) must be called with a collection of some kind, 'Email' was passed

0 votes

I am trying to create a Pandas Dataframe and the code I am using is as follows:

df1=pd.DataFrame(columns='Email')

When I run this line, I get the below error:

TypeError: Index(...) must be called with a collection of some kind, 'Email' was passed

Please help

Mar 28 in Python by Shri
381 views

2 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The syntax is not right. The right syntax is as follows:

df1=pd.DataFrame(columns=[‘Email’])
answered Mar 28 by Tina
0 votes

Try:

df1=pd.DataFrame(columns=['Email'])
answered 3 days ago by anonymous
Same as above answer!

Related Questions In Python

0 votes
2 answers

Finding the index of a character in python string

You can use word.find('o') as well to ...READ MORE

answered Jun 1, 2018 in Python by george
• 200 points
48 views
0 votes
1 answer

How do I generate some random numbers with a distribution using Python?

scipy.stats.rv_discrete is what you ned IMHO. You can supply ...READ MORE

answered Oct 31, 2018 in Python by Anirudh
• 2,050 points

edited Dec 14, 2018 by Anirudh 102 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
20 views
+4 votes
6 answers
0 votes
1 answer

Python pandas: TypeError: tuple indices must be integers or slices, not str

df.iterrows() returns a tuple with index and ...READ MORE

answered Mar 28 in Python by Jackie
389 views
0 votes
1 answer

Using Python what kind of applications can be built?

http://en.wikipedia.org/wiki/List_of_Python_software  follow the link and You will see ...READ MORE

answered Nov 14, 2018 in Python by Theodor
• 740 points
12 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.