(df)
| 28 | |
| 29 | |
| 30 | def encode(df): |
| 31 | res = pd.DataFrame() |
| 32 | for col in df.columns.values: |
| 33 | if not is_numeric_dtype(df[col]): |
| 34 | tmp = pd.get_dummies(df[col], prefix=col) |
| 35 | else: |
| 36 | tmp = df[col] |
| 37 | res = pd.concat([res, tmp], axis=1) |
| 38 | return res |
| 39 | |
| 40 | |
| 41 | def load(device_id): |