I have a column in a csv that contains decimal values, but a few here and there are blank. I need to put in a “0.00” in the those specific cells. Everything I’ve seen so far has been about cells that say “NaN” but that’s not my cause. When I print the data frame, the cell is entirely empty.
It’s currently listed as an object data type but when I try and switch it to a float, I get an error on those blank cells.
There is other data in other columns for that row that I need, so I want to fill in this blank cell with a 0 so I can use the other data.
I’ve tried:
mask = (df[‘CommissionRate’] == ”)
df.loc[mask, ‘CommissionRate’] = ‘0.00’
and variations of:
for row in df:
if row is None:
row = ‘0’
df.append(row)
but when I print the dataframe those cells aren’t filled.