A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

Read sales data of bathing soap of all months and show it using a bar chart. Save this plot to your hard disk
Q:

Read sales data of bathing soap of all months and show it using a bar chart. Save this plot to your hard disk

0

Read sales data of bathing soap of all months and show it using a bar chart. Save this plot to your hard disk

The bar chart should look like this.

Matplotlib Exercise 6: Read sales data of bathing soap of all months and show it using a bar chart. Save this plot to your hard disk

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")
monthList  = df ['month_number'].tolist()
bathingsoapSalesData   = df ['bathingsoap'].tolist()
plt.bar(monthList, bathingsoapSalesData)
plt.xlabel('Month Number')
plt.ylabel('Sales units in number')
plt.title(' Sales data')
plt.xticks(monthList)
plt.grid(True, linewidth= 1, linestyle="--")
plt.title('bathingsoap sales data')
plt.savefig('D:\Python\Articles\matplotlib\sales_data_of_bathingsoap.png', dpi=150)
plt.show()

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

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now