{"id":7173,"date":"2025-03-04T06:31:42","date_gmt":"2025-03-04T06:31:42","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=7173"},"modified":"2025-03-04T06:31:44","modified_gmt":"2025-03-04T06:31:44","slug":"how-to-delete-column-in-pandas-dataframe","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/","title":{"rendered":"How to Delete Column in Pandas Dataframe"},"content":{"rendered":"\n<p>Python developers often use Pandas dataframe to store data in a tabular manner as columns and rows. Often, they need to delete one or more columns in Pandas dataframe. There are several ways to do this. In this article, we will learn how to delete column in Pandas dataframe.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#How_to_Delete_Column_in_Pandas_Dataframe\" >How to Delete Column in Pandas Dataframe<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#1_Using_del\" >1. Using del<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#2_Using_drop\" >2. Using drop<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#3_Using_pop\" >3. Using pop<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Delete_Column_in_Pandas_Dataframe\"><\/span>How to Delete Column in Pandas Dataframe<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are 3 principle ways to delete one or more columns in dataframe. Let us look at them one by one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Using_del\"><\/span>1. Using del<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Python provides del command to delete columns in Pandas dataframe. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">del dataframe[column_name]<\/pre>\n\n\n\n<p>Here is an example to delete column &#8216;calories&#8217; from a dataframe. Let us first create a dataframe.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import pandas as pd<br><br>data = {<br>  \"calories\": [420, 380, 390],<br>  \"duration\": [50, 40, 45]<br>}<br><br>df = pd.DataFrame(data)<br><br>print(df) <\/pre>\n\n\n\n<p>Here is the output.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">   calories  duration<br>0       420        50<br>1       380        40<br>2       390        45<\/pre>\n\n\n\n<p>Here is the code to delete column &#8216;calories&#8217;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">del df['calories']<br><br>print(df) <\/pre>\n\n\n\n<p>Here is the output.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">   duration<br>0        50<br>1        40<br>2        45<\/pre>\n\n\n\n<p>This is an easy to way to delete a column in Pandas dataframe. But it allows you to delete only one column at a time. If you want to delete multiple columns or collection or columns then you need to use the drop command described below.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Using_drop\"><\/span>2. Using drop<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Every dataframe supports drop command out of the box. You can directly call it on every dataframe. It is a very versatile command that allows you to remove one or more columns as per your requirement. Let us look at the different ways to delete one or more columns. Let us say you have the following dataframe.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import pandas as pd<br><br>data = {<br>  \"calories\": [420, 380, 390],<br>  \"duration\": [50, 40, 45],<br>  \"id\": [1, 2, 3]<br>}<br><br>#load data into a DataFrame object:<br>df = pd.DataFrame(data)<br><br>print(df) <\/pre>\n\n\n\n<p>Here is the output.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">   calories  duration  id<br>0       420        50   1<br>1       380        40   2<br>2       390        45   3<\/pre>\n\n\n\n<p>Here is a simple way to delete one column by specifying its column name.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dataframe = dataframe.drop('column_name', axis=1)<\/pre>\n\n\n\n<p>Here is an example to drop &#8216;calories&#8217; column.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df = df.drop('calories', axis=1)<br>print(df) <br><br>## output ##<br><br>   duration  id<br>0        50   1<br>1        40   2<br>2        45   3<\/pre>\n\n\n\n<p>By default, when you call df.drop() command, it will return the result dataframe, without modifying the original dataframe. So we re-assign the result back to the original dataframe, in order to modify it. If you do not want to re-assign the dataframe, then you can modify the drop command as shown below, using the &#8216;inplace&#8217; keyword.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df.drop('calories', axis=1, inplace=True)<br>print(df) <\/pre>\n\n\n\n<p>In the above examples, we are deleting only one column. If you want to delete multiple columns, you need to use &#8216;columns&#8217; argument and pass the list of names of columns that you want to delete. Here is an example to delete columns calories and id.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df = df.drop(columns=['calories', 'id'])<br>print(df) <br><br>## output<br><br>   duration<br>0        50<br>1        40<br>2        45<\/pre>\n\n\n\n<p>You can also mention a list of column names to get the above output.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df = df.drop(['calories', 'id'])<br>print(df) <\/pre>\n\n\n\n<p>Instead of mentioning column names, you can also specify their index starting with 0 for first column, 1 for second column and so on. For this purpose, we list the indexes in dataframe.columns[]. Here is the command to delete &#8216;duration&#8217; and &#8216;id&#8217; columns.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df = df.drop(df.columns[[1, 2]], axis=1)<br><br>## output<br><br>   calories<br>0       420<br>1       380<br>2       390<\/pre>\n\n\n\n<p>As you can see, using drop() function allows you to precisely remove one or more columns in pandas dataframe. Since it is so comprehensive, it has a more complicated syntax, as compared to using del command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Using_pop\"><\/span>3. Using pop<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can also use pop command to remove a column from dataframe. Just mention the column name in dataframe.pop() function, as shown below. Here is an example to remove &#8216;duration&#8217; column.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df.pop('duration')<br>print(df) <br><br>## output<br><br>   calories  id<br>0       420   1<br>1       380   2<br>2       390   3<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt several simple ways to delete one or more columns in Pandas dataframe. If you want to delete just one column, then you can use del command. If you want to delete multiple columns, then use drop() function since it provides many different ways to remove multiple columns. <\/p>\n\n\n\n<p>Also read:<\/p>\n\n\n\n<p><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-sort-python-dictionary-by-value\/\">How to Sort Python Dictionary by Value<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-rename-columns-in-pandas\/\">How to Rename Columns in Pandas<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-select-rows-from-dataframe-based-on-column-values\/\">How to Select Rows from Dataframe Based on Column Values<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often Python developers need to delete column in Pandas dataframe. Here are 3 different ways to do this.<\/p>\n","protected":false},"author":1,"featured_media":7190,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[301],"tags":[391],"class_list":["post-7173","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-delete-column"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Delete Column in Pandas Dataframe - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Often Python developers need to delete column in Pandas dataframe. Here are 3 different ways to do this.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Delete Column in Pandas Dataframe - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Often Python developers need to delete column in Pandas dataframe. Here are 3 different ways to do this.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-04T06:31:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-04T06:31:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/03\/delete-column-from-pandas-dataframe.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"246\" \/>\n\t<meta property=\"og:image:height\" content=\"163\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Delete Column in Pandas Dataframe\",\"datePublished\":\"2025-03-04T06:31:42+00:00\",\"dateModified\":\"2025-03-04T06:31:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/\"},\"wordCount\":571,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/03\/delete-column-from-pandas-dataframe.jpg?fit=246%2C163&ssl=1\",\"keywords\":[\"delete column\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/\",\"name\":\"How to Delete Column in Pandas Dataframe - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/03\/delete-column-from-pandas-dataframe.jpg?fit=246%2C163&ssl=1\",\"datePublished\":\"2025-03-04T06:31:42+00:00\",\"dateModified\":\"2025-03-04T06:31:44+00:00\",\"author\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Often Python developers need to delete column in Pandas dataframe. Here are 3 different ways to do this.\",\"breadcrumb\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/03\/delete-column-from-pandas-dataframe.jpg?fit=246%2C163&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/03\/delete-column-from-pandas-dataframe.jpg?fit=246%2C163&ssl=1\",\"width\":246,\"height\":163,\"caption\":\"delete column from pandas dataframe\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ubiq.co\/tech-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Delete Column in Pandas Dataframe\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/\"],\"url\":\"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Delete Column in Pandas Dataframe - Ubiq BI","description":"Often Python developers need to delete column in Pandas dataframe. Here are 3 different ways to do this.","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:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/","og_locale":"en_US","og_type":"article","og_title":"How to Delete Column in Pandas Dataframe - Ubiq BI","og_description":"Often Python developers need to delete column in Pandas dataframe. Here are 3 different ways to do this.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2025-03-04T06:31:42+00:00","article_modified_time":"2025-03-04T06:31:44+00:00","og_image":[{"width":246,"height":163,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/03\/delete-column-from-pandas-dataframe.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Delete Column in Pandas Dataframe","datePublished":"2025-03-04T06:31:42+00:00","dateModified":"2025-03-04T06:31:44+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/"},"wordCount":571,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/03\/delete-column-from-pandas-dataframe.jpg?fit=246%2C163&ssl=1","keywords":["delete column"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/","name":"How to Delete Column in Pandas Dataframe - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/03\/delete-column-from-pandas-dataframe.jpg?fit=246%2C163&ssl=1","datePublished":"2025-03-04T06:31:42+00:00","dateModified":"2025-03-04T06:31:44+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Often Python developers need to delete column in Pandas dataframe. Here are 3 different ways to do this.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/03\/delete-column-from-pandas-dataframe.jpg?fit=246%2C163&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/03\/delete-column-from-pandas-dataframe.jpg?fit=246%2C163&ssl=1","width":246,"height":163,"caption":"delete column from pandas dataframe"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-delete-column-in-pandas-dataframe\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Delete Column in Pandas Dataframe"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/03\/delete-column-from-pandas-dataframe.jpg?fit=246%2C163&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-1RH","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/7173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=7173"}],"version-history":[{"count":16,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/7173\/revisions"}],"predecessor-version":[{"id":7189,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/7173\/revisions\/7189"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/7190"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=7173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=7173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=7173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}