{"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 numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport plotly.graph_objects as go\nimport plotly.express as px\nfrom wordcloud import WordCloud, STOPWORDS","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-02-10T13:36:10.437961Z","iopub.execute_input":"2022-02-10T13:36:10.438444Z","iopub.status.idle":"2022-02-10T13:36:12.000840Z","shell.execute_reply.started":"2022-02-10T13:36:10.438357Z","shell.execute_reply":"2022-02-10T13:36:11.999944Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transactions_train = pd.read_csv(\"/kaggle/input/h-and-m-personalized-fashion-recommendations/transactions_train.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:36:12.002605Z","iopub.execute_input":"2022-02-10T13:36:12.002856Z","iopub.status.idle":"2022-02-10T13:37:23.925018Z","shell.execute_reply.started":"2022-02-10T13:36:12.002826Z","shell.execute_reply":"2022-02-10T13:37:23.923800Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transactions_train.tail(1)","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:37:23.926508Z","iopub.execute_input":"2022-02-10T13:37:23.926779Z","iopub.status.idle":"2022-02-10T13:37:23.949608Z","shell.execute_reply.started":"2022-02-10T13:37:23.926745Z","shell.execute_reply":"2022-02-10T13:37:23.948894Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transactions_train['article_id'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:37:23.951518Z","iopub.execute_input":"2022-02-10T13:37:23.951930Z","iopub.status.idle":"2022-02-10T13:37:25.217377Z","shell.execute_reply.started":"2022-02-10T13:37:23.951889Z","shell.execute_reply":"2022-02-10T13:37:25.216536Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transactions_train.info()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:37:25.218737Z","iopub.execute_input":"2022-02-10T13:37:25.218965Z","iopub.status.idle":"2022-02-10T13:37:25.236275Z","shell.execute_reply.started":"2022-02-10T13:37:25.218936Z","shell.execute_reply":"2022-02-10T13:37:25.235604Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transactions_train.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:37:25.237591Z","iopub.execute_input":"2022-02-10T13:37:25.238022Z","iopub.status.idle":"2022-02-10T13:37:32.257570Z","shell.execute_reply.started":"2022-02-10T13:37:25.237965Z","shell.execute_reply":"2022-02-10T13:37:32.256460Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles = pd.read_csv(\"/kaggle/input/h-and-m-personalized-fashion-recommendations/articles.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:37:32.258763Z","iopub.execute_input":"2022-02-10T13:37:32.259005Z","iopub.status.idle":"2022-02-10T13:37:33.441375Z","shell.execute_reply.started":"2022-02-10T13:37:32.258964Z","shell.execute_reply":"2022-02-10T13:37:33.440502Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles.head(1)","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:37:33.442569Z","iopub.execute_input":"2022-02-10T13:37:33.442777Z","iopub.status.idle":"2022-02-10T13:37:33.473732Z","shell.execute_reply.started":"2022-02-10T13:37:33.442750Z","shell.execute_reply":"2022-02-10T13:37:33.472843Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:37:33.474866Z","iopub.execute_input":"2022-02-10T13:37:33.475126Z","iopub.status.idle":"2022-02-10T13:37:33.646228Z","shell.execute_reply.started":"2022-02-10T13:37:33.475095Z","shell.execute_reply":"2022-02-10T13:37:33.645332Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Merge articles and transactions ","metadata":{}},{"cell_type":"code","source":"df = transactions_train.merge(articles,on=\"article_id\")","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:37:33.648959Z","iopub.execute_input":"2022-02-10T13:37:33.649459Z","iopub.status.idle":"2022-02-10T13:39:19.061418Z","shell.execute_reply.started":"2022-02-10T13:37:33.649414Z","shell.execute_reply":"2022-02-10T13:39:19.060313Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head(1)","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:39:19.062459Z","iopub.execute_input":"2022-02-10T13:39:19.062693Z","iopub.status.idle":"2022-02-10T13:39:19.089738Z","shell.execute_reply.started":"2022-02-10T13:39:19.062664Z","shell.execute_reply":"2022-02-10T13:39:19.088840Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Extract year, day and month from the date","metadata":{}},{"cell_type":"code","source":"def create_year(x):\n    year = pd.DatetimeIndex(x).year \n    return year\n\ndf['year'] = create_year(df['t_dat'])","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:39:19.091074Z","iopub.execute_input":"2022-02-10T13:39:19.091389Z","iopub.status.idle":"2022-02-10T13:39:31.767922Z","shell.execute_reply.started":"2022-02-10T13:39:19.091353Z","shell.execute_reply":"2022-02-10T13:39:31.767041Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Create a New column that contains the month from the date column\ndef create_month(x):\n    month = pd.DatetimeIndex(x).month_name() \n    return month\n\ndf['month'] = create_month(df['t_dat'])","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:39:31.769963Z","iopub.execute_input":"2022-02-10T13:39:31.770226Z","iopub.status.idle":"2022-02-10T13:39:52.217228Z","shell.execute_reply.started":"2022-02-10T13:39:31.770198Z","shell.execute_reply":"2022-02-10T13:39:52.216365Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Create a New column that contains the day from the date column\n\ndef create_day(x):\n    day = pd.DatetimeIndex(x).day_name() \n    return day\n\ndf['day'] = create_day(df['t_dat'])\n","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:39:52.218637Z","iopub.execute_input":"2022-02-10T13:39:52.218951Z","iopub.status.idle":"2022-02-10T13:40:13.511573Z","shell.execute_reply.started":"2022-02-10T13:39:52.218916Z","shell.execute_reply":"2022-02-10T13:40:13.510722Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head(2)","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:13.513060Z","iopub.execute_input":"2022-02-10T13:40:13.513323Z","iopub.status.idle":"2022-02-10T13:40:13.536774Z","shell.execute_reply.started":"2022-02-10T13:40:13.513293Z","shell.execute_reply":"2022-02-10T13:40:13.536171Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data = df.groupby(['index_group_name'])['customer_id'].count().reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:13.538210Z","iopub.execute_input":"2022-02-10T13:40:13.538534Z","iopub.status.idle":"2022-02-10T13:40:25.173381Z","shell.execute_reply.started":"2022-02-10T13:40:13.538503Z","shell.execute_reply":"2022-02-10T13:40:25.172430Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Index group name Vs Total customer_id bar plot","metadata":{}},{"cell_type":"code","source":"px.bar(\n        data,\n        x=\"index_group_name\",\n        y=\"customer_id\",\n        title=\"Index group name Vs Total customer_id\",\n        width=900,\n        height=700,\n        color=\"index_group_name\",\n        color_discrete_sequence=px.colors.qualitative.G10,\n    )","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:25.174790Z","iopub.execute_input":"2022-02-10T13:40:25.175034Z","iopub.status.idle":"2022-02-10T13:40:26.347023Z","shell.execute_reply.started":"2022-02-10T13:40:25.175005Z","shell.execute_reply":"2022-02-10T13:40:26.346019Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dff = (\n        df.groupby([\"product_type_name\",\"sales_channel_id\", \"product_group_name\"])[\"price\"].sum().sort_values(ascending=False).reset_index()\n    )\n    ","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:26.348682Z","iopub.execute_input":"2022-02-10T13:40:26.349001Z","iopub.status.idle":"2022-02-10T13:40:35.401754Z","shell.execute_reply.started":"2022-02-10T13:40:26.348948Z","shell.execute_reply":"2022-02-10T13:40:35.397788Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dff.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:35.405963Z","iopub.execute_input":"2022-02-10T13:40:35.406350Z","iopub.status.idle":"2022-02-10T13:40:35.424369Z","shell.execute_reply.started":"2022-02-10T13:40:35.406314Z","shell.execute_reply":"2022-02-10T13:40:35.423318Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dff_20 = dff.head(20)","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:35.425997Z","iopub.execute_input":"2022-02-10T13:40:35.426330Z","iopub.status.idle":"2022-02-10T13:40:35.440769Z","shell.execute_reply.started":"2022-02-10T13:40:35.426289Z","shell.execute_reply":"2022-02-10T13:40:35.439895Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.bar(\n        dff,\n        x=\"product_type_name\",\n        y=\"product_group_name\",\n        title=\"Product type name vs product group name - all\",\n        color=\"product_type_name\",\n        color_discrete_sequence=px.colors.qualitative.D3,\n        width=900,\n        height=700,\n    )","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:35.442372Z","iopub.execute_input":"2022-02-10T13:40:35.442696Z","iopub.status.idle":"2022-02-10T13:40:36.126153Z","shell.execute_reply.started":"2022-02-10T13:40:35.442654Z","shell.execute_reply":"2022-02-10T13:40:36.125321Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Product type name vs product group name - Top 20 barplot","metadata":{}},{"cell_type":"code","source":"px.bar(\n        dff_20,\n        x=\"product_type_name\",\n        y=\"product_group_name\",\n        title=\"Product type name vs product group name - Top 20\",\n        color=\"product_type_name\",\n        color_discrete_sequence=px.colors.qualitative.D3,\n        width=900,\n        height=700,\n    )","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:36.127269Z","iopub.execute_input":"2022-02-10T13:40:36.128121Z","iopub.status.idle":"2022-02-10T13:40:36.267091Z","shell.execute_reply.started":"2022-02-10T13:40:36.128082Z","shell.execute_reply":"2022-02-10T13:40:36.266180Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.bar(\n        dff_20,\n        x=\"product_type_name\",\n        y=\"product_group_name\",\n        title=\"Product type name vs product group name - Top 20\",\n        color=\"sales_channel_id\",\n        color_discrete_sequence=px.colors.qualitative.D3,\n        width=900,\n        height=700,\n    )","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:36.268318Z","iopub.execute_input":"2022-02-10T13:40:36.268550Z","iopub.status.idle":"2022-02-10T13:40:36.360940Z","shell.execute_reply.started":"2022-02-10T13:40:36.268521Z","shell.execute_reply":"2022-02-10T13:40:36.360114Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"products = df.groupby('prod_name')['article_id'].count().sort_values(ascending=False).reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:36.362176Z","iopub.execute_input":"2022-02-10T13:40:36.362410Z","iopub.status.idle":"2022-02-10T13:40:40.126886Z","shell.execute_reply.started":"2022-02-10T13:40:36.362382Z","shell.execute_reply":"2022-02-10T13:40:40.126022Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"products.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:40.128186Z","iopub.execute_input":"2022-02-10T13:40:40.128408Z","iopub.status.idle":"2022-02-10T13:40:40.137332Z","shell.execute_reply.started":"2022-02-10T13:40:40.128381Z","shell.execute_reply":"2022-02-10T13:40:40.136473Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"products_10 = products.head(10)","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:40.138925Z","iopub.execute_input":"2022-02-10T13:40:40.139540Z","iopub.status.idle":"2022-02-10T13:40:40.149827Z","shell.execute_reply.started":"2022-02-10T13:40:40.139494Z","shell.execute_reply":"2022-02-10T13:40:40.149190Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Top 10 product names","metadata":{}},{"cell_type":"code","source":"labels = products_10[\"prod_name\"]\nvalues = products_10[\"article_id\"]\ncolors = [\"maroon\", \"black\", \"orange\"]\nfig = go.Figure(\n        data=[\n            go.Pie(\n                labels=labels,\n                values=values,\n                hoverinfo=\"label+percent\",\n                textinfo=\"value\",\n            )\n        ]\n    )\nfig.update_traces(marker=dict(colors=colors))\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:40.151010Z","iopub.execute_input":"2022-02-10T13:40:40.151255Z","iopub.status.idle":"2022-02-10T13:40:40.182572Z","shell.execute_reply.started":"2022-02-10T13:40:40.151220Z","shell.execute_reply":"2022-02-10T13:40:40.182039Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Which sale channel has the most sales?\n","metadata":{}},{"cell_type":"code","source":"sales_channel = df.groupby('sales_channel_id')['price'].sum().sort_values(ascending=False).reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:40.186097Z","iopub.execute_input":"2022-02-10T13:40:40.186761Z","iopub.status.idle":"2022-02-10T13:40:40.841214Z","shell.execute_reply.started":"2022-02-10T13:40:40.186723Z","shell.execute_reply":"2022-02-10T13:40:40.840354Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.pie(\n        sales_channel,\n        hole=0.2,\n        values=\"price\",\n        names=\"sales_channel_id\",\n        color_discrete_sequence=px.colors.sequential.Aggrnyl,\n    )","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:40.842488Z","iopub.execute_input":"2022-02-10T13:40:40.843361Z","iopub.status.idle":"2022-02-10T13:40:40.912430Z","shell.execute_reply.started":"2022-02-10T13:40:40.843317Z","shell.execute_reply":"2022-02-10T13:40:40.911535Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Total price over the years","metadata":{}},{"cell_type":"code","source":"data = df.groupby(\"year\")['price'].sum().reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:40.913545Z","iopub.execute_input":"2022-02-10T13:40:40.913759Z","iopub.status.idle":"2022-02-10T13:40:41.595929Z","shell.execute_reply.started":"2022-02-10T13:40:40.913727Z","shell.execute_reply":"2022-02-10T13:40:41.595101Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:41.597291Z","iopub.execute_input":"2022-02-10T13:40:41.597589Z","iopub.status.idle":"2022-02-10T13:40:41.607598Z","shell.execute_reply.started":"2022-02-10T13:40:41.597549Z","shell.execute_reply":"2022-02-10T13:40:41.606703Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.line(data, x=\"year\",y=\"price\")","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:41.609149Z","iopub.execute_input":"2022-02-10T13:40:41.609861Z","iopub.status.idle":"2022-02-10T13:40:41.696250Z","shell.execute_reply.started":"2022-02-10T13:40:41.609824Z","shell.execute_reply":"2022-02-10T13:40:41.695399Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.columns","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:41.697911Z","iopub.execute_input":"2022-02-10T13:40:41.698233Z","iopub.status.idle":"2022-02-10T13:40:41.704275Z","shell.execute_reply.started":"2022-02-10T13:40:41.698193Z","shell.execute_reply":"2022-02-10T13:40:41.703420Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data = df.groupby(['day','prod_name','product_type_name'])['price'].sum().reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:41.705780Z","iopub.execute_input":"2022-02-10T13:40:41.706297Z","iopub.status.idle":"2022-02-10T13:40:53.653767Z","shell.execute_reply.started":"2022-02-10T13:40:41.706255Z","shell.execute_reply":"2022-02-10T13:40:53.652888Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data = data.head(100)","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:53.655022Z","iopub.execute_input":"2022-02-10T13:40:53.655271Z","iopub.status.idle":"2022-02-10T13:40:53.659451Z","shell.execute_reply.started":"2022-02-10T13:40:53.655241Z","shell.execute_reply":"2022-02-10T13:40:53.658791Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = px.sunburst(data, path=['prod_name','product_type_name'], values='price',color_discrete_sequence=px.colors.qualitative.D3)","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:53.660451Z","iopub.execute_input":"2022-02-10T13:40:53.661162Z","iopub.status.idle":"2022-02-10T13:40:53.803328Z","shell.execute_reply.started":"2022-02-10T13:40:53.661127Z","shell.execute_reply":"2022-02-10T13:40:53.802320Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig.show()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:53.804494Z","iopub.execute_input":"2022-02-10T13:40:53.804728Z","iopub.status.idle":"2022-02-10T13:40:53.814719Z","shell.execute_reply.started":"2022-02-10T13:40:53.804700Z","shell.execute_reply":"2022-02-10T13:40:53.813854Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"graphical = df.groupby('graphical_appearance_name')['price'].sum().sort_values(ascending=False).reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:53.816285Z","iopub.execute_input":"2022-02-10T13:40:53.816767Z","iopub.status.idle":"2022-02-10T13:40:57.060013Z","shell.execute_reply.started":"2022-02-10T13:40:53.816721Z","shell.execute_reply":"2022-02-10T13:40:57.059071Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"graphical_10 = graphical.head(10)","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:57.061608Z","iopub.execute_input":"2022-02-10T13:40:57.061815Z","iopub.status.idle":"2022-02-10T13:40:57.068104Z","shell.execute_reply.started":"2022-02-10T13:40:57.061789Z","shell.execute_reply":"2022-02-10T13:40:57.067244Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.pie(\n        graphical_10,\n        hole=0.2,\n        values=\"price\",\n        names=\"graphical_appearance_name\",\n        color_discrete_sequence=px.colors.sequential.Jet_r,\n    )","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:57.069324Z","iopub.execute_input":"2022-02-10T13:40:57.069535Z","iopub.status.idle":"2022-02-10T13:40:57.126066Z","shell.execute_reply.started":"2022-02-10T13:40:57.069509Z","shell.execute_reply":"2022-02-10T13:40:57.125225Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# df.head(1000) because running the entire dataset leads to memeory problems on Kaggle\nfig = px.icicle(df.head(1000), path=[px.Constant(\"all\"), 'day', 'section_name', 'index_name'], values='price',color_discrete_sequence=px.colors.sequential.Sunset)\nfig.update_traces(root_color=\"lightgrey\")\nfig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:57.127405Z","iopub.execute_input":"2022-02-10T13:40:57.127638Z","iopub.status.idle":"2022-02-10T13:40:57.301641Z","shell.execute_reply.started":"2022-02-10T13:40:57.127610Z","shell.execute_reply":"2022-02-10T13:40:57.300865Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Most used words in the article description","metadata":{}},{"cell_type":"code","source":"# Fails due to memory constrains \n# df_ = df.dropna()\n# corpus = ' '.join(df_['detail_desc'])\n\n# corpus = corpus.replace('.', '. ')\n# wordcloud = WordCloud(stopwords=STOPWORDS, background_color='white',width=2400,height=2000).generate(corpus)\n# plt.figure(figsize=(12,15))\n# plt.imshow(wordcloud)\n# plt.axis('off')\n# plt.show()","metadata":{"execution":{"iopub.status.busy":"2022-02-10T13:40:57.302905Z","iopub.execute_input":"2022-02-10T13:40:57.303362Z","iopub.status.idle":"2022-02-10T13:40:57.307127Z","shell.execute_reply.started":"2022-02-10T13:40:57.303332Z","shell.execute_reply":"2022-02-10T13:40:57.306265Z"},"trusted":true},"execution_count":null,"outputs":[]}]}