ML Lab 1 Graphs
ML Lab 1 Graphs
ipynb - Colaboratory
import pandas as pd
df = pd.read_csv("supermarketsales.csv")
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
<ipython-input-36-69773e348612>:3: FutureWarning:
The `ci` parameter is deprecated. Use `errorbar=None` for the same effect.
https://colab.research.google.com/drive/1wPr-x9-kma0doO2UknDmqGOj9sQ-15ZM#scrollTo=QZhBQoouW_FL&printMode=true 1/4
1/11/24, 10:06 PM Untitled10.ipynb - Colaboratory
https://colab.research.google.com/drive/1wPr-x9-kma0doO2UknDmqGOj9sQ-15ZM#scrollTo=QZhBQoouW_FL&printMode=true 2/4
1/11/24, 10:06 PM Untitled10.ipynb - Colaboratory
<ipython-input-38-eea42ebf4fd6>:3: FutureWarning:
The `ci` parameter is deprecated. Use `errorbar=None` for the same effect.
# Q4
plt.figure(figsize=(12, 6))
sns.barplot(x='Product line', y='Total amount', data=df, estimator=sum, ci=None)
plt.title('Total Sales by Product Line')
plt.xlabel('Product Line')
plt.ylabel('Total Sales')
plt.show()
https://colab.research.google.com/drive/1wPr-x9-kma0doO2UknDmqGOj9sQ-15ZM#scrollTo=QZhBQoouW_FL&printMode=true 3/4
1/11/24, 10:06 PM Untitled10.ipynb - Colaboratory
<ipython-input-39-413a269182fc>:3: FutureWarning:
The `ci` parameter is deprecated. Use `errorbar=None` for the same effect.
# Q5
sns.barplot(x='Product
df['Date'] line', y='Total
= pd.to_datetime(df['Date'], amount', data=df, estimator=sum, ci=None)
format='%B')
plt.figure(figsize=(12, 6))
sns.lineplot(x='Date', y='Total amount', data=df, estimator=sum, ci=None)
plt.title('Sales Performance Over Time')
plt.xlabel('Month')
plt.ylabel('Total Sales')
plt.show()
The `ci` parameter is deprecated. Use `errorbar=None` for the same effect.
https://colab.research.google.com/drive/1wPr-x9-kma0doO2UknDmqGOj9sQ-15ZM#scrollTo=QZhBQoouW_FL&printMode=true 4/4