{"id":8304,"date":"2025-05-20T07:08:00","date_gmt":"2025-05-20T07:08:00","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=8304"},"modified":"2025-08-08T04:31:43","modified_gmt":"2025-08-08T04:31:43","slug":"how-to-write-pandas-dataframe-to-excel-spreadsheets","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/","title":{"rendered":"How to Write Pandas Dataframe to Excel Spreadsheets"},"content":{"rendered":"\n<p>Often Python developers need to export data to spreadsheets. This is a common requirement in <a href=\"https:\/\/ubiq.co\/data-analysis-tool\">data analysis and reporting<\/a>. You can easily do this using Pandas library. It allows you to easily export one or more dataframes to excel workbooks. In this article, we will learn how to write Pandas dataframe to Excel spreadsheets.<\/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-write-pandas-dataframe-to-excel-spreadsheets\/#How_to_Write_Pandas_Dataframe_to_Excel_Spreadsheets\" >How to Write Pandas Dataframe to Excel Spreadsheets<\/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-write-pandas-dataframe-to-excel-spreadsheets\/#1_Export_to_Single_Spreadsheet\" >1. Export to Single Spreadsheet<\/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-write-pandas-dataframe-to-excel-spreadsheets\/#2_Export_to_Multiple_Spreadsheets\" >2. Export to Multiple Spreadsheets<\/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-write-pandas-dataframe-to-excel-spreadsheets\/#3_Customize_Data_formatting_during_export\" >3. Customize Data formatting during export<\/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-write-pandas-dataframe-to-excel-spreadsheets\/#4_Using_Conditional_Formatting\" >4. Using Conditional Formatting<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Write_Pandas_Dataframe_to_Excel_Spreadsheets\"><\/span>How to Write Pandas Dataframe to Excel Spreadsheets<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Every Pandas dataframe supports to_excel() function that allows you to export the dataframe to a spreadsheet. It supports numerous arguments that allow you to customize how you export your data. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dataframe.to_excel( excel_writer, sheet_name, **kwargs )<\/pre>\n\n\n\n<p>In the above command, you can invoke to_excel() function from any dataframe. You need to provide the file path to excel spreadsheet at the minimum. Other arguments are optional.<\/p>\n\n\n\n<p>In this article, we will learn about the common use cases faced by Python developers. 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 = {'Name': ['John', 'Jane', 'Joe'],<br>        'Age': [28, 22, 22],<br>        'City': ['New York', 'Paris', 'London']}<br><br>df = pd.DataFrame(data)<br>print(df)<br><br>## output<br><br>   Name  Age      City<br>0  John   28  New York<br>1  Jane   22     Paris<br>2   Joe   22    London<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Export_to_Single_Spreadsheet\"><\/span>1. Export to Single Spreadsheet<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can export a single dataframe to a single spreadsheet by simply calling the to_excel() function on the dataframe. Here is an example to export the above dataframe to spreadsheet \/home\/ubuntu\/test.xlsx.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df.to_excel('\/home\/ubuntu\/test.xlsx')<\/pre>\n\n\n\n<p>Please ensure that you provide full file path to the spreadsheet. Otherwise, it will create the file in present working directory.<\/p>\n\n\n\n<p>Here is the output you will see after exporting of data.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Excel file '\/home\/ubuntu\/test.xlsx' created successfully.<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Export_to_Multiple_Spreadsheets\"><\/span>2. Export to Multiple Spreadsheets<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>to_excel() function can also be used to export data to multiple spreadsheets. If you need to import multiple dataframes, you can do so as shown below. For this purpose, you need to use ExcelWriter class that is available in Pandas library.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import pandas as pd<br><br>data = {'Name': ['John', 'Jane', 'Joe'],<br>        'Age': [28, 22, 22],<br>        'City': ['New York', 'Paris', 'London']}<br><br>data2 = {'Name': ['John', 'Jane', 'Joe'],<br>        'Age': [28, 22, 22],<br>        'City': ['New York', 'Paris', 'London']}<br><br>df = pd.DataFrame(data)<br>df2 = pd.DataFrame(data2)<br><\/pre>\n\n\n\n<p>Here is how to export the above 2 dataframes to separate spreadsheets of same workbook.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">with pd.ExcelWriter('\/home\/ubuntu\/test.xlsx') as writer:<br>    df1.to_excel(writer, sheet_name='data', index=False)<br>    df2.to_excel(writer, sheet_name='data2', index=False)<\/pre>\n\n\n\n<p>In the above code, we use excel writer object to write individual dataframes to separate spreadsheets.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Customize_Data_formatting_during_export\"><\/span>3. Customize Data formatting during export<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>MS Excel is well known for its formatting capabilities. You will be happy to know that you can format your spreadsheets using Pandas, right from within Python. Here is an example to make the header row (row #1) bold format after data export. First, we export the data to spreadsheet.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import pandas as pd<br><br>data = {'Name': ['John', 'Jane', 'Joe'],<br>        'Age': [28, 22, 22],<br>        'City': ['New York', 'Paris', 'London']}<br><br>df = pd.DataFrame(data)<br><br>with pd.ExcelWriter('\/home\/ubuntu\/test.xlsx') as writer:<br>    df.to_excel(writer, sheet_name='data', index=False)<\/pre>\n\n\n\n<p>Here is the code to format the header row.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">workbook = writer.book<br>worksheet = writer.sheets['data']<br><br>header_format = workbook.add_format({<br>    'bold': True<br>})<br><br>for col_num, value in enumerate(df.columns.values):<br>    worksheet.write(0, col_num, value, header_format)<\/pre>\n\n\n\n<p>In the above code, we first create an object for workbook. Then we access its &#8216;data&#8217; spreadsheet. Then we define the header format using add_format() function. Then we loop through the header row one by one, updating their format, one at a time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Using_Conditional_Formatting\"><\/span>4. Using Conditional Formatting<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Often, Python developers need to apply some sort of <a href=\"https:\/\/support.microsoft.com\/en-us\/office\/use-conditional-formatting-to-highlight-information-in-excel-fed60dfa-1d3f-4e13-9ecb-f1951ff89d7f\" target=\"_blank\" rel=\"noreferrer noopener\">conditional formatting<\/a> too to their workbooks. You can easily do this using conditional_format() function available to worksheet object.<\/p>\n\n\n\n<p>After you have exported the data to spreadsheet as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import pandas as pd<br><br>data = {'Name': ['John', 'Jane', 'Joe'],<br>        'Age': [28, 22, 22],<br>        'City': ['New York', 'Paris', 'London']}<br><br>df = pd.DataFrame(data)<br><br>with pd.ExcelWriter('\/home\/ubuntu\/test.xlsx') as writer:<br>    df.to_excel(writer, sheet_name='data', index=False)<\/pre>\n\n\n\n<p>We create an object for our spreadsheet, for conditional formatting.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">workbook = writer.book<br>worksheet = writer.sheets['data']<\/pre>\n\n\n\n<p>Then, we define conditional formatting for age&gt;25 and age&lt;=25, using add_format() function<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># green color if age&gt;=25<br>positive_format = workbook.add_format({'bg_color': '#C6EFCE'})<br><br># red color if age&lt;25<br>negative_format = workbook.add_format({'bg_color': '#FFC7CE'})<\/pre>\n\n\n\n<p>Then we apply this formatting, along with defining the condition.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># apply conditional formatting to all data cells<br>worksheet.conditional_format('A2:C4', {<br>        'type': 'cell',<br>        'criteria': '&gt;=',<br>        'value': 25,<br>        'format': positive_format<br>    })<br><br>worksheet.conditional_format('A2:C4', {<br>        'type': 'cell',<br>        'criteria': '&lt;',<br>        'value': 25,<br>        'format': negative_format<br>    })<\/pre>\n\n\n\n<p>If you are running these codes from within Django then make sure your <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-django-version-in-python\/\">Django version<\/a> supports these features.<\/p>\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 easily export Python data to Excel spreadsheets, using Pandas library. We learnt how to export a single dataframe to a spreadsheet. We also learnt how to export multiple dataframes to multiple sheets in a single workbook. We learnt how to format Excel data from Python itself, using Pandas library. For all these purposes, using to_excel() function along with ExcelWriter class is the key.<\/p>\n\n\n\n<p>Also read:<\/p>\n\n\n\n<p><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-find-duplicates-in-python-pandas-dataframe\/\">How to Find Duplicates in Python Pandas Dataframe<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-merge-and-join-pandas-dataframes\/\">How to Merge &amp; Join Pandas Dataframe<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-pivot-tables-in-python-pandas\/\">How to Create Pivot Tables in Python Pandas<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python developers need to export data to Excel workbooks. Here is how to write Pandas dataframe to Excel spreadsheets.<\/p>\n","protected":false},"author":1,"featured_media":8320,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[301],"tags":[425],"class_list":["post-8304","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-excel-spreadsheets"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Write Pandas Dataframe to Excel Spreadsheets - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Python developers need to export data to Excel workbooks. Here is how to write Pandas dataframe to Excel spreadsheets.\" \/>\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-write-pandas-dataframe-to-excel-spreadsheets\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Write Pandas Dataframe to Excel Spreadsheets - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Python developers need to export data to Excel workbooks. Here is how to write Pandas dataframe to Excel spreadsheets.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/\" \/>\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-05-20T07:08:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-08T04:31:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/05\/export-dataframe-to-excel-spreadsheets.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"280\" \/>\n\t<meta property=\"og:image:height\" content=\"187\" \/>\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-write-pandas-dataframe-to-excel-spreadsheets\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Write Pandas Dataframe to Excel Spreadsheets\",\"datePublished\":\"2025-05-20T07:08:00+00:00\",\"dateModified\":\"2025-08-08T04:31:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/\"},\"wordCount\":607,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/05\/export-dataframe-to-excel-spreadsheets.jpg?fit=280%2C187&ssl=1\",\"keywords\":[\"excel spreadsheets\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/\",\"name\":\"How to Write Pandas Dataframe to Excel Spreadsheets - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/05\/export-dataframe-to-excel-spreadsheets.jpg?fit=280%2C187&ssl=1\",\"datePublished\":\"2025-05-20T07:08:00+00:00\",\"dateModified\":\"2025-08-08T04:31:43+00:00\",\"author\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Python developers need to export data to Excel workbooks. Here is how to write Pandas dataframe to Excel spreadsheets.\",\"breadcrumb\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/05\/export-dataframe-to-excel-spreadsheets.jpg?fit=280%2C187&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/05\/export-dataframe-to-excel-spreadsheets.jpg?fit=280%2C187&ssl=1\",\"width\":280,\"height\":187,\"caption\":\"write pandas dataframe to excel spreadsheet\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ubiq.co\/tech-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Write Pandas Dataframe to Excel Spreadsheets\"}]},{\"@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 Write Pandas Dataframe to Excel Spreadsheets - Ubiq BI","description":"Python developers need to export data to Excel workbooks. Here is how to write Pandas dataframe to Excel spreadsheets.","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-write-pandas-dataframe-to-excel-spreadsheets\/","og_locale":"en_US","og_type":"article","og_title":"How to Write Pandas Dataframe to Excel Spreadsheets - Ubiq BI","og_description":"Python developers need to export data to Excel workbooks. Here is how to write Pandas dataframe to Excel spreadsheets.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2025-05-20T07:08:00+00:00","article_modified_time":"2025-08-08T04:31:43+00:00","og_image":[{"width":280,"height":187,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/05\/export-dataframe-to-excel-spreadsheets.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-write-pandas-dataframe-to-excel-spreadsheets\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Write Pandas Dataframe to Excel Spreadsheets","datePublished":"2025-05-20T07:08:00+00:00","dateModified":"2025-08-08T04:31:43+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/"},"wordCount":607,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/05\/export-dataframe-to-excel-spreadsheets.jpg?fit=280%2C187&ssl=1","keywords":["excel spreadsheets"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/","name":"How to Write Pandas Dataframe to Excel Spreadsheets - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/05\/export-dataframe-to-excel-spreadsheets.jpg?fit=280%2C187&ssl=1","datePublished":"2025-05-20T07:08:00+00:00","dateModified":"2025-08-08T04:31:43+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Python developers need to export data to Excel workbooks. Here is how to write Pandas dataframe to Excel spreadsheets.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/05\/export-dataframe-to-excel-spreadsheets.jpg?fit=280%2C187&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/05\/export-dataframe-to-excel-spreadsheets.jpg?fit=280%2C187&ssl=1","width":280,"height":187,"caption":"write pandas dataframe to excel spreadsheet"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-write-pandas-dataframe-to-excel-spreadsheets\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Write Pandas Dataframe to Excel Spreadsheets"}]},{"@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\/05\/export-dataframe-to-excel-spreadsheets.jpg?fit=280%2C187&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-29W","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8304","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=8304"}],"version-history":[{"count":18,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8304\/revisions"}],"predecessor-version":[{"id":8956,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8304\/revisions\/8956"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/8320"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=8304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=8304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=8304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}