Ich versuche, Daten von dieser Form sichtbar zu machen:Ereignisdichte in Python mit ggplot Plotten und Pandas
timestamp senderId
0 735217 106758968942084595234
1 735217 114647222927547413607
2 735217 106758968942084595234
3 735217 106758968942084595234
4 735217 114647222927547413607
5 etc...
geom_density
funktioniert, wenn ich nicht trennen die senderId
s:
df = pd.read_pickle('data.pkl')
df.columns = ['timestamp', 'senderId']
plot = ggplot(aes(x='timestamp'), data=df) + geom_density()
print plot
Das Ergebnis sieht aus, als erwartet:
Allerdings, wenn ich die senderId
s getrennt, as is done in the doc zeigen will, ist es nicht:
> plot = ggplot(aes(x='timestamp', color='senderId'), data=df) + geom_density()
ValueError: `dataset` input should have multiple elements.
Der Versuch, aus mit einer größeren Datenmenge (~ 40K Ereignisse):
> plot = ggplot(aes(x='timestamp', color='senderId'), data=df) + geom_density()
numpy.linalg.linalg.LinAlgError: singular matrix
Jede Idee ? Es gibt einige Antworten auf SO für diese Fehler, aber keine scheint relevant zu sein.
Dies ist die Art von Graph I (aus ggplot des doc) wollen:
Ich weiß, das ist seltsam, aber passiert etwas anderes, wenn Sie 'colour' anstelle von' color' angeben? – ASGM