{"id":3696,"date":"2026-09-26T12:00:25","date_gmt":"2026-09-26T05:00:25","guid":{"rendered":"https:\/\/sumberlaba.com\/index.php\/2026\/09\/26\/how-to-use-pandas-for-data-manipulation-a-practical-tutorial-2\/"},"modified":"2026-09-26T12:00:26","modified_gmt":"2026-09-26T05:00:26","slug":"how-to-use-pandas-for-data-manipulation-a-practical-tutorial-2","status":"publish","type":"post","link":"https:\/\/sumberlaba.com\/index.php\/2026\/09\/26\/how-to-use-pandas-for-data-manipulation-a-practical-tutorial-2\/","title":{"rendered":"How to Use Pandas for Data Manipulation: A Practical Tutorial"},"content":{"rendered":"<h1>How to Use Pandas for Data Manipulation: A Practical Tutorial<\/h1>\n<p>Pandas is Python&#8217;s go-to library for cleaning, transforming, and analyzing tabular data. This tutorial covers the essential operations you&#8217;ll use every day.<\/p>\n<p>Start by importing it and loading your dataset. Pandas reads CSV, Excel, JSON, and SQL sources out of the box with <code>pd.read_csv()<\/code> and friends.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/sumberlaba.com\/wp-content\/uploads\/2026\/09\/article-1790398822775.jpg\" alt=\"Article illustration\" style=\"display:block;margin:20px auto;max-width:100%;height:auto;border-radius:8px;\" \/><\/p>\n<h2>1. Inspect Your Data First<\/h2>\n<p>Before changing anything, understand what you have. Run <code>df.head()<\/code>, <code>df.info()<\/code>, and <code>df.describe()<\/code> to check structure, data types, and summary statistics. This surfaces missing values early.<\/p>\n<h2>2. Select and Filter Rows<\/h2>\n<p>Use <code>df['column']<\/code> for a Series and <code>df[['a','b']]<\/code> for multiple columns. Filtering works like this:<\/p>\n<ul>\n<li><code>df[df['age'] > 30]<\/code> \u2014 condition-based filter<\/li>\n<li><code>df.loc[0:5, 'name']<\/code> \u2014 label-based selection<\/li>\n<li><code>df.iloc[0:5, 0:2]<\/code> \u2014 position-based selection<\/li>\n<\/ul>\n<h2>3. Clean and Transform<\/h2>\n<p>Handle gaps with <code>df.dropna()<\/code> or <code>df.fillna(0)<\/code>. Create fields with <code>df['total'] = df['price'] * df['qty']<\/code>, and rename columns using <code>df.rename(columns={...})<\/code>.<\/p>\n<h2>4. Group and Aggregate<\/h2>\n<p>Summarize categories with <code>df.groupby('region')['sales'].sum()<\/code>. Chain <code>.agg()<\/code> to compute several statistics at once.<\/p>\n<h2>Conclusion<\/h2>\n<p>Loading, inspecting, filtering, and grouping cover most day-to-day pandas work. Practice on real datasets and the syntax quickly becomes second nature.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Use Pandas for Data Manipulation: A Practical Tutorial Pandas is Python&#8217;s go-to library for cleaning, transforming, and analyzing tabular data. This tutorial covers the essential operations you&#8217;ll use every day. Start by importing it and loading your dataset. Pandas reads CSV, Excel, JSON, and SQL sources out of the box with pd.read_csv() and &hellip; <\/p>\n","protected":false},"author":2716,"featured_media":3695,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3696","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-non-category"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/3696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/users\/2716"}],"replies":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/comments?post=3696"}],"version-history":[{"count":1,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/3696\/revisions"}],"predecessor-version":[{"id":3697,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/3696\/revisions\/3697"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/media\/3695"}],"wp:attachment":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/media?parent=3696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/categories?post=3696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/tags?post=3696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}