Skip to content Skip to sidebar Skip to footer

TypeError: 'numpy.float64' Object Does Not Support Item Assignment - Similar Code, Error Raises

I am writing a Molecular Dynamics code and for that I have a function that computes forces between particles: conservative, random and dissipative forces. The conservative forces a

Solution 1:

SOLVED: As @micric pointed out, there is a variable inside the second loop called 'fr', which is of type float. I made the mistake of using the same name for an array. Hence Python's complaints.


Post a Comment for "TypeError: 'numpy.float64' Object Does Not Support Item Assignment - Similar Code, Error Raises"