Plotting Event Density In Python With Ggplot And Pandas
I am trying to visualize data of this form: timestamp senderId 0 735217 106758968942084595234 1 735217 114647222927547413607 2 735217 106758968942084
Solution 1:
With the smaller dataset:
> plot = ggplot(aes(x='timestamp', color='senderId'), data=df) + geom_density()
ValueError: `dataset` input should have multiple elements.
This was because some senderId
s had only one row.
With the bigger dataset:
> plot = ggplot(aes(x='timestamp', color='senderId'), data=df) + geom_density()
numpy.linalg.linalg.LinAlgError: singular matrix
This was because for some senderId
s I had multiple rows at the exact same timestamp
. This is not supported by ggplot
. I could solve it by using finer timestamps.
Post a Comment for "Plotting Event Density In Python With Ggplot And Pandas"