0
My question is quite simple. Given a pd.Series as described below, how do I remove "YEARS" and "MONTHS" characters from it? I looked at the documentation of Pandas but unfortunately I could not find a way.
I made the following variable to return to pd. Series:
In:
idade_serie = dataframe['Idade'].value_counts()
Out:
80 ANOS 91
70 ANOS 85
73 ANOS 82
75 ANOS 81
76 ANOS 79
..
103 ANOS 1
17 ANOS 1
4 MESES 1
26 ANOS 1
19 AN0S 1
Name: Idade, Length: 109, dtype: int64
You have to be careful with the way you want to do Count of these values, removing the string "YEARS" and "MONTHS" will cause the numbers to unite in the sum of the
value_counts()
, it is not possible to distinguish what is what.– Terry