i am looking for a solution to append a currency to floats. but my dataframe column also includes a string/empty cell. i expect a solution that only appends the currency to the floats in the column.
nr = [100, 200, 300, '' ,500]
text = ['a', 'b', 'c', 'd', 'e']
df = pd.DataFrame(list(zip(nr, text)),columns=['Nr', 'Text'])
i tried:
df['Nr'] = df['Nr'].astype(float).map("{:,.2f} €".format) #does not work
thanks for help.