Needing to create a heatmap with seaborn, can't seem to get there or fully grasp how.
Each component (row) needs to be present on the heatmap. On the left (y-axis) should be present the EID of each component. There are a lot so if only 1 every 10-20 is labelled, that's fine. On the x-axis should be ROTATION1 ROTATION2 ROTATION3 ROTATION4 ROTATION5 which represent the 5 columns of the dataset. Column EXTRA here is irrelevant for the heatmap.
The values that should be represented by the heatmap are either ROT STILL FLIP or any number between 160-180 separated by 2 (so 160 162 164 etc).
Some rows are blank for all columns ROTATION1 - ROTATION5 but the components should still be included in the heatmap (and show no colours for them).
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| EID | EXTRA | ROTATION1 | ROTATION2 | ROTATION3 | ROTATION4 | ROTATION5 |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| AB1178 | POS | FLIP | | STILL | 172 | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| EC8361 | NEG | | | | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| QS7229 | POS | | | 160 | | ROT |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| SE0447 | NEG | ROT | STILL | | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| YT5489 | NEG | | | | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| SZ2548 | NEG | 164 | | | FLIP | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| OT6892 | POS | FLIP | | | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| PL3811 | POS | | | | STILL | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| WQ0893 | POS | | | ROT | | 170 |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| TY3551 | NEG | 160 | FLIP | | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| PC6466 | POS | | 180 | 176 | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| YH5912 | POS | | | | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| BK6245 | NEG | | | | STILL | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| GQ2081 | POS | | | | 162 | FLIP |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| GF8633 | NEG | | | | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| FJ4895 | NEG | | 174 | | ROT | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| YD2504 | POS | | | | | 162 |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| RF3510 | POS | | | | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| PN6167 | NEG | | 168 | FLIP | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| RB9747 | POS | FLIP | | STILL | 178 | STILL |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| BQ0841 | NEG | | ROT | | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| HJ5187 | NEG | | | | | |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| BP2359 | POS | 168 | STILL | | | ROT |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
| FN6198 | POS | ROT | | | 172 | FLIP |
+--------+-------+-----------+-----------+-----------+-----------+-----------+
What I have tried:
df = pd.read_csv('DATA.csv')
df = pd.DataFrame(df, columns = ['EID', 'ROTATION1','ROTATION2', 'ROTATION3', 'ROTATION4', 'ROTATION5'])
in_range = list(range(160,181, 2))
direction = ['ROT', 'FLIP', 'STILL']
elements = direction + ([str(num) for num in num_range])
sensing = sns.load_dataset("df")
sensing = sensing.pivot("EID", ['EID', 'ROTATION1','ROTATION2', 'ROTATION3', 'ROTATION4', 'ROTATION5'], elements)
heatmap = sns.heatmap(sensing)
This does not work because I think the "x-axis" elements should be in the form of a column, not multiple rows? If anyone can tell me how to get round that would be great!
Outcome wanted:
A heatmap with the "colour legend bar" on the right to have ROT STILL FLIP and numbers between 160-180 separated by 2. In that order if at all possible.
As previously said, the y-axis on the left should have the EID but the actual dataset is about 200 rows so one represented every 10 or 20 is fine.
There should be 5 columns in the heatmap, each representing ROTATION1 to ROTATION5
I am inexperienced and just need a bit of help.
Using Python2.7 and PANDAS 0.24.2 and seaborn 0.9.1



