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]
# datatoexcel=pd.ExcelWriter("ben.xlsx",engine="xlsxWriter")
# data.to_excel(datatoexcel,sheet_name='sheet1')
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

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
+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
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
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
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
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 vote
0 answers

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

Dec 17, 2019 in Python by Rajesh Babu
• 130 points
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
0 votes
1 answer

how to solve the error : "ImportError: No module named Tkinter" in python.

Hi@Umama, If you are using Linux system, then ...READ MORE

answered Apr 27, 2020 in Python by MD
• 95,300 points