1

How do I solve the attribute error:

The given column for the id is not present in the data 

when the column_id is 'ID' in the pandas dataframe used as input for the tsfresh "extract_features" function?

Hagbard
  • 3,430
  • 5
  • 28
  • 64
Beaty
  • 21
  • 5

1 Answers1

3

Problem is ID is level of MultiIndex, so need convert all levels to columns first by reset_index:

df = df.reset_index()
jezrael
  • 822,522
  • 95
  • 1,334
  • 1,252
  • i added this line and may I ask how to solve this error 'cannot insert level_0, already exists' – Beaty Jan 30 '19 at 08:16
  • what is `print (df.info())` ? – jezrael Jan 30 '19 at 08:41
  • MultiIndex: 506 entries, (11, 003d25e3fac5a1d2aa4ba502ffb77b5b, F, 67, SINGAPOREAN, 24/05/17, LIFE1, 67) to (13, ff575837be18088c0d64ae00a0228621, M, 38, SINGAPOREAN, 16/05/17, LIFE1,HIV, 38) Data columns (total 62 columns): Albumin 506 non-null float64 Alkaline Phosphatase 506 non-null float64 – Beaty Jan 31 '19 at 02:39