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, 2019 in Python by Shri

edited Jun 25 by MD 19,748 views

3 answers to this question.

0 votes

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

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

Try:

df1=pd.DataFrame(columns=['Email'])
answered May 19, 2019 by anonymous
Same as above answer!
0 votes
It is not working because your code is not correct please try to this type of code I think so it's working

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

I hope it is working because I face this type of problem.

Try this.
answered May 12 by anonymous

edited May 13 by Gitika

Related Questions In Python

+1 vote
0 answers

TypeError: only integer scalar arrays can be converted to a scalar index

import cv2 import numpy as np import matplotlib.pyplot as ...READ MORE

Dec 18, 2019 in Python by sandeep
• 130 points
4,318 views
0 votes
1 answer
0 votes
1 answer

Need help writing a dataframe into a csv with the help of a loop

Using the following logic you can arrive ...READ MORE

answered Apr 17, 2018 in Python by anonymous
1,978 views
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
299 views
+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,343 views
0 votes
0 answers
+4 votes
6 answers
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
86 views
0 votes
1 answer

How to zip with a list output in Python instead of a tuple output?

Good question - Considering that you are ...READ MORE

answered Feb 7, 2019 in Python by Nymeria
• 3,520 points
205 views