I\'ve got a pandas dataframe with a column \'cap\'. This column mostly consists of floats but has a few strings in it, for instance at index 2.
df = cap
I tried an alternative on the above:
for num, item in enumerate(data['col']): try: float(item) except: data['col'][num] = nan