Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

'tuple' object is not callable for list of zip

I am doing

list(zip(df['target'], df['smth']))

and get an error:

'tuple' object is not callable

The funny thing, that I am doing the exactly same thing in another notebook with the almost the same dataframe and it works. Also it worked here also, until sometime. I have no idea, what’s wrong here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

df[‘target’] is int64

df[‘smth’]) is object

>Solution :

Probably, in your notebook, you have defined a variable called list as a tuple.

For example, list = (1, 2)

When you call list(zip(df['target'], df['smth'])) it considers list as tuple, not a Python function. That is why you are getting this error.

Possible solutions

  • restart your kernel
  • delete your list variable del list
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading