I am trying to transpose a data table to make it easier to read.
The ultimate table would include a column of headers for the rows, a single column that is filtered from another data table, a column for adding values to the filtered column, and a final column that shows the end result.
Not sure how to show it here, but I will try.
Col 1 | Col 2 | Col 3 | Col 4
Feat 1 | 1232 | 13 | 1245
Feat 2 | 3423 | 0 | 3423
Feat 3 | 7965 | -23 | 7942
Feat 4 | 123 | 42 | 165
Feat 5 | 3554 | 2 | 3556
Feat 6 | 534 | 0 | 534
Again, Col 1 would describe what is in the row.
Col 2 would be copied from another data table.
Col 3 would be entered by the user.
Col 4 would be output by the system.
I have been searching for a way to transpose it, but it seems to not be possible.
Hi @orenross and welcome to the Dash Community,
I’m not sure if I understand your issue but you can transpose any DataFrame in Pandas:
And then use in a Dash table.
Thanks for the welcome. I tried transposing and it presents two problems -
One, I get an error - Invalid argument
columns.name passed into DataTable with ID “table”.
Two, I believe I will lose some of the functionality, since I want the first column to act more like a header.
In terms of what I am trying to do, the goal is to have a table with one column set by the system. Another column is for the user to input information. The final column takes the system information, combines it with the user input information, and gives a new value.
So in my example (the first row), the first column is the header, the second column, the system has ‘1232’, the user then inputs ‘13’ in the second column, the system then adds the two and gets ‘1245’. This would just be the beginning, since the final product will include some ML to give a final value based on the changes. I apologize if I am not explaining it well.
According to my research, it does not seem possible, but was hoping someone had an idea.
Everything is possible but you need to improve your writing skills.
For answering about the error its necesary to have a code example.
What are the steps of the process? for example:
The system shows the first and second column and ask the user to enter the 3rd, then calculate the last one and after that the information is transpose and showed in a table.
Or the system transpose the table and then the user enters the information in the 3rd row.