I'm trying to input some values in this dataframe:
I have a list of columns name:
input: centro_oeste.columns
output: ['ADMINISTRAÇÃO', 'ANÁLISE E DESENVOLVIMENTO DE SISTEMAS',
'ARTES CÊNICAS', 'AUTOMAÇÃO INDUSTRIAL', 'CIÊNCIAS BIOLÓGICAS',
'CIÊNCIAS CONTÁBEIS', 'DIREITO', 'EDUCAÇÃO FÍSICA', 'ENFERMAGEM',
'ENGENHARIA AMBIENTAL', 'ENGENHARIA DE SOFTWARE',
'ENGENHARIA FLORESTAL', 'FISIOTERAPIA', 'FÍSICA', 'GESTÃO AMBIENTAL',
'GESTÃO CONTÁBIL E TRIBUTÁRIA', 'HISTÓRIA', 'PEDAGOGIA', 'PSICOLOGIA',
'SISTEMAS DE INFORMAÇÃO', 'ANO_INGRESSO'],
dtype='object')
From that columns list, I created a new Dataframe:
input: slope_CentroOeste = pd.DataFrame(columns=[centro_oeste.columns])
slope_CentroOeste
output: Dataframe
And now, my goal is input some value inside this dataframe, so I try:
slope_CentroOeste.loc[0] = np.nan
slope_CentroOeste.ADMINISTRAÇÃO[0] = 'x'
And Python gives the error: only integer scalar arrays can be converted to a scalar index
And i tried too
slope_CentroOeste.loc[0,'ADMINISTRAÇÃO'] = 'x'
And Python gives the error: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Please, can anyone help me?