{"id":135,"date":"2026-03-02T15:12:01","date_gmt":"2026-03-02T10:12:01","guid":{"rendered":"https:\/\/gigz.pk\/python\/?post_type=lesson&#038;p=135"},"modified":"2026-03-17T07:52:49","modified_gmt":"2026-03-17T02:52:49","slug":"introduction-to-pandas","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/python\/lesson\/introduction-to-pandas\/","title":{"rendered":"\u00a0Introduction to Pandas"},"content":{"rendered":"\n<p>Pandas is a powerful Python library used for data manipulation and analysis. It is one of the most important tools in Data Analytics and Data Science.<\/p>\n\n\n\n<p>Pandas makes it easy to work with structured data such as tables, spreadsheets, and CSV files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Use Pandas?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Handles structured data efficiently<\/li>\n\n\n\n<li>Works with CSV, Excel, SQL, and more<\/li>\n\n\n\n<li>Provides powerful data filtering and transformation tools<\/li>\n\n\n\n<li>Built on top of NumPy<\/li>\n\n\n\n<li>Widely used in industry<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Pandas<\/h2>\n\n\n\n<p>If not installed, use:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pip install pandas<\/pre>\n\n\n\n<p>Import Pandas:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import pandas as pd<\/pre>\n\n\n\n<p><code>pd<\/code> is the common alias for pandas.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Core Data Structures in Pandas<\/h2>\n\n\n\n<p>Pandas mainly uses two data structures:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Series<\/h3>\n\n\n\n<p>A Series is a one-dimensional labeled array.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import pandas as pddata = pd.Series([10, 20, 30, 40])<br>print(data)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. DataFrame<\/h3>\n\n\n\n<p>A DataFrame is a two-dimensional table with rows and columns.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">data = {<br>    \"Name\": [\"Ali\", \"Sara\", \"Ahmed\"],<br>    \"Age\": [25, 28, 30],<br>    \"Salary\": [50000, 60000, 70000]<br>}df = pd.DataFrame(data)<br>print(df)<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Loading Data into Pandas<\/h2>\n\n\n\n<p>From a CSV file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df = pd.read_csv(\"data.csv\")<\/pre>\n\n\n\n<p>From an Excel file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df = pd.read_excel(\"data.xlsx\")<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Viewing Data<\/h2>\n\n\n\n<p>First 5 rows:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df.head()<\/pre>\n\n\n\n<p>Last 5 rows:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df.tail()<\/pre>\n\n\n\n<p>Check data information:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df.info()<\/pre>\n\n\n\n<p>Statistical summary:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df.describe()<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Selecting Data<\/h2>\n\n\n\n<p>Select a column:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df[\"Age\"]<\/pre>\n\n\n\n<p>Select multiple columns:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df[[\"Name\", \"Salary\"]]<\/pre>\n\n\n\n<p>Filter data:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df[df[\"Age\"] &gt; 26]<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Why Pandas is Important in Data Analytics<\/h2>\n\n\n\n<p>Pandas helps you:<\/p>\n\n\n\n<p>Clean data<br>Filter and sort records<br>Handle missing values<br>Group and summarize data<br>Prepare data for visualization and machine learning<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Key Takeaway<\/h2>\n\n\n\n<p>Pandas is the backbone of data analysis in Python. Mastering DataFrames and Series will allow you to efficiently load, clean, analyze, and transform real-world datasets.<\/p>\n\n\n<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/gigz.pk\/python\/\">Home<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\">PYTHON FOR DATA ANALYTICS (PYDA) > Pandas > Introduction to Pandas<\/span><\/span><\/div>\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1773716118221\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n","protected":false},"menu_order":70,"template":"","class_list":["post-135","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u00a0Introduction to Pandas - One Language. Endless Possibilities<\/title>\n<meta name=\"description\" content=\"Learn Pandas in Python: create DataFrames, load CSV\/Excel files, filter data, and perform powerful data analysis efficiently.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/python\/lesson\/introduction-to-pandas\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u00a0Introduction to Pandas - One Language. Endless Possibilities\" \/>\n<meta property=\"og:description\" content=\"Learn Pandas in Python: create DataFrames, load CSV\/Excel files, filter data, and perform powerful data analysis efficiently.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/python\/lesson\/introduction-to-pandas\/\" \/>\n<meta property=\"og:site_name\" content=\"One Language. Endless Possibilities\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-17T02:52:49+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/gigz.pk\\\/python\\\/lesson\\\/introduction-to-pandas\\\/\",\"url\":\"https:\\\/\\\/gigz.pk\\\/python\\\/lesson\\\/introduction-to-pandas\\\/\",\"name\":\"\u00a0Introduction to Pandas - One Language. Endless Possibilities\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/python\\\/#website\"},\"datePublished\":\"2026-03-02T10:12:01+00:00\",\"dateModified\":\"2026-03-17T02:52:49+00:00\",\"description\":\"Learn Pandas in Python: create DataFrames, load CSV\\\/Excel files, filter data, and perform powerful data analysis efficiently.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/python\\\/lesson\\\/introduction-to-pandas\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/python\\\/lesson\\\/introduction-to-pandas\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/python\\\/lesson\\\/introduction-to-pandas\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/python\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PYTHON FOR DATA ANALYTICS (PYDA) > Pandas > Introduction to Pandas\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/python\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/python\\\/\",\"name\":\"One Language. Endless Possibilities\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/python\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u00a0Introduction to Pandas - One Language. Endless Possibilities","description":"Learn Pandas in Python: create DataFrames, load CSV\/Excel files, filter data, and perform powerful data analysis efficiently.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gigz.pk\/python\/lesson\/introduction-to-pandas\/","og_locale":"en_US","og_type":"article","og_title":"\u00a0Introduction to Pandas - One Language. Endless Possibilities","og_description":"Learn Pandas in Python: create DataFrames, load CSV\/Excel files, filter data, and perform powerful data analysis efficiently.","og_url":"https:\/\/gigz.pk\/python\/lesson\/introduction-to-pandas\/","og_site_name":"One Language. Endless Possibilities","article_modified_time":"2026-03-17T02:52:49+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/gigz.pk\/python\/lesson\/introduction-to-pandas\/","url":"https:\/\/gigz.pk\/python\/lesson\/introduction-to-pandas\/","name":"\u00a0Introduction to Pandas - One Language. Endless Possibilities","isPartOf":{"@id":"https:\/\/gigz.pk\/python\/#website"},"datePublished":"2026-03-02T10:12:01+00:00","dateModified":"2026-03-17T02:52:49+00:00","description":"Learn Pandas in Python: create DataFrames, load CSV\/Excel files, filter data, and perform powerful data analysis efficiently.","breadcrumb":{"@id":"https:\/\/gigz.pk\/python\/lesson\/introduction-to-pandas\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/python\/lesson\/introduction-to-pandas\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/python\/lesson\/introduction-to-pandas\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/python\/"},{"@type":"ListItem","position":2,"name":"PYTHON FOR DATA ANALYTICS (PYDA) > Pandas > Introduction to Pandas"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/python\/#website","url":"https:\/\/gigz.pk\/python\/","name":"One Language. Endless Possibilities","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/python\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/python\/wp-json\/wp\/v2\/lesson\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/python\/wp-json\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/python\/wp-json\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/python\/wp-json\/wp\/v2\/media?parent=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}