May-24-2020, 01:21 PM
(This post was last modified: May-24-2020, 01:21 PM by donnertrud.)
Hi guys,
I got a data set with missing values, however, those cells contain a "." instead of being empty. Here is an example :
![[Image: YPsYKvz]](https://imgur.com/a/YPsYKvz)
I want to resample the data to weeks with
But this gives me the error :
DataError: No numeric types to aggregate
I guess I have to replace the cells, but I don't know with what and moreover, I do know how replace the string "." in the column, but this will also replace the other already existing values. I appreciate any help!
Edit : I tried the following :
But this still replaces all "."
I got a data set with missing values, however, those cells contain a "." instead of being empty. Here is an example :
I want to resample the data to weeks with
1 |
df = df.resample( '1W' ).mean() |
DataError: No numeric types to aggregate
I guess I have to replace the cells, but I don't know with what and moreover, I do know how replace the string "." in the column, but this will also replace the other already existing values. I appreciate any help!
Edit : I tried the following :
1 2 3 4 5 |
for i in range ( len (df5[ "x" ])): if df5[ "x" ][i].isnumeric() is False : df5[ "x" ][i] = df5[ "x][i].replace(" . "," ") else : pass |