I understand that math.modf returns a string because it is a wrapper around C language standard but it means I am getting the error TypeError: cannot convert the series to <class 'float'>
when I try to add the float number as a column to my dataframe. Here is my code:
dataset = pd.read_csv('scandi_short.csv', error_bad_lines=False,
names=['Bloomberg Code', 'index', 'Bid Price', 'Ask Price', 'Trade Price','Bid Volume','Ask Volume','Trade Volume','Update type','Change to Ask','Date','Time in seconds past midnight','Opening price','Condition codes','na','na2'])
dataset['Trade price float'] = int(math.modf(dataset['Trade Price']))
print(dataset)
As you can see I have tried making the math.modf function an integer but I still get the same error, please help!