Apr-24-2017, 03:55 PM
1)
2)
3) Even if both of those did exist, setting the temporary variable
df3
isn't defined, so you can't iterate over nothing.2)
NaN
isn't defined, so you can't set X to it.3) Even if both of those did exist, setting the temporary variable
X
to whatever NaN is wouldn't persist that change outside of the for-loop.>>> items = [2, 5, 2, 4, 3, -32, 4] >>> for item in items: ... if item < 0: ... item = None ... >>> items [2, 5, 2, 4, 3, -32, 4]