0

As described above, my code seems to run perfectly well in the ipython notebook in Jupyter, but as soon as I try to run the same code in the terminal, I receive TypeError: 'Series' objects are mutable, thus they cannot be hashed.

This is my code:

for x in cc:
    y, i = 0, 0
    for v in x:
        y += df4.ix[v, 'Salary']
        i+=1
        if i == 5:
            if y <= 50000:
                valid.append(x)

I know that it's not proper, but it managed to solve my problem. I'm content to run it from the notebook for now, but I'm curious as to why I'm getting this problem. I updated all of my libraries in Anaconda and I'm still getting the error message.

Thomas K
  • 39,200
  • 7
  • 84
  • 86
  • 1
    Can you fix your indentation? It is currently not valid python. Copying into my jupyter notebook causes `IndentationError: expected an indented block`. – tmthydvnprt Jun 12 '16 at 12:35
  • 1
    You also do not define `cc` or `df4`. To make a reproducible error please define these with [some good fake example data](http://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples). – tmthydvnprt Jun 12 '16 at 12:38
  • When you have an exception too, it's often useful to give the full traceback in your question. That shows exactly where in the code the exception was triggered (though that's not always where the error is). – Blckknght Jun 13 '16 at 11:13

0 Answers0