We have TSV files which holds IOT data, want to convert to table like structure using pandas. I have worked on TSV data, similar to given below, were the logics goes like
- read the file
- Add new column names
- do transpose
- reindex
This is bit challenging as explained, col1 to col3 is dimension data and remaining is fact data
tsv file data looks as below
col1 qweqweq
col2 345435
col3 01/01/2024 35:08:09
col4 1
col5 0
col4 0
col5 0
col4 1
col5 1
col4 0
col5 1
Want to project as table like structure
col1 | col2 | col3 | col4 | col5 |
---|---|---|---|---|
qweqweq | 345435 | 01/01/2024 35:08:09 | 1 | 0 |
qweqweq | 345435 | 01/01/2024 35:08:09 | 0 | 0 |
qweqweq | 345435 | 01/01/2024 35:08:09 | 1 | 1 |
qweqweq | 345435 | 01/01/2024 35:08:09 | 0 | 1 |
col4 and col5 can differ in each IOT file. How to achieve with python, pandas?