On input I have DF similar to:
+-----+-----+
|data1|data2|
+-----+-----+
| 1.0| 0.33|
| 1.0| 0|
| 2.0| 0.33|
| 1.0| 0|
| 1.0| 0.33|
| 2.0| 0.33|
+-----+-----+
after performing pivot
pivot = df.groupBy('data1').pivot('data2').count()
structure looks like this:
+-----+----+----+
|data1| 0|0.33|
+-----+----+----+
| 1.0| 2| 2|
| 2.0|null| 2|
+-----+----+----+
Attempting to do anything with column 0.33 results in
AnalysisException: Can't extract value from 0#1535L;
How to handle this case?