2
$\begingroup$

I have a data frame like this:

timestamp vote_count 00:12:30 350 05:05:00 50 01:10:35 200 05:05:00 175 .............................. .............................. 00:12:30 900 

Now I want to visualize the vote_count for the timestamps and do some analysis on that further. How can I plot the two columns against each other using matplotlib or seaborn?

Note: The timestamp is in 24hr format. Also, at any timestamp, there can be multiple vote counts.

$\endgroup$
3
  • $\begingroup$df=df.groupby('timestamp').sum() followed by df.plot(x='timestamp', y='vote_count')$\endgroup$
    – Emre
    CommentedApr 30, 2017 at 9:12
  • $\begingroup$The provided documentation of both libraries should be more than enough for you to figure this out.$\endgroup$
    – h3h325
    CommentedApr 30, 2017 at 11:07
  • $\begingroup$@Emre why don't you upgrade your comment into an answer?$\endgroup$
    – famargar
    CommentedMay 3, 2017 at 10:47

1 Answer 1

2
$\begingroup$

You need to groupby to deal with multiple vote counts:

df.groupby('timestamp').sum().plot(x='timestamp', y='vote_count')

$\endgroup$

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.