Q:

Read the total profit of each month and show it using the histogram to see the most common profit ranges

belongs to collection: Python Matplotlib Exercises

0

Read the total profit of each month and show it using the histogram to see the most common profit ranges

The histogram should look like this.

Matplotlib Exercise 7: Read the total profit of each month and show it using the histogram to see most common profit ranges

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import pandas as pd
import matplotlib.pyplot as plt  

df = pd.read_csv("D:\\Python\\Articles\\matplotlib\\sales_data.csv")
profitList = df ['total_profit'].tolist()
labels = ['low', 'average', 'Good', 'Best']
profit_range = [150000, 175000, 200000, 225000, 250000, 300000, 350000]
plt.hist(profitList, profit_range, label = 'Profit data')
plt.xlabel('profit range in dollar')
plt.ylabel('Actual Profit in dollar')
plt.legend(loc='upper left')
plt.xticks(profit_range)
plt.title('Profit data')
plt.show()

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Calculate total sale data for last year for each p... >>
<< Read sales data of bathing soap of all months and ...