230k views
12 votes
Notice that the percentages range from just over 55% to just under 65%. This is a range of 10%, so we're going to use 5 evenly-spaced bins (the first bin will go from 55-57, the second bin will go from 57-59, the third bin will go from 59-61, and so on). Let's use the histogram function from the numpy package to help create the histogram. Write the appropriate code to: Import the numpy package as np Execute the np.histogram() function with two arguments: the list that shows the percentage of paid tax preparers (already given in the code cell below) and the bins. Save the result of np.histogram() into a variable called hist (i.e., the line of code should start with hist

1 Answer

6 votes

Answer:

import numpy as np

l_int = 55/100

h_int = 65/100

hist = np.histogram( paid_tax_preparers_list, bins=5, range=(l_int, h_int))

Step-by-step explanation:

Numpy is a Python package used to ease mathematical and statistical research calculations. The package creates data structures called arrays that can be used as vector items, making it easy and fast for calculation to be done.

The np.histogram method is used to create or plot histograms of a list or array against the frequency of the items in the array. The bins and the range attributes are used to adjust the display of the histogram, with bins being the number of bin in the graph and range is the given length of the histogram.

User Chry Cheng
by
4.6k points