0
I have the function:
def zero_to_null(x):
if x == 0:
x = np.nan
return x
Uso series.apply:
Series.apply(zero_to_null)
However, the values 0 are not converted to np.Nan:
Series.value_counts()
0 35
2 4
1 3
13 2
151 2
4 2
...
Does anyone know what’s going on?
Got it. It worked. I didn’t call the variable Series, I just put a generic name to represent what I was doing. Thank you so much for your help!
– Otávio Simões Silveira