Predict The Daily Number of Units Sold of Different Products
- realcode4you
- Feb 10, 2022
- 1 min read
DESCRIPTION
Dataset Used: PredictionsFor4April2019.csv
Problem Statement: ABC Company has made a model to predict the daily number of units sold of different products
Import Necessary Packages
import pandas as pdRead Dataset
df = pd.read_csv("PredictionsFor4April2019.csv")
df.head()Output:

df['error'] = ((df.PredValue - df.ActualValue) ** 2)
df.head()Output:

RMSE for Country DE
rmse_DE = df[df.Country_code == 'DE']['error'].mean() ** .5
rmse_DE_round = round(rmse_DE,1)
rmse_DE_roundoutput:
10.9RMSE for Country AT
rmse_AT = df[df.Country_code == 'AT']['error'].mean() ** .5
rmse_AT_round = round(rmse_AT,1)
rmse_AT_roundOutput:
0.6RMSE for Country PL
rmse_PL = df[df.Country_code == 'PL']['error'].mean() ** .5
rmse_PL_round = round(rmse_PL,1)
rmse_PL_roundOutput:
1.3Writing into the list
list_of_result_values = []
list_of_result_values.append(rmse_DE_round)
list_of_result_values.append(rmse_AT_round)
list_of_result_values.append(rmse_PL_round)
list_of_result_valuesOutput:
[10.9, 0.6, 1.3]Save Output Into csv file
file = open('./output/output.csv','a+')
file.write("Question2 Output" +"\n")
file.write(str(list_of_result_values) +"\n")
file.close()If you need any other Data Science related help then send your requirement details at:
If you have any doubt related to above code then also comment in below comment section or send me your suggestion regarding this.



Wholesale Leather Bag Suppliers India offer leather goods that are durable and fashionable, ensuring businesses have access to products that will meet their customers' expectations.