Module not callable in python in the following code

0 votes
mport pandas as pd
import xlsxwriter as xw

input_string = input("Enter a list numbers:")
data = input_string.split( )
print("user list is", data)
df = pd.DataFrame(data, columns=[0])
Left = df[0].str[:1]
print(Left)
# datatoexcel=pd.ExcelWriter("ben.xlsx",engine="xlsxWriter")
# data.to_excel(datatoexcel,sheet_name='sheet1')
# datatoexcel.save()
workbook = xw.workbook("assign.xlsx")
sheet = workbook.add_worksheet("project")
row = 0
column = 0
for item in data:
    sheet.write(row, column, item)
    row += 1
workbook.close( )
May 23, 2020 in Python by Ratan
• 120 points
2,602 views

Hi, @Ratan,

This error statement TypeError: 'module' object is not callable is raised as you are being confused about the Class name and Module name. The problem is in the import line. You are importing a module, not a class. This happens because the module name and class name have the same name.

No answer to this question. Be the first to respond.

Your answer

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

Related Questions In Python

0 votes
1 answer

i am normalizing the data set iris in python and get the error ::TypeError: 'numpy.float64' object is not callable

TRY THIS   #Nomalisation for i in names:     print(i)   ...READ MORE

answered Aug 20, 2019 in Python by Noel Deepak Palle
5,909 views
0 votes
0 answers

What do the three different types of brackets in Python code mean? I'm not sure if this is right, so if I'm wrong, please tell me:

[] - Normally used for dictionaries, list items () - ...READ MORE

Sep 11, 2023 in Python by Satyawrat
• 460 points
279 views
+1 vote
3 answers
0 votes
1 answer

What are the best IDE/platform to write code in Python

Just as any other programming language, even ...READ MORE

answered May 28, 2019 in Python by Harsh
• 260 points
734 views
0 votes
1 answer

What does the penup() do in Python(turtle module)

penup() basically makes sure that the moving ...READ MORE

answered Jun 21, 2019 in Python by Iris
6,528 views
0 votes
1 answer

How to resolve the typeerror in python os module?

TypeError - because the argument doesn't have ...READ MORE

answered Jul 31, 2019 in Python by Mohammad
• 3,230 points
1,665 views
0 votes
1 answer

Is it possible to find the source code of built-in functions of Python?

Since Python is open source you can ...READ MORE

answered Jul 17, 2019 in Python by Neel
• 3,020 points
4,780 views
0 votes
1 answer

What is the logic to check if a number is prime or not in python?

n = int (input ('ENTER NUMBER TO ...READ MORE

answered Jul 16, 2020 in Python by amrut
• 240 points
1,073 views
+1 vote
0 answers

how to match the following string without a regular expression in python

abc_pqr_0_114_004.xxx ab_pq_04_114.xxx READ MORE

Dec 17, 2019 in Python by Rajesh Babu
• 130 points
1,790 views
0 votes
1 answer

i write this python to read dataset into panda data frame but im getting NameError: name 'true' is not defined. Below is the code:

change  def parse(path):   g = gz ...READ MORE

answered Mar 15, 2020 in Python by Abhishek Shingadiya
3,661 views
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