{"id":432,"date":"2023-06-06T02:42:03","date_gmt":"2023-06-05T21:42:03","guid":{"rendered":"https:\/\/immadshahid.com\/?p=432"},"modified":"2023-06-06T02:42:03","modified_gmt":"2023-06-05T21:42:03","slug":"data-science-lecture-1-reading-a-csv-dataset-using-pandas","status":"publish","type":"post","link":"https:\/\/immadshahid.com\/blog\/data-science-lecture-1-reading-a-csv-dataset-using-pandas\/","title":{"rendered":"Data Science Lecture 1&#8243; Reading a .csv Dataset using Pandas"},"content":{"rendered":"\n<p>Pandas is a module in Python, used for data manipulation, and is an essential tool for Data Sciences and Machine Learning. <\/p>\n\n\n\n<p>In this article, we will learn how to read a .csv dataset into a Jupyter Notebook\/Google Colab using the Pandas Module.<\/p>\n\n\n\n<p>Step 1: Import the Pandas Module using the command: <code>import pandas as pd<\/code><\/p>\n\n\n\n<p>Step 2: If you are using Google Colab: <code>from google.colab import files<\/code> <\/p>\n\n\n\n<p>           Then: <code>uploaded = files.upload()<\/code> (This will give you the option to upload the desired files)<\/p>\n\n\n\n<p>            If using Jupyter Notebook, simply enter the path and import the file<\/p>\n\n\n\n<p>Step 3: <code>Read the dataset: pd.read_csv('filename.csv')<\/code><\/p>\n\n\n\n<p>These are the initial steps on how to import a .csv dataset onto your preferred Data Science tool, i.e Google Colab or Jupyter Notebook.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"483\" src=\"https:\/\/immadshahid.com\/wp-content\/uploads\/2023\/06\/image-1024x483.png\" alt=\"\" class=\"wp-image-433\" srcset=\"https:\/\/immadshahid.com\/blog\/wp-content\/uploads\/2023\/06\/image-1024x483.png 1024w, https:\/\/immadshahid.com\/blog\/wp-content\/uploads\/2023\/06\/image-300x141.png 300w, https:\/\/immadshahid.com\/blog\/wp-content\/uploads\/2023\/06\/image-768x362.png 768w, https:\/\/immadshahid.com\/blog\/wp-content\/uploads\/2023\/06\/image-1536x724.png 1536w, https:\/\/immadshahid.com\/blog\/wp-content\/uploads\/2023\/06\/image.png 1900w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><em>For example on Google Colab<\/em><\/figcaption><\/figure>\n\n\n\n<p>For reference watch:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Data Science Lecture 1: Loading Dataset using Pandas | Immad Shahid\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/pbdvVKThwlA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Pandas is a module in Python, used for data manipulation, and is an essential tool&hellip;<\/p>\n","protected":false},"author":1,"featured_media":434,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[130,124,128,92,54,90,21,42,121,25,89,129,127,122,23],"tags":[],"class_list":["post-432","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cheat-sheet","category-data-analytics","category-data-science","category-earning-and-learning","category-education","category-freelancing","category-internet","category-language","category-machine-learning","category-media","category-online-earning","category-pandas","category-python","category-sklearn","category-social-media"],"_links":{"self":[{"href":"https:\/\/immadshahid.com\/blog\/wp-json\/wp\/v2\/posts\/432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/immadshahid.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/immadshahid.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/immadshahid.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/immadshahid.com\/blog\/wp-json\/wp\/v2\/comments?post=432"}],"version-history":[{"count":1,"href":"https:\/\/immadshahid.com\/blog\/wp-json\/wp\/v2\/posts\/432\/revisions"}],"predecessor-version":[{"id":435,"href":"https:\/\/immadshahid.com\/blog\/wp-json\/wp\/v2\/posts\/432\/revisions\/435"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/immadshahid.com\/blog\/wp-json\/wp\/v2\/media\/434"}],"wp:attachment":[{"href":"https:\/\/immadshahid.com\/blog\/wp-json\/wp\/v2\/media?parent=432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/immadshahid.com\/blog\/wp-json\/wp\/v2\/categories?post=432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/immadshahid.com\/blog\/wp-json\/wp\/v2\/tags?post=432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}