TypeError tuple object is not callable

0 votes
TypeError                                 Traceback (most recent call last)
<ipython-input-192-4f772c6e1b0b> in <module>
      1 X1 = data['TV'].values.reshape(-1,1)
----> 2 y_pred = reg.predict(X1)
      3 plt.figure()
      4 plt.scatter(data['TV'],data['sales'],c='yellow')
      5 plt.plot(data['TV'],y_pred,c='blue',linewidth=2)

TypeError: 'tuple' object is not callable
Nov 10, 2020 in Data Analytics by Prasanna
• 120 points
25,161 views
thistuple = tuple(("apple", "banana", "cherry"))
print(thistuple)


THIS IS MY ERROR:  PLEASE RESOLVE ANYBODY QUICKLY
Traceback (most recent call last):
  File "C:\Users\Aadi\PycharmProjects\pythonProject\Tuple.py", line 36, in <module>
    thistuple = tuple(("apple", "banana", "cherry"))
TypeError: 'tuple' object is not callable
# using the tuple method() to make a tuple.  note: Don't Forget Double cote(())
thistuple = tuple(("apple", "mango", "orange"))
print(thistuple)
Traceback (most recent call last):
  File "C:\Users\Aadi\PycharmProjects\pythonProject\Tuple.py", line 36, in <module>
    thistuple = tuple(("apple", "mango", "orange"))
TypeError: 'tuple' object is not callable

Hi,

It is working fine in my python prompt.

>>> thistuple = tuple(("apple", "mango", "orange"))
>>> print(thistuple)
('apple', 'mango', 'orange')

You need to check your environment in python. First, try with the prompt.

Ok body

But why to give me Error in my python prompt.
Hi@Aditya,

That is what I told you. Check your python environment. Or uninstall python and then reinstall it.
ok

i am understand

1 answer to this question.

0 votes

Hi, @Prasanna,

The “TypeError: ‘tuple’ object is not callable” error is raised when you try to call a tuple as a function. This can happen if you use the wrong syntax to access an item from a tuple or if you forget to separate two tuples with a comma.

Make sure when you access items from a tuple you use square brackets.

answered Nov 10, 2020 by Gitika
• 65,770 points

Related Questions In Data Analytics

0 votes
1 answer

Error saying "Error in df$item : object of type 'closure' is not subsettable" when trying to use arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,840 points
1,765 views
0 votes
1 answer

R Shiny Error: Object of type 'closure' is not subsettable

The error you mentioned happens when you ...READ MORE

answered Aug 20, 2019 in Data Analytics by anonymous
• 33,030 points
6,360 views
0 votes
1 answer

Check if the object(variable) is defined in R

You can use the exists(): > exists("toFindUnknown") [1] FALSE > ...READ MORE

answered Apr 17, 2018 in Data Analytics by Sahiti
• 6,370 points
795 views
+1 vote
1 answer

What does “Error: object '<myvariable>' not found” mean?

The error means that R could not ...READ MORE

answered Oct 29, 2018 in Data Analytics by Ali
• 11,360 points
2,047 views
+1 vote
1 answer

"Error in eval(ei, envir) : object 'RDX2' not found" when trying to source the code in R

This is a very common issue that ...READ MORE

answered Oct 30, 2018 in Data Analytics by Maverick
• 10,840 points
5,108 views
+1 vote
1 answer

How to check if object is defines in R?

You can use the exists function for ...READ MORE

answered Nov 6, 2018 in Data Analytics by Kalgi
• 52,350 points
741 views
0 votes
1 answer

Error saying "object 'mvnorm' not found"

You seem to have made a small ...READ MORE

answered Nov 9, 2018 in Data Analytics by Maverick
• 10,840 points
1,252 views
+1 vote
1 answer

Error saying "The following signatures couldn't be verified because the public key is not available: NO_PUBKEY"

Try this: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ...READ MORE

answered Nov 12, 2018 in Data Analytics by Maverick
• 10,840 points
1,200 views
0 votes
1 answer

18) OLAP is 'Analytics used with Business intelligence'

Option a) True. If you wish to master ...READ MORE

answered Dec 3, 2020 in Data Analytics by Gitika
• 65,770 points
843 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