Skip to content Skip to sidebar Skip to footer

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 senderIds 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 senderIds 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"