{"cells":[{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"68527ae6-629b-d48f-68ef-261c7a50a1e2"},"outputs":[],"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\nfrom subprocess import check_output\nprint(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n\n# Any results you write to the current directory are saved as output."},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"b762f22e-995e-d02d-2ff8-ab921c5cf347"},"outputs":[],"source":"#!/usr/bin/python\nimport csv\nimport glob\nimport os\nimport sys\n\ninput_path = sys.argv[1]\noutput_file = sys.argv[2]\n\nfilewriter = csv.writer(open(output_file,'wb'))\nfile_counter = 0\nfor input_file in glob.glob(os.path.join(input_path,'*.csv')):\n        with open(input_file,'rU') as csv_file:\n                filereader = csv.reader(csv_file)\n                if file_counter < 1:\n                        for row in filereader:\n                                filewriter.writerow(row)\n                else:\n                        header = next(filereader,None)\n                        for row in filereader:\n                                filewriter.writerow(row)\n        file_counter += 1"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"5a0f4c83-5470-e622-429e-73a6d600959f"},"outputs":[],"source":"events.head()"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"92aa0651-9e46-00fa-3324-de53fa55d1b2"},"outputs":[],"source":"import urllib2\nimport sys"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"0e58c037-5da0-3a5f-e8c6-38ccffed06f0"},"outputs":[],"source":"target=pd.read_csv('../input/documents_categories.csv')\ntarget.head()"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"ebc3ca68-b514-426a-00ec-fa426398401c"},"outputs":[],"source":"print(target.head())\nprint(target.tail())\n"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"85245e0c-e129-68b0-e821-f892fd00f734"},"outputs":[],"source":"summary=target.describe()\nprint(summary)"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"94380904-6ba9-5414-4ca1-a2799b6f3bd5"},"outputs":[],"source":"if target.confidence_level>0.55:\n    print('alto')\n   \n    "}],"metadata":{"_change_revision":0,"_is_fork":false,"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.6.0"}},"nbformat":4,"nbformat_minor":0}