I’d like to perform one-hot encoding on the industryCode column and preserve all other columns in the following table.
| date | windCode | industryCode |
|---|---|---|
| 2022.08.01 | 000001.SZ | 1101 |
| 2022.08.02 | 000002.SZ | 1102 |
| 2022.08.03 | 000003.SZ | 1103 |
After the conversion, the table should look like:
| date | windCode | 1101 | 1102 | 1103 |
|---|---|---|---|---|
| 2022.08.01 | 000001.SZ | 1 | 0 | 0 |
| 2022.08.02 | 000002.SZ | 0 | 1 | 0 |
| 2022.08.03 | 000003.SZ | 0 | 0 | 1 |