-1

I try to create a new df out of df_exo, however the error I get is 'DataFrame' object is not callable. df_exo is a DataFrame with 176, 1222 size. What is going wrong?

df_features = df_exo(['INDU.NL.INTM.1.BS.M', 'INDU.NL.CONS.1.BS.M_4',\
 'INDU.NL.INTM.2.BS.M', 'INDU.NL.INTM.3.BS.M_12', 'INDU.NL.CONS.4.BS.M_10',\
 'INDU.NL.INTM.COF.BS.M_3', 'INDU.NL.INTM.COF.BS.M_4', 'INDU.NL.INVE.5.BS.M_11',\
 'INDU.NL.FOBE.7.BS.M_4', 'INDU.NL.TOT.1.BS.M_1', 'INDU.NL.TOT.6.BS.M_4',\
 'INDU.NL.INTM.2.BS.M', 'SERV.NL.TOT.2.BS.M', 'SERV.NL.TOT.3.BS.M',\
 'SERV.NL.TOT.1.BS.M_2', 'SERV.NL.TOT.1.BS.M_3', 'SERV.NL.TOT.3.BS.M_1',\ 
 'SERV.NL.TOT.3.BS.M_2', 'SERV.NL.TOT.COF.BS.M_7', 'CONS.NL.TOT.7.BS.M',\
 'CONS.NL.TOT.6.BS.M_12', 'CONS.NL.TOT.7.BS.M_1', 'CONS.NL.TOT.7.BS.M_2',\
 'CONS.NL.TOT.7.BS.M_12', 'BUIL.NL.TOT.3.BS.M_12'])
abhilb
  • 5,639
  • 2
  • 20
  • 26
Nora
  • 3
  • 1

1 Answers1

1

use

df_features = df_exo[['col1', 'col2']]

not

df_features = df_exo(['col1', 'col2'])

Reference: Selecting multiple columns in a pandas dataframe

JxCode
  • 160
  • 5