Dec-20-2021, 08:41 PM
The error says that you have a float number in df1 which means you have a float number in qd1. From the screenshot this must be between rows 4 and 73511. The code below has the same problem, crashing when it tries to call (2.0).upper().
import pandas as pd df1 = pd.DataFrame(["-", "+", "1", 2.0], columns=["CRTXT"]) for x in df1['CRTXT']: print(x, ', ', sep="", end="") print(x.upper())
Output:-, -
+, +
1, 1
2.0, Traceback (most recent call last):
File "...", line 6, in <module>
print(x.upper())
AttributeError: 'float' object has no attribute 'upper'