there is a column in my data set that I should convert its elements to another unit(e.g. bit to byte), and there is some missing values(e.g. " ") that I should change all of them to "np.nan". I can do that separately and using something like a 'for' loop, but I believe there is a better way. any help please.
Asked
Active
Viewed 218 times
1 Answers
0
Try something like this:
data['column'] = np.where(data['column'] == ' ', np.nan, data['column'])

Gedas Miksenas
- 959
- 7
- 15