{"id":977,"date":"2020-07-27T07:00:00","date_gmt":"2020-07-27T04:00:00","guid":{"rendered":"https:\/\/www.dataplatform.gr\/?p=977"},"modified":"2026-03-23T17:34:35","modified_gmt":"2026-03-23T14:34:35","slug":"pivoting-sto-microsoft-excel-me-ti-chrisi-python","status":"publish","type":"post","link":"https:\/\/www.dataplatform.gr\/en\/pivoting-to-microsoft-excel-me-ti-chrisi-python\/","title":{"rendered":"Pivoting in Microsoft Excel using Python"},"content":{"rendered":"<p>In an earlier article we have seen the possibilities to perform Excel functions such as vlookup through Python. In this article we will see how we can perform pivoting through Python. <\/p>\n\n\n\n<p>We will analyze ways so that we can find information such as, which customer made the most expensive purchases or the total amount spent on each product, etc.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Let&#039;s see the steps one by one starting with the resources.<\/h4>\n\n\n\n<p>We have an Excel file with the total sales named sales.xlsx.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"410\" height=\"453\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1-pp.png\" alt=\"\" class=\"wp-image-979\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1-pp.png 410w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1-pp-272x300.png 272w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><\/figure>\n\n\n\n<p>There is a second Excel file with the customer names called pelates.xlsx.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"465\" height=\"384\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/2-pp.png\" alt=\"\" class=\"wp-image-980\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/2-pp.png 465w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/2-pp-300x248.png 300w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/figure>\n\n\n\n<p>Apart from having Python installed, we will need the following libraries which are easily installed by running the following commands in the command prompt.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">pip install xlrd\npip install pandas\npip install numpy\npip install openpyxl<\/pre>\n\n\n\n<p>We import the libraries.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">import pandas as pd\nimport numpy as np<\/pre>\n\n\n\n<p>We fill 2 dataframe variables with the records of each Excel. With the sheet_name parameter we can also choose the gender where the data is located.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_pelates = pd.read_excel('pelates.xlsx',sheet_name='Sheet1')\n\ndf_sales = pd.read_excel('sales.xlsx',sheet_name='Sheet1')<\/pre>\n\n\n\n<p>We should rename the id field to customer_id so that it has the same name as it has in the sales dataframe.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_pelates.rename(columns={'id':'customer_id'}, inplace=True)<\/pre>\n\n\n\n<p>In this step the&nbsp;<strong>vlookup<\/strong>, we merge both dataframes into a new one (df_final) in the customer_id field. In the how parameter we declare the way it will be done&nbsp;<strong>join<\/strong>&nbsp;as in SQL we have options left, right, outer, inner.<\/p>\n\n\n\n<p>By choice&nbsp;<strong>right<\/strong>&nbsp;we declare that we want all the records from the second dataframe, linking to those linked to the first<\/p>\n\n\n\n<p>If there is no common customer_id it will have the value NaN\/Null or else the blank.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_final = pd.merge(df_pelates, df_sales, on='customer_id', how='right')<\/pre>\n\n\n\n<p>Let&#039;s see the fields that the merged dataframe now has.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">print(df_final.columns)<\/pre>\n\n\n\n<p>We can also choose which fields of these to keep.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_final = df_final[['onoma','epitheto','eidos','posotita','kostos']]<\/pre>\n\n\n\n<p>The result so far is this.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">print(df_final)<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"568\" height=\"192\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_1-pp.png\" alt=\"\" class=\"wp-image-1241\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_1-pp.png 568w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_1-pp-300x101.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/figure>\n\n\n\n<p>Now calculate the actual cost spent with each purchase by multiplying the quantity by the cost.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_final['kostos_agoras'] = df_final['posotita']*df_final['kostos']<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"619\" height=\"190\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_2-pp.png\" alt=\"\" class=\"wp-image-1242\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_2-pp.png 619w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_2-pp-300x92.png 300w\" sizes=\"auto, (max-width: 619px) 100vw, 619px\" \/><\/figure>\n\n\n\n<p>At this moment, however, we do not know how much money each customer has consumed. We can easily with one line of code group by customer and have the total cost for each.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_final = df_final.groupby(['customer_id','epitheto','onoma'],as_index=False).sum()<\/pre>\n\n\n\n<p>Let&#039;s rename the sum field to &quot;Total Purchases&quot;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_final.rename(columns={'kostos_agoras':'Sinolikes_agores'}, inplace=True)<\/pre>\n\n\n\n<p>Let&#039;s see what we did.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_final = df_final[['onoma','epitheto','Sinolikes_agores']]\n\nprint(df_final)\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"321\" height=\"74\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_3-pp.png\" alt=\"\" class=\"wp-image-1243\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_3-pp.png 321w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_3-pp-300x69.png 300w\" sizes=\"auto, (max-width: 321px) 100vw, 321px\" \/><\/figure>\n\n\n\n<p>We can instead of sum use another function like max to find the maximum purchase made by the customer.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_final = df_final.groupby(['customer_id','epitheto','onoma'],as_index=False).max()\ndf_final.rename(columns={'kostos_agoras':'Megisti_agora'}, inplace=True)\ndf_final = df_final[['onoma','epitheto','Megisti_agora']]\n\nprint(df_final)<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"291\" height=\"66\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_4-pp.png\" alt=\"\" class=\"wp-image-1244\"\/><\/figure>\n\n\n\n<p>We can count how many purchases each customer has made (count).<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_final = df_final.groupby(['customer_id','epitheto','onoma'],as_index=False).count()\ndf_final.rename(columns={'kostos_agoras':'plithos_agorwn'}, inplace=True)\ndf_final = df_final[['onoma','epitheto','plithos_agorwn']]<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"301\" height=\"69\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_5-pp.png\" alt=\"\" class=\"wp-image-1239\"\/><\/figure>\n\n\n\n<p>We can group by product.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_final = df_final.groupby(['eidos'],as_index=False).sum()\ndf_final = df_final[['eidos','kostos_agoras']]\n\nprint(df_final)<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"253\" height=\"90\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1_6-pp.png\" alt=\"\" class=\"wp-image-1240\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Final result<\/h4>\n\n\n\n<p>Finally we can save the results in a new Excel file.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">df_final.to_excel('pivoting_with_python.xlsx', index=False)<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"472\" height=\"368\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/3-pp.png\" alt=\"\" class=\"wp-image-978\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/3-pp.png 472w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/3-pp-300x234.png 300w\" sizes=\"auto, (max-width: 472px) 100vw, 472px\" \/><\/figure>","protected":false},"excerpt":{"rendered":"<p>In an earlier article we have seen the possibilities to perform Excel functions such as vlookup through Python. In this article we will see how we can perform pivoting through Python. We will analyze ways so that we can find information such as, which customer made the most expensive purchases or the total amount spent on each [...]<\/p>","protected":false},"author":1,"featured_media":694,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,13,17,14],"tags":[24,43,38,92,9],"class_list":["post-977","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-business-intelligence","category-datascience_ai","category-ms-excel","category-python","tag-data-analysis","tag-microsoft-excel","tag-office-365","tag-programming","tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Pivoting \u03c3\u03c4\u03bf Microsoft Excel \u03bc\u03b5 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 Python - DataPlatform.gr<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dataplatform.gr\/en\/pivoting-to-microsoft-excel-me-ti-chrisi-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pivoting \u03c3\u03c4\u03bf Microsoft Excel \u03bc\u03b5 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 Python - DataPlatform.gr\" \/>\n<meta property=\"og:description\" content=\"\u03a3\u03b5 \u03c0\u03b1\u03bb\u03b1\u03b9\u03cc\u03c4\u03b5\u03c1\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03b4\u03b5\u03b9 \u03c4\u03b9\u03c2 \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc\u03c4\u03b7\u03c4\u03b5\u03c2 \u03bd\u03b1 \u03c0\u03c1\u03b1\u03b3\u03bc\u03b1\u03c4\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 functions \u03c4\u03bf\u03c5 Excel \u03cc\u03c0\u03c9\u03c2 \u03b7 vlookup \u03bc\u03ad\u03c3\u03c9 Python. \u03a3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b8\u03b1 \u03b4\u03bf\u03cd\u03bc\u03b5 \u03c0\u03c9\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c0\u03c1\u03b1\u03b3\u03bc\u03b1\u03c4\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 pivoting \u03bc\u03ad\u03c3\u03c9 Python. \u0398\u03b1 \u03b1\u03bd\u03b1\u03bb\u03cd\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03c1\u03cc\u03c0\u03bf\u03c5\u03c2 \u03ce\u03c3\u03c4\u03b5 \u03bd\u03b1 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b2\u03c1\u03bf\u03cd\u03bc\u03b5 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b1 \u03cc\u03c0\u03c9\u03c2, \u03c0\u03bf\u03b9\u03bf\u03c2 \u03c0\u03b5\u03bb\u03ac\u03c4\u03b7\u03c2 \u03ad\u03ba\u03b1\u03bd\u03b5 \u03c4\u03b9\u03c2 \u03b1\u03ba\u03c1\u03b9\u03b2\u03cc\u03c4\u03b5\u03c1\u03b5\u03c2 \u03b1\u03b3\u03bf\u03c1\u03ad\u03c2 \u03ae \u03c4\u03bf \u03c3\u03c5\u03bd\u03bf\u03bb\u03b9\u03ba\u03cc \u03c0\u03bf\u03c3\u03cc \u03c0\u03bf\u03c5 \u03b4\u03b1\u03c0\u03b1\u03bd\u03ae\u03b8\u03b7\u03ba\u03b5 \u03b3\u03b9\u03b1 \u03c4\u03bf \u03ba\u03ac\u03b8\u03b5 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dataplatform.gr\/en\/pivoting-to-microsoft-excel-me-ti-chrisi-python\/\" \/>\n<meta property=\"og:site_name\" content=\"DataPlatform.gr\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dataplatform.gr\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-27T04:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-23T14:34:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_excel_python.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Stratos Matzouranis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stratos Matzouranis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/\"},\"author\":{\"name\":\"Stratos Matzouranis\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\"},\"headline\":\"Pivoting \u03c3\u03c4\u03bf Microsoft Excel \u03bc\u03b5 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 Python\",\"datePublished\":\"2020-07-27T04:00:00+00:00\",\"dateModified\":\"2026-03-23T14:34:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/\"},\"wordCount\":67,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_excel_python.png\",\"keywords\":[\"Data Analysis\",\"Excel\",\"Office 365\",\"Programming\",\"Python\"],\"articleSection\":[\"Business Intelligence\",\"Data Science &amp; Ai\",\"Microsoft Excel\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/\",\"name\":\"Pivoting \u03c3\u03c4\u03bf Microsoft Excel \u03bc\u03b5 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 Python - DataPlatform.gr\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_excel_python.png\",\"datePublished\":\"2020-07-27T04:00:00+00:00\",\"dateModified\":\"2026-03-23T14:34:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_excel_python.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_excel_python.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Business Intelligence\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/business-intelligence\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Microsoft Excel\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/business-intelligence\\\/ms-excel\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Pivoting \u03c3\u03c4\u03bf Microsoft Excel \u03bc\u03b5 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"name\":\"dataplatform.gr - Sky is not the limit!\",\"description\":\"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dataplatform.gr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\",\"name\":\"dataplatform.gr\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"width\":322,\"height\":139,\"caption\":\"dataplatform.gr\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dataplatform.gr\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dataplatform-gr\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\",\"name\":\"Stratos Matzouranis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"caption\":\"Stratos Matzouranis\"},\"sameAs\":[\"https:\\\/\\\/www.dataplatform.gr\"],\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/en\\\/author\\\/stratos-matzouranis\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pivoting \u03c3\u03c4\u03bf Microsoft Excel \u03bc\u03b5 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 Python - DataPlatform.gr","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:\/\/www.dataplatform.gr\/en\/pivoting-to-microsoft-excel-me-ti-chrisi-python\/","og_locale":"en_US","og_type":"article","og_title":"Pivoting \u03c3\u03c4\u03bf Microsoft Excel \u03bc\u03b5 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 Python - DataPlatform.gr","og_description":"\u03a3\u03b5 \u03c0\u03b1\u03bb\u03b1\u03b9\u03cc\u03c4\u03b5\u03c1\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03b4\u03b5\u03b9 \u03c4\u03b9\u03c2 \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc\u03c4\u03b7\u03c4\u03b5\u03c2 \u03bd\u03b1 \u03c0\u03c1\u03b1\u03b3\u03bc\u03b1\u03c4\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 functions \u03c4\u03bf\u03c5 Excel \u03cc\u03c0\u03c9\u03c2 \u03b7 vlookup \u03bc\u03ad\u03c3\u03c9 Python. \u03a3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b8\u03b1 \u03b4\u03bf\u03cd\u03bc\u03b5 \u03c0\u03c9\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c0\u03c1\u03b1\u03b3\u03bc\u03b1\u03c4\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 pivoting \u03bc\u03ad\u03c3\u03c9 Python. \u0398\u03b1 \u03b1\u03bd\u03b1\u03bb\u03cd\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03c1\u03cc\u03c0\u03bf\u03c5\u03c2 \u03ce\u03c3\u03c4\u03b5 \u03bd\u03b1 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b2\u03c1\u03bf\u03cd\u03bc\u03b5 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b1 \u03cc\u03c0\u03c9\u03c2, \u03c0\u03bf\u03b9\u03bf\u03c2 \u03c0\u03b5\u03bb\u03ac\u03c4\u03b7\u03c2 \u03ad\u03ba\u03b1\u03bd\u03b5 \u03c4\u03b9\u03c2 \u03b1\u03ba\u03c1\u03b9\u03b2\u03cc\u03c4\u03b5\u03c1\u03b5\u03c2 \u03b1\u03b3\u03bf\u03c1\u03ad\u03c2 \u03ae \u03c4\u03bf \u03c3\u03c5\u03bd\u03bf\u03bb\u03b9\u03ba\u03cc \u03c0\u03bf\u03c3\u03cc \u03c0\u03bf\u03c5 \u03b4\u03b1\u03c0\u03b1\u03bd\u03ae\u03b8\u03b7\u03ba\u03b5 \u03b3\u03b9\u03b1 \u03c4\u03bf \u03ba\u03ac\u03b8\u03b5 [&hellip;]","og_url":"https:\/\/www.dataplatform.gr\/en\/pivoting-to-microsoft-excel-me-ti-chrisi-python\/","og_site_name":"DataPlatform.gr","article_publisher":"https:\/\/www.facebook.com\/dataplatform.gr\/","article_published_time":"2020-07-27T04:00:00+00:00","article_modified_time":"2026-03-23T14:34:35+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_excel_python.png","type":"image\/png"}],"author":"Stratos Matzouranis","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stratos Matzouranis","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/#article","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/"},"author":{"name":"Stratos Matzouranis","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf"},"headline":"Pivoting \u03c3\u03c4\u03bf Microsoft Excel \u03bc\u03b5 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 Python","datePublished":"2020-07-27T04:00:00+00:00","dateModified":"2026-03-23T14:34:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/"},"wordCount":67,"commentCount":0,"publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_excel_python.png","keywords":["Data Analysis","Excel","Office 365","Programming","Python"],"articleSection":["Business Intelligence","Data Science &amp; Ai","Microsoft Excel","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/","url":"https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/","name":"Pivoting \u03c3\u03c4\u03bf Microsoft Excel \u03bc\u03b5 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 Python - DataPlatform.gr","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/#primaryimage"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_excel_python.png","datePublished":"2020-07-27T04:00:00+00:00","dateModified":"2026-03-23T14:34:35+00:00","breadcrumb":{"@id":"https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/#primaryimage","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_excel_python.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_excel_python.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/www.dataplatform.gr\/pivoting-sto-microsoft-excel-me-ti-chrisi-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae","item":"https:\/\/www.dataplatform.gr\/"},{"@type":"ListItem","position":2,"name":"Business Intelligence","item":"https:\/\/www.dataplatform.gr\/category\/business-intelligence\/"},{"@type":"ListItem","position":3,"name":"Microsoft Excel","item":"https:\/\/www.dataplatform.gr\/category\/business-intelligence\/ms-excel\/"},{"@type":"ListItem","position":4,"name":"Pivoting \u03c3\u03c4\u03bf Microsoft Excel \u03bc\u03b5 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 Python"}]},{"@type":"WebSite","@id":"https:\/\/www.dataplatform.gr\/#website","url":"https:\/\/www.dataplatform.gr\/","name":"dataplatform.gr - Sky is not the limit!","description":"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.","publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dataplatform.gr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dataplatform.gr\/#organization","name":"dataplatform.gr","url":"https:\/\/www.dataplatform.gr\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","width":322,"height":139,"caption":"dataplatform.gr"},"image":{"@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dataplatform.gr\/","https:\/\/www.linkedin.com\/company\/dataplatform-gr\/"]},{"@type":"Person","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf","name":"Stratos Matzouranis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","caption":"Stratos Matzouranis"},"sameAs":["https:\/\/www.dataplatform.gr"],"url":"https:\/\/www.dataplatform.gr\/en\/author\/stratos-matzouranis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/comments?post=977"}],"version-history":[{"count":2,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/977\/revisions"}],"predecessor-version":[{"id":5892,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/977\/revisions\/5892"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media\/694"}],"wp:attachment":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media?parent=977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/categories?post=977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/tags?post=977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}