{"cells":[{"metadata":{"_uuid":"2ff87e7bffee78a903d961c644af46cff8d1910c"},"cell_type":"markdown","source":"**This Kernel is only for Learning purpose ,not for competition**\n----------------------------------"},{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"import pandas as pd\nimport os","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"os.listdir('../input/')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"scrolled":true,"_uuid":"64595128777d52da810a98a3014c2e382a843c00"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\")\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"86011a73e79ab06c5c34d0965b77c394d04ea4bd"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",sep=\"\\t\")\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"95b6aee01c3524097cd5a20d567c80fffc90f97c"},"cell_type":"markdown","source":"**If you have a header, you can pass header=0.**"},{"metadata":{"trusted":true,"_uuid":"8b95061d23efefeb3785d131d19c01598ab6770f"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",sep=\"\\t\",header=0)\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"2071ed19339713bd01867c03c96ec8a6256cc202"},"cell_type":"markdown","source":"**header : int, list of int, default ‘infer’**\n\nRow number(s) to use as the column names, and the start of the data. Default behavior is to infer the column names: if no names are passed the behavior is identical to header=0 and column names are inferred from the first line of the file, if column names are passed explicitly then the behavior is identical to header=None."},{"metadata":{"trusted":true,"_uuid":"693ed9c5062cf5e00f910b817a99cee53eac481f"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",sep=\"\\t\",header=1) # it makes first data row as header\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"82b52c61e247de625e011f602c5811b62480518e"},"cell_type":"markdown","source":"**Now five rows as Header**"},{"metadata":{"trusted":true,"_uuid":"0cf2227852817b8f3464dd290a42194f049db58f"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",sep=\"\\t\",header=[1,2,3,4,5])\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"dacf4e494469d2adb9cf49f5d1ec2b28dfdcaca3"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",sep=\"\\t\",header=0)\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"53628589f6386cddfdb8eaec4aeb6922da08103d"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",delimiter='\\t') #alias for sep\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"ab71d5f5144443abf82f6f229cadced077e7d308"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",sep=\"\\t\",encoding=\"utf-8\")\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"52d7573cd1c61759d558ca57f772471bd289925b"},"cell_type":"code","source":"df.head(10)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"0d4b90ab7fa80d67d17512b8b86506d280d54cf3"},"cell_type":"code","source":"df.tail(10)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"8ee97f1dfbc1abf97c4290afe0ec8b82b524bf22"},"cell_type":"code","source":"len(df)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"0afd681838b8ac6903ac9f8552fb17aa50a3e4ca"},"cell_type":"markdown","source":"**Read only 20 rows**"},{"metadata":{"trusted":true,"scrolled":false,"_uuid":"b37ff189990d973efc820188a2a16ade71688612"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",sep=\"\\t\",nrows=20, encoding=\"utf-8\")\ndf","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"d07dd77c63704c178ba73fd9f49d037a45557ef0"},"cell_type":"code","source":"len(df)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"7abeb2cb9a07107dd3b4b4b4af18cd05ca6deac9"},"cell_type":"markdown","source":"# skip 100 rows"},{"metadata":{"trusted":true,"scrolled":true,"_uuid":"1d8a8ad5d1fe798890e2420707984e8d3c3cc248"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",sep=\"\\t\", skiprows=100)\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"d68bae0cabbd07e984f501378af8bb3aeb5afff7"},"cell_type":"code","source":"len(df)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"scrolled":true,"_uuid":"fb2e759cc71f90718d2726bb0e28ee61c2c5b526"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",sep=\"\\t\", skiprows=100, header=None)\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"77eb507e7307df2e127b7da6034979439f55143f"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",sep=\"\\t\", usecols=[\"UserID\",\"UserAgentID\",\"UserAgentOSID\",\"UserDeviceID\",\"UserAgentFamilyID\"])\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"100e73eada44696eb6d9c299ba2018bf858ea614"},"cell_type":"code","source":"len(df)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"ec88cf451e7b047865e512ff528b1ed88caf8416"},"cell_type":"code","source":"df = pd.read_csv(\"../input/UserInfo.tsv\",sep=\"\\t\", skipfooter=100)\ndf.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"02dbb41ee75baa76a26f3c697401b3de207bb571"},"cell_type":"code","source":"len(df)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"a4ae5d54d91f9f9e1c6c04ef4e9024c0efac28cf"},"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.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}