{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\n\ntrain = pd.read_csv('../input/h-and-m-personalized-fashion-recommendations/transactions_train.csv')\ncustomer = pd.read_csv('../input/h-and-m-personalized-fashion-recommendations/customers.csv')\narticle = pd.read_csv('../input/h-and-m-personalized-fashion-recommendations/articles.csv')","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:19:29.184272Z","iopub.execute_input":"2022-03-31T04:19:29.1851Z","iopub.status.idle":"2022-03-31T04:20:42.639126Z","shell.execute_reply.started":"2022-03-31T04:19:29.184986Z","shell.execute_reply":"2022-03-31T04:20:42.638057Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport os\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom tabulate import tabulate\nfrom plotly.offline import plot, iplot, init_notebook_mode\nimport plotly.express as px\nimport plotly.graph_objects as go\ninit_notebook_mode(connected=True)\nfrom datetime import datetime","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:20:42.641126Z","iopub.execute_input":"2022-03-31T04:20:42.641442Z","iopub.status.idle":"2022-03-31T04:20:45.014761Z","shell.execute_reply.started":"2022-03-31T04:20:42.641407Z","shell.execute_reply":"2022-03-31T04:20:45.013793Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customer.info()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:20:45.015994Z","iopub.execute_input":"2022-03-31T04:20:45.0162Z","iopub.status.idle":"2022-03-31T04:20:45.663532Z","shell.execute_reply.started":"2022-03-31T04:20:45.016174Z","shell.execute_reply":"2022-03-31T04:20:45.66243Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# *Customer Age Related Data Analysis*","metadata":{"execution":{"iopub.status.busy":"2022-03-30T23:40:12.256488Z","iopub.execute_input":"2022-03-30T23:40:12.257401Z","iopub.status.idle":"2022-03-30T23:40:12.261773Z","shell.execute_reply.started":"2022-03-30T23:40:12.257353Z","shell.execute_reply":"2022-03-30T23:40:12.260744Z"}}},{"cell_type":"code","source":"sns.distplot(customer['age'])","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:20:45.664841Z","iopub.execute_input":"2022-03-31T04:20:45.66515Z","iopub.status.idle":"2022-03-31T04:20:53.924893Z","shell.execute_reply.started":"2022-03-31T04:20:45.665107Z","shell.execute_reply":"2022-03-31T04:20:53.924033Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.boxplot(customer['age'])","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:20:53.927548Z","iopub.execute_input":"2022-03-31T04:20:53.92852Z","iopub.status.idle":"2022-03-31T04:20:54.12996Z","shell.execute_reply.started":"2022-03-31T04:20:53.92846Z","shell.execute_reply":"2022-03-31T04:20:54.129298Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customer['age'].describe()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:20:54.131655Z","iopub.execute_input":"2022-03-31T04:20:54.132284Z","iopub.status.idle":"2022-03-31T04:20:54.19841Z","shell.execute_reply.started":"2022-03-31T04:20:54.132237Z","shell.execute_reply":"2022-03-31T04:20:54.197624Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customer.shape[0] - customer.age.count()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:20:54.199554Z","iopub.execute_input":"2022-03-31T04:20:54.199819Z","iopub.status.idle":"2022-03-31T04:20:54.208324Z","shell.execute_reply.started":"2022-03-31T04:20:54.19979Z","shell.execute_reply":"2022-03-31T04:20:54.207768Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customer.loc[customer.age.isnull() , 'age'] = 0","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:20:54.209671Z","iopub.execute_input":"2022-03-31T04:20:54.210617Z","iopub.status.idle":"2022-03-31T04:20:54.230149Z","shell.execute_reply.started":"2022-03-31T04:20:54.210552Z","shell.execute_reply":"2022-03-31T04:20:54.229233Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from datetime import datetime\ntrain[\"t_dat\"] = pd.to_datetime(train[\"t_dat\"])","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:20:54.231316Z","iopub.execute_input":"2022-03-31T04:20:54.23156Z","iopub.status.idle":"2022-03-31T04:21:00.537368Z","shell.execute_reply.started":"2022-03-31T04:20:54.23153Z","shell.execute_reply":"2022-03-31T04:21:00.536558Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['month'] =  pd.DatetimeIndex(train['t_dat']).month","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:21:00.538967Z","iopub.execute_input":"2022-03-31T04:21:00.539302Z","iopub.status.idle":"2022-03-31T04:21:03.531733Z","shell.execute_reply.started":"2022-03-31T04:21:00.539258Z","shell.execute_reply":"2022-03-31T04:21:03.530601Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customer.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:21:03.533226Z","iopub.execute_input":"2022-03-31T04:21:03.533527Z","iopub.status.idle":"2022-03-31T04:21:04.179521Z","shell.execute_reply.started":"2022-03-31T04:21:03.533487Z","shell.execute_reply":"2022-03-31T04:21:04.178648Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.loc[(train[\"month\"] >= 3) & (train[\"month\"] <= 5) , \"season\"] = \"Spring\"\ntrain.loc[(train[\"month\"] >= 6) & (train[\"month\"] <= 8) , \"season\"] = \"Summer\"\ntrain.loc[(train[\"month\"] >= 9) & (train[\"month\"] <= 11) , \"season\"] = \"Autumn\"\ntrain.loc[(train[\"month\"] == 12) , \"season\"] = \"Winter\"\ntrain.loc[(train[\"month\"] >= 1) & (train[\"month\"] <= 2) , \"season\"] = \"Winter\"","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:21:04.181047Z","iopub.execute_input":"2022-03-31T04:21:04.181373Z","iopub.status.idle":"2022-03-31T04:21:14.478973Z","shell.execute_reply.started":"2022-03-31T04:21:04.18133Z","shell.execute_reply":"2022-03-31T04:21:14.478075Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SA = train[['season' , 'article_id']].merge(article[['article_id' , 'product_type_name' , 'product_type_no']] , on = 'article_id').groupby(['season' , 'product_type_no' ,'product_type_name']).agg({'product_type_no': 'count'}).rename(columns={'product_type_no': 'quantity'}).reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:21:14.480268Z","iopub.execute_input":"2022-03-31T04:21:14.481348Z","iopub.status.idle":"2022-03-31T04:21:38.108661Z","shell.execute_reply.started":"2022-03-31T04:21:14.481308Z","shell.execute_reply":"2022-03-31T04:21:38.107723Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = px.pie(SA.loc[SA.season == \"Winter\"].sort_values(by = 'quantity', ascending = False).head(10),\n             values='quantity', \n             title='Winter Top 10 Product',\n             names='product_type_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['product_type_name'],\n             labels={'product_type_name':'Product Type Name'},\n            height=450)\n\nfig.show()\n\nfig = px.pie(SA.loc[SA.season == \"Summer\"].sort_values(by = 'quantity', ascending = False).head(10),\n             values='quantity', \n             title='Summer Top 10 Product',\n             names='product_type_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['product_type_name'],\n             labels={'product_type_name':'Product Type Name'},\n            height=450)\n\nfig.show()\n\nfig = px.pie(SA.loc[SA.season == \"Spring\"].sort_values(by = 'quantity', ascending = False).head(10),\n             values='quantity', \n             title='Spring Top 10 Product',\n             names='product_type_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['product_type_name'],\n             labels={'product_type_name':'Product Type Name'},\n            height=450)\n\nfig.show()\n\nfig = px.pie(SA.loc[SA.season == \"Autumn\"].sort_values(by = 'quantity', ascending = False).head(10),\n             values='quantity', \n             title='Autumn Top 10 Product',\n             names='product_type_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['product_type_name'],\n             labels={'product_type_name':'Product Type Name'},\n            height=450)\n\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:21:38.112635Z","iopub.execute_input":"2022-03-31T04:21:38.113057Z","iopub.status.idle":"2022-03-31T04:21:39.381599Z","shell.execute_reply.started":"2022-03-31T04:21:38.113018Z","shell.execute_reply":"2022-03-31T04:21:39.38063Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = px.bar(SA.loc[SA.season == \"Winter\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Winter Sale in Descending Order',\n             x='product_type_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['product_type_name'],\n             labels={'product_type_name':'Product Type Name'},\n            height=450)\nfig.show()\n\nfig = px.bar(SA.loc[SA.season == \"Summer\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Summer Sale in Descending Order',\n             x='product_type_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['product_type_name'],\n             labels={'product_type_name':'Product Type Name'},\n            height=450)\nfig.show()\n\nfig = px.bar(SA.loc[SA.season == \"Spring\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Spring Sale in Descending Order',\n             x='product_type_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['product_type_name'],\n             labels={'product_type_name':'Product Type Name'},\n            height=450)\nfig.show()\n\nfig = px.bar(SA.loc[SA.season == \"Autumn\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Autumn Sale in Descending Order',\n             x='product_type_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['product_type_name'],\n             labels={'product_type_name':'Product Type Name'},\n            height=450)\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:21:39.383405Z","iopub.execute_input":"2022-03-31T04:21:39.383765Z","iopub.status.idle":"2022-03-31T04:21:39.696224Z","shell.execute_reply.started":"2022-03-31T04:21:39.383721Z","shell.execute_reply":"2022-03-31T04:21:39.695308Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\nbins = np.array([0,15,19,35,50,99])","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:21:39.697371Z","iopub.execute_input":"2022-03-31T04:21:39.697612Z","iopub.status.idle":"2022-03-31T04:21:39.702975Z","shell.execute_reply.started":"2022-03-31T04:21:39.697557Z","shell.execute_reply":"2022-03-31T04:21:39.701996Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"labels = ['unknown' , 'teens' , 'young' , 'middle-aged' , 'old']","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:21:39.704244Z","iopub.execute_input":"2022-03-31T04:21:39.704463Z","iopub.status.idle":"2022-03-31T04:21:39.717336Z","shell.execute_reply.started":"2022-03-31T04:21:39.704436Z","shell.execute_reply":"2022-03-31T04:21:39.716644Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customer['age_cat'] = pd.cut(customer['age'], bins=bins, labels=labels, include_lowest=True)","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:21:39.718821Z","iopub.execute_input":"2022-03-31T04:21:39.719154Z","iopub.status.idle":"2022-03-31T04:21:39.777011Z","shell.execute_reply.started":"2022-03-31T04:21:39.719109Z","shell.execute_reply":"2022-03-31T04:21:39.776271Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"CA = customer[['customer_id' , 'age_cat']].merge(train[['customer_id' , 'season']] , on = 'customer_id').groupby(['season' , 'age_cat']).agg({'age_cat': 'count'}).rename(columns={'age_cat': 'quantity'}).reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:21:39.778319Z","iopub.execute_input":"2022-03-31T04:21:39.77916Z","iopub.status.idle":"2022-03-31T04:22:03.896585Z","shell.execute_reply.started":"2022-03-31T04:21:39.779112Z","shell.execute_reply":"2022-03-31T04:22:03.895832Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = px.pie(CA.loc[CA.season == \"Winter\"].sort_values(by = 'quantity', ascending = False).head(10),\n             values='quantity', \n             title='Winter Top Buyers',\n             names='age_cat',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['age_cat'],\n             labels={'age_cat':'Category'},\n            height=450)\n\nfig.show()\n\nfig = px.pie(CA.loc[CA.season == \"Summer\"].sort_values(by = 'quantity', ascending = False).head(10),\n             values='quantity', \n             title='Summer Top Buyers',\n             names='age_cat',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['age_cat'],\n             labels={'age_cat':'Category'},\n            height=450)\n\nfig.show()\n\nfig = px.pie(CA.loc[CA.season == \"Spring\"].sort_values(by = 'quantity', ascending = False).head(10),\n             values='quantity', \n             title='Spring Top Buyers',\n             names='age_cat',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['age_cat'],\n             labels={'age_cat':'Category'},\n            height=450)\n\nfig.show()\n\nfig = px.pie(CA.loc[CA.season == \"Autumn\"].sort_values(by = 'quantity', ascending = False).head(10),\n             values='quantity', \n             title='Autumn Top Buyers',\n             names='age_cat',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['age_cat'],\n             labels={'age_cat':'Category'},\n            height=450)\n\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:22:03.898694Z","iopub.execute_input":"2022-03-31T04:22:03.899002Z","iopub.status.idle":"2022-03-31T04:22:04.119642Z","shell.execute_reply.started":"2022-03-31T04:22:03.898961Z","shell.execute_reply":"2022-03-31T04:22:04.118873Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"article[['perceived_colour_value_name' , 'perceived_colour_master_name']]","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:22:04.120753Z","iopub.execute_input":"2022-03-31T04:22:04.121109Z","iopub.status.idle":"2022-03-31T04:22:04.139518Z","shell.execute_reply.started":"2022-03-31T04:22:04.121078Z","shell.execute_reply":"2022-03-31T04:22:04.138395Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"article['perceived_colour_value_name'].unique()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:22:04.141023Z","iopub.execute_input":"2022-03-31T04:22:04.141251Z","iopub.status.idle":"2022-03-31T04:22:04.155737Z","shell.execute_reply.started":"2022-03-31T04:22:04.141222Z","shell.execute_reply":"2022-03-31T04:22:04.155093Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"article['perceived_colour_master_name'].unique()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:22:04.157178Z","iopub.execute_input":"2022-03-31T04:22:04.157409Z","iopub.status.idle":"2022-03-31T04:22:04.178329Z","shell.execute_reply.started":"2022-03-31T04:22:04.157381Z","shell.execute_reply":"2022-03-31T04:22:04.177693Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SC = train[['season' , 'article_id']].merge(article[['article_id' , 'perceived_colour_master_name']] , on = 'article_id').groupby(['season' , 'perceived_colour_master_name']).agg({'perceived_colour_master_name': 'count'}).rename(columns={'perceived_colour_master_name': 'quantity'}).reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:22:04.179539Z","iopub.execute_input":"2022-03-31T04:22:04.179947Z","iopub.status.idle":"2022-03-31T04:22:25.860761Z","shell.execute_reply.started":"2022-03-31T04:22:04.179916Z","shell.execute_reply":"2022-03-31T04:22:25.859832Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = px.bar(SC.loc[SC.season == \"Winter\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Winter Most Favourite Colors in Ascending Order',\n             x='perceived_colour_master_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['perceived_colour_master_name'],\n             labels={'perceived_colour_master_name':'Colour'},\n            height=450)\nfig.show()\n\nfig = px.bar(SC.loc[SC.season == \"Summer\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Summer Most Favourite Colors in Ascending Order',\n             x='perceived_colour_master_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['perceived_colour_master_name'],\n             labels={'perceived_colour_master_name':'Colour'},\n            height=450)\nfig.show()\n\nfig = px.bar(SC.loc[SC.season == \"Spring\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Spring Most Favourite Colors in Ascending Order',\n             x='perceived_colour_master_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['perceived_colour_master_name'],\n             labels={'perceived_colour_master_name':'Colour'},\n            height=450)\nfig.show()\n\nfig = px.bar(SC.loc[SC.season == \"Autumn\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Autumn Most Favourite Colors in Ascending Order',\n             x='perceived_colour_master_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['perceived_colour_master_name'],\n             labels={'perceived_colour_master_name':'Colour'},\n            height=450)\nfig.show()\n","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:22:25.862131Z","iopub.execute_input":"2022-03-31T04:22:25.862393Z","iopub.status.idle":"2022-03-31T04:22:26.129232Z","shell.execute_reply.started":"2022-03-31T04:22:25.862362Z","shell.execute_reply":"2022-03-31T04:22:26.128641Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"article['product_group_name'].unique()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:22:26.130455Z","iopub.execute_input":"2022-03-31T04:22:26.130871Z","iopub.status.idle":"2022-03-31T04:22:26.148642Z","shell.execute_reply.started":"2022-03-31T04:22:26.130841Z","shell.execute_reply":"2022-03-31T04:22:26.148016Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"AC = train[['customer_id' , 'article_id']].merge(article[['article_id' , 'perceived_colour_master_name']] , on = 'article_id').merge(customer[['customer_id' , 'age_cat']] , on = 'customer_id').groupby(['age_cat' , 'perceived_colour_master_name']).agg({'perceived_colour_master_name': 'count'}).rename(columns={'perceived_colour_master_name': 'quantity'}).reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:22:26.149731Z","iopub.execute_input":"2022-03-31T04:22:26.150178Z","iopub.status.idle":"2022-03-31T04:23:36.735829Z","shell.execute_reply.started":"2022-03-31T04:22:26.150128Z","shell.execute_reply":"2022-03-31T04:23:36.734939Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = px.bar(AC.loc[AC.age_cat == \"teens\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Teens Most Favourite Colors in Ascending Order',\n             x='perceived_colour_master_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['perceived_colour_master_name'],\n             labels={'perceived_colour_master_name':'Colour'},\n            height=450)\nfig.show()\n\nfig = px.bar(AC.loc[AC.age_cat == \"young\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Youngs Most Favourite Colors in Ascending Order',\n             x='perceived_colour_master_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['perceived_colour_master_name'],\n             labels={'perceived_colour_master_name':'Colour'},\n            height=450)\nfig.show()\n\nfig = px.bar(AC.loc[AC.age_cat == \"middle-aged\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Middle-Aged Most Favourite Colors in Ascending Order',\n             x='perceived_colour_master_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['perceived_colour_master_name'],\n             labels={'perceived_colour_master_name':'Colour'},\n            height=450)\nfig.show()\n\nfig = px.bar(AC.loc[AC.age_cat == \"old\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='Old Most Favourite Colors in Ascending Order',\n             x='perceived_colour_master_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['perceived_colour_master_name'],\n             labels={'perceived_colour_master_name':'Colour'},\n            height=450)\nfig.show()\n\nfig = px.bar(AC.loc[AC.age_cat == \"unknown\"].sort_values(by = 'quantity', ascending = False),\n             y='quantity', \n             title='unknown Most Favourite Colors in Ascending Order',\n             x='perceived_colour_master_name',\n             color_discrete_sequence=px.colors.sequential.RdBu,\n             hover_data=['perceived_colour_master_name'],\n             labels={'perceived_colour_master_name':'Colour'},\n            height=450)\nfig.show()\n\n","metadata":{"execution":{"iopub.status.busy":"2022-03-31T04:23:36.737451Z","iopub.execute_input":"2022-03-31T04:23:36.737715Z","iopub.status.idle":"2022-03-31T04:23:37.077193Z","shell.execute_reply.started":"2022-03-31T04:23:36.737682Z","shell.execute_reply":"2022-03-31T04:23:37.076199Z"},"trusted":true},"execution_count":null,"outputs":[]}]}