Home > Back-end >  Graphing in Dataframe Pandas Pyton. How to plot a line after filtering a dataframe
Graphing in Dataframe Pandas Pyton. How to plot a line after filtering a dataframe

Time:12-11

So I have a pandas Dataframe with pateint id, date of visit, location, weight, and heartrate. I need to graph the line of the number of visits in one location in the Dataset over a period of 12 months with the month number on the horizontal axis.

Any other suggestions about how I may go about this?

I tried making the data into 3 data sets and then just graphing the number of visits counted from each data set but creating new columns and assigning the values wasn't working, it only worked for when I was graphing the values of all of the clinics but after splitting it into 3 dataframes, it stopped working.

enter image description here

CodePudding user response:

simply place your data into an ndarray and plot it with the matplotlib.pyplot or you can simply plot from a dataframe for example plt.plot(df['something'])

  • Related