The above histogram show that a large number of students got scores between 60 to 80. For example, let’s see its usage on the “math_scores” series created above. To create a histogram from the series values we’ll pass kind='hist' to the pandas series plot() function. We now have a pandas series containing the scores of students in a Math class. You can see the top five values of the series object above. First, we’ll create a sample pandas series which we will be using throughout this tutorial. ![]() Let’s look at some examples of plotting a pandas series values as a histogram. The pandas series plot() function returns a matplotlib axes object to which you can add additional formatting. Here, s is the pandas series you want to plot. The following is the syntax: # histogram using pandas series plot() To plot a histogram, pass 'hist' to the kind paramter. ![]() ![]() It plots a line chart of the series values by default but you can specify the type of chart to plot using the kind parameter. To plot a pandas series, you can use the pandas series plot() function. ![]() In this tutorial, we will look at how to plot a pandas series values as a histogram.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |