0

I have a time series data which contains date, year, month and ratings columns. I have grouped by year and month and and then i am counting the number of rating in each month for that year. I have done this the following way:

nightlife_ratings_mean = review_data_nightlife.groupby(['year','month'])['stars'].count()

I get the following data frame

year  month
2005  8           3
      9           4
      10         16
      11         13
      12          7
2006  1          62
      2          24
      3          13
      4          20
      5          11
      6          13
      7          11
      8          29
      9          33
      10         46

I want to plot this such that my x label is year and and y label is count and i want a line plot with marker-ø. How can I do this. I am trying this for the first time. So please help.

1
  • what do you mean by a line plot with marker-ø? Commented Mar 10, 2016 at 21:26

1 Answer 1

1

You can call plot on your DataFrame and include the option style = 'o-':

plt = nightlife_ratings_mean.plot(x = 'year', y = 'stars', style = 'o-', title = "Stars for each month and year")
plt.set_xlabel("[Year, Month]")
plt.set_ylabel("Stars")

This will plot the following:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.