Good Night Sirs, I have the following Dataframe, imported from an xlsx.
NUM_LEGISLACAO DSC_URL COD_SITUACAO ... DSC_TIPO num ano
264 89.272/1984 NaN 2.0 ... NORMATIVO 89.272 1984
265 90.396/1984 NaN 11.0 ... NORMATIVO 90.396 1984
266 90.804/1985 NaN 2.0 ... CONCRETO 90.804 1985
267 81195/1978 NaN NaN ... NaN 81195 1978
268 5475/1905 NaN NaN ... NaN 05475 1905
269 90.396/1984 NaN 11.0 ... NORMATIVO 90.396-A 1984
Imported with the code below:
df1 = pd.read_excel(file01, sheet_name='Exportar Planilha')
df1['num'], df1['ano'] = df1['NUM_LEGISLACAO'].str.split('/').str
#notok
#substitui '.' e '-' no campo 'num'
df1['num'] = df1.num.str.replace('[\.-]', '')
#formata com 5 digitos
df1.num = df1.num.astype(str).str.rjust(5, '0')
df1['num'] = df1.num.astype(str).str.zfill(5)
I want to remove '.' of the 'num' field, and produce the following result:
NUM_LEGISLACAO DSC_URL COD_SITUACAO ... DSC_TIPO num ano
264 89.272/1984 NaN 2.0 ... NORMATIVO 89272 1984
265 90.396/1984 NaN 11.0 ... NORMATIVO 90396 1984
269 90.396/1984 NaN 11.0 ... NORMATIVO 90396A 1984
However, my code does not work and displays the following error:
TypeError: Type aliases can not be used with isinstance ().