Python Typeerror: Cannot Convert The Series To When Trying To Do Math On Dataframe
I have a data frame that looks something like this: defaultdict(, {'XYF': TimeUS GyrX GyrY GyrZ AccX \ 0
Solution 1:
What if you do this (as was suggested earlier):
new_time = dfs['XYF']['TimeUS'].astype(float)
new_time_F = new_time / 1000000
Solution 2:
Seems your initial data contains strings and not numbers. It would probably be best to ensure that the data is already of the required type up front.
However, you can convert strings to numbers like this:
pd.Series(['123', '42']).astype(float)
instead of float(series)
Solution 3:
You can use from the pd.to_numeric(s)
Post a Comment for "Python Typeerror: Cannot Convert The Series To When Trying To Do Math On Dataframe"