Python Programming Exercises
"This code is designed for educational purposes for students."
Second Series of Python Programming Exercises This series of exercises is designed with the objective of utilizing Python libraries centered around data analysis. Students will be provided with a synthetic dataset of 50,000 records related to the sales of a store's products. Using the introduced tools and solutions, perform the following tasks:
Provide an overview and a brief description of the provided data. Examine missing data and propose appropriate solutions to address them. Analyze the total monthly sales of the store using a bar chart. Extract the best-selling products and plot a bar chart for the top 15 products. Analyze the price distribution of the products using a histogram. Plot a pie chart of the sales share per city. Assess the sales volume per city and plot an hbar chart. Compare the total and average sales of each product category using a bar chart. Conduct a time analysis of sales using a time plot. Analyze the relationship between price and sales volume using a scatter plot. Display the top-selling products per city based on sales quantity using an hbar chart. Compare the monthly sales of each city using a heatmap.
Commands used in the codes.
--pandas--
.read_csv : https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html
.describe() : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.describe.html
.isna() : https://pandas.pydata.org/docs/reference/api/pandas.isna.html
.any() : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.any.html
.fillna() : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.fillna.html
.value_counts() : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.value_counts.html
.dropna() : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.dropna.html
.shape : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.shape.html
.loc : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.loc.html
.groupby() : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.groupby.html
.sort_values() : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.sort_values.html
.get_group() : https://pandas.pydata.org/docs/reference/api/pandas.core.groupby.DataFrameGroupBy.get_group.html
.aggregate() : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.aggregate.html
.apply() : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.apply.html
.idxmax() : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.idxmax.html
.pivot_table() : https://pandas.pydata.org/docs/reference/api/pandas.pivot_table.html
--matplotlib--
.bar() : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.bar.html
.barh() : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.barh.html
.figure() : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.figure.html
.hist(): https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist.html
.pie() : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.pie.html
.pilot() : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html
.legend() : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.legend.html
.scatter() : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.scatter.html
.colorbar() : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.colorbar.html
.imshow() : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html
.yticks() : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.yticks.html