{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load in \n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n\nimport os\nprint(os.listdir(\"../input\"))\n\n# Any results you write to the current directory are saved as output.","execution_count":1,"outputs":[]},{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","collapsed":true,"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"train=pd.read_csv('../input/train.csv')","execution_count":2,"outputs":[]},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"a1dc26592a25bdfee4d58f782ff1987575997ec0"},"cell_type":"code","source":"test=pd.read_csv('../input/test.csv')","execution_count":3,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"1fe6733d262a4047683cd527421b299c51c63d8c"},"cell_type":"code","source":"train.shape","execution_count":4,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"37331bd131ae8aa263c92450e03a35366d77137d"},"cell_type":"code","source":"test.shape","execution_count":5,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"7a70c0030de9ac752d8bd66b3936c6fb86431077"},"cell_type":"code","source":"train.describe()","execution_count":8,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"e853c3360c51e4e9173799f8f0cf71e9dfadfb58"},"cell_type":"code","source":"train.info()","execution_count":11,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"36f1b60cd1cbefe0237ed0c041b288dd940e8789"},"cell_type":"code","source":"train.head()","execution_count":12,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"aafde8b07f002d4996df3dc21fc7867d65f4a8cf"},"cell_type":"code","source":"train['user_type'].unique()","execution_count":14,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"9a0b095c213f6458b97d919da68798df3ea589f2"},"cell_type":"code","source":"len(train['user_id'].unique())","execution_count":16,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"ade48ec206801adb95ad3ec5d3f65e10360db8cf"},"cell_type":"code","source":"len(train['item_id'].unique())","execution_count":17,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"191560c5183e8e270e606f0e1541c27239badfb3"},"cell_type":"code","source":"len(train['region'].unique())","execution_count":18,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"a7a0e1ec1441b7121615984cbf56ff9d487ac96a"},"cell_type":"code","source":"len(test['region'].unique())","execution_count":19,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"5d94c7c2da7c4ef73869e4210130bde7f90904af"},"cell_type":"code","source":"len(train['city'].unique())","execution_count":21,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"c27650b4b95d775560c882dcba546ad97a90c8ab"},"cell_type":"code","source":"len(test['city'].unique())","execution_count":22,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"85dcc2b94382dff6a4a8059a9eadf204547522ad"},"cell_type":"code","source":"import matplotlib as mpl\nimport matplotlib.pyplot as plt\n%matplotlib inline\nfrom wordcloud import WordCloud, STOPWORDS\nstopwords = set(STOPWORDS)\n\nwordcloud = WordCloud(\n                          background_color='white',\n                          stopwords=stopwords,\n                          max_words=400,\n                          max_font_size=40, \n                          random_state=42\n                         ).generate(str(train['description']))\n\nprint(wordcloud)\nfig = plt.figure(1)\nplt.imshow(wordcloud)\nplt.axis('off')\nplt.show()\nfig.savefig(\"word1.png\", dpi=900)","execution_count":37,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"c75fd9b82ba1e9d85ababe43f64ba9273794bc8c"},"cell_type":"code","source":"wordcloud = WordCloud(\n                          background_color='white',\n                          stopwords=stopwords,\n                          max_words=400,\n                          max_font_size=40, \n                          random_state=42\n                         ).generate(str(test['description']))\n\nprint(wordcloud)\nfig = plt.figure(1)\nplt.imshow(wordcloud)\nplt.axis('off')\nplt.show()\nfig.savefig(\"word1.png\", dpi=900)","execution_count":38,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"a5d24fbff42b6063ddf2aa9eb3c37f8ee364d789"},"cell_type":"code","source":"wordcloud = WordCloud(\n                          background_color='white',\n                          stopwords=stopwords,\n                          max_words=400,\n                          max_font_size=40, \n                          random_state=42\n                         ).generate(str(train['title']))\n\nprint(wordcloud)\nfig = plt.figure(1)\nplt.imshow(wordcloud)\nplt.axis('off')\nplt.show()\nfig.savefig(\"word1.png\", dpi=900)","execution_count":39,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"0908fab46917b0b741a23f94e47e772c25b3a560"},"cell_type":"code","source":"wordcloud = WordCloud(\n                          background_color='white',\n                          stopwords=stopwords,\n                          max_words=400,\n                          max_font_size=40, \n                          random_state=42\n                         ).generate(str(test['title']))\n\nprint(wordcloud)\nfig = plt.figure(1)\nplt.imshow(wordcloud)\nplt.axis('off')\nplt.show()\nfig.savefig(\"word1.png\", dpi=900)","execution_count":40,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"f4e61a9acfc7cd3d5f878329d37157ac59f44f34"},"cell_type":"code","source":"wordcloud = WordCloud(\n                          background_color='white',\n                          stopwords=stopwords,\n                          max_words=400,\n                          max_font_size=40, \n                          random_state=42\n                         ).generate(str(train['category_name']))\n\nprint(wordcloud)\nfig = plt.figure(1)\nplt.imshow(wordcloud)\nplt.axis('off')\nplt.show()\nfig.savefig(\"word1.png\", dpi=900)","execution_count":41,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"1e1499b195025db8d95a4e83ce092ee917cd141d"},"cell_type":"code","source":"wordcloud = WordCloud(\n                          background_color='white',\n                          stopwords=stopwords,\n                          max_words=400,\n                          max_font_size=40, \n                          random_state=42\n                         ).generate(str(test['category_name']))\n\nprint(wordcloud)\nfig = plt.figure(1)\nplt.imshow(wordcloud)\nplt.axis('off')\nplt.show()\nfig.savefig(\"word1.png\", dpi=900)","execution_count":42,"outputs":[]},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"4bbb7e4804589309a3a16843c86d17be5423853d"},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.5","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}