{"id":6778,"date":"2021-05-24T08:49:14","date_gmt":"2021-05-24T03:19:14","guid":{"rendered":"https:\/\/python-programs.com\/?p=6778"},"modified":"2021-11-22T18:53:39","modified_gmt":"2021-11-22T13:23:39","slug":"pandas-sum-rows-in-dataframe-all-or-certain-rows","status":"publish","type":"post","link":"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/","title":{"rendered":"Pandas: Sum rows in Dataframe ( all or certain rows)"},"content":{"rendered":"

Sum rows in Dataframe ( all or certain rows) in Python<\/h2>\n

In this article we will discuss how we can merge rows into a dataframe and add values \u200b\u200bas a new queue to the same dataframe.<\/p>\n

So, let’s start exploring the topic.<\/p>\n

First, we will build a Dataframe,<\/p>\n

import pandas as pd\r\nimport numpy as np\r\n# The List of Tuples\r\nsalary_of_employees = [('Amit', 2000, 2050, 1099, 2134, 2111),\r\n                    ('Rabi', 2122, 3022, 3456, 3111, 2109),\r\n                    ('Abhi', np.NaN, 2334, 2077, np.NaN, 3122),\r\n                    ('Naresh', 3050, 3050, 2010, 2122, 1111),\r\n                    ('Suman', 2023, 2232, 3050, 2123, 1099),\r\n                    ('Viroj', 2050, 2510, np.NaN, 3012, 2122),\r\n                    ('Nabin', 4000, 2000, 2050, np.NaN, 2111)]\r\n# By Creating a DataFrame object from list of tuples\r\ntest = pd.DataFrame(salary_of_employees,\r\n                  columns=['Name',  'Jan', 'Feb', 'March', 'April', 'May'])\r\n# To Set column Name as the index of dataframe\r\ntest.set_index('Name', inplace=True)\r\nprint(test)\r\n<\/pre>\n
Output :\r\n             Jan           Feb        March    April         May\r\nName \r\nAmit     2000.0     2050       1099.0    2134.0     2111\r\nRabi      2122.0    3022       3456.0     3111.0    2109\r\nAbhi      NaN       2334       2077.0     NaN       3122\r\nNaresh  3050.0     3050      2010.0     2122.0    1111\r\nSuman  2023.0     2232      3050.0     2123.0    1099\r\nViroj     2050.0     2510       NaN        3012.0    2122\r\nNabin   4000.0    2000       2050.0     NaN        2111<\/pre>\n

This Dataframe contains employee salaries from January to May. We’ve created a column name as a data name index. Each line of this dataframe contains the employee’s salary from January to May.<\/p>\n

Get the sum of all rows in a Pandas Dataframe :<\/h3>\n

Let\u2019s say in the above dataframe, we want to get details about the total salary paid each month. Basically, we want a Series that contains the total number of rows and columns eg. each item in the Series should contain a total column value.<\/p>\n

Let’s see how we can find that series,<\/p>\n

import pandas as pd\r\nimport numpy as np\r\n# The List of Tuples\r\nsalary_of_employees = [('Amit', 2000, 2050, 1099, 2134, 2111),\r\n                    ('Rabi', 2122, 3022, 3456, 3111, 2109),\r\n                    ('Abhi', np.NaN, 2334, 2077, np.NaN, 3122),\r\n                    ('Naresh', 3050, 3050, 2010, 2122, 1111),\r\n                    ('Suman', 2023, 2232, 3050, 2123, 1099),\r\n                    ('Viroj', 2050, 2510, np.NaN, 3012, 2122),\r\n                    ('Nabin', 4000, 2000, 2050, np.NaN, 2111)]\r\n# By Creating a DataFrame object from list of tuples\r\ntest = pd.DataFrame(salary_of_employees,\r\n                  columns=['Name',  'Jan', 'Feb', 'March', 'April', 'May'])\r\n# To Set column Name as the index of dataframe\r\ntest.set_index('Name', inplace=True)\r\n\r\n\r\n#By getting sum of all rows in the Dataframe as a Series\r\ntotal = test.sum()\r\nprint('Total salary paid in each month:')\r\nprint(total)<\/pre>\n
Output :\r\nTotal salary paid in each month:\r\nJan 15245.0\r\nFeb 17198.0\r\nMarch 13742.0\r\nApril 12502.0\r\nMay 13785.0\r\ndtype: float64<\/pre>\n

We have called the sum()<\/code> function in dataframe without parameter. So, it automatically considered the axis as 0 and added all the columns wisely i.e. added all values \u200b\u200bto each column and returned a string item containing those values. Each item in this series item contains the total amount paid in monthly installments and the name of the month in the index label for that entry.<\/p>\n

We can add this Series as a new line to the dataframe i.e.<\/p>\n

import pandas as pd\r\nimport numpy as np\r\n# The List of Tuples\r\nsalary_of_employees = [('Amit', 2000, 2050, 1099, 2134, 2111),\r\n                    ('Rabi', 2122, 3022, 3456, 3111, 2109),\r\n                    ('Abhi', np.NaN, 2334, 2077, np.NaN, 3122),\r\n                    ('Naresh', 3050, 3050, 2010, 2122, 1111),\r\n                    ('Suman', 2023, 2232, 3050, 2123, 1099),\r\n                    ('Viroj', 2050, 2510, np.NaN, 3012, 2122),\r\n                    ('Nabin', 4000, 2000, 2050, np.NaN, 2111)]\r\n# By Creating a DataFrame object from list of tuples\r\ntest = pd.DataFrame(salary_of_employees,\r\n                  columns=['Name',  'Jan', 'Feb', 'March', 'April', 'May'])\r\n# To Set column Name as the index of dataframe\r\ntest.set_index('Name', inplace=True)\r\n\r\n\r\n\r\n\r\n# By getting sum of all rows as a new row in Dataframe\r\ntotal = test.sum()\r\ntotal.name = 'Total'\r\n# By assignimg sum of all rows of DataFrame as a new Row\r\ntest = test.append(total.transpose())\r\nprint(test)<\/pre>\n
Output :\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Jan\u00a0 \u00a0 \u00a0 \u00a0 Feb\u00a0 \u00a0 \u00a0 \u00a0 \u00a0March\u00a0 \u00a0 \u00a0 \u00a0 \u00a0April\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 May\r\nName \r\nAmit\u00a0 \u00a0 \u00a0 \u00a0 2000.0\u00a0 \u00a02050.0\u00a0 \u00a0 1099.0\u00a0 \u00a0 \u00a0 \u00a0 2134.0\u00a0 \u00a0 \u00a02111.0\r\nRabi\u00a0 \u00a0 \u00a0 \u00a0 2122.0\u00a0 \u00a0 3022.0\u00a0 \u00a0 3456.0\u00a0 \u00a0 \u00a0 \u00a03111.0\u00a0 \u00a0 \u00a02109.0\r\nAbhi\u00a0 \u00a0 \u00a0 \u00a0NaN\u00a0 \u00a0 \u00a0 \u00a02334.0\u00a0 \u00a0 \u00a02077.0\u00a0 \u00a0 \u00a0 \u00a0NaN\u00a0 \u00a0 \u00a0 \u00a0 3122.0\r\nNaresh\u00a0 \u00a03050.0\u00a0 \u00a0 3050.0\u00a0 \u00a0 \u00a02010.0\u00a0 \u00a0 \u00a0 \u00a02122.0\u00a0 \u00a0 1111.0\r\nSuman\u00a0 \u00a0 2023.0\u00a0 \u00a02232.0\u00a0 \u00a0 \u00a03050.0\u00a0 \u00a0 \u00a0 \u00a02123.0\u00a0 \u00a0 1099.0\r\nViroj\u00a0 \u00a0 \u00a0 2050.0\u00a0 \u00a0 \u00a02510.0\u00a0 \u00a0 \u00a0NaN\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 3012.0\u00a0 \u00a0 \u00a02122.0\r\nNabin\u00a0 \u00a0 4000.0\u00a0 \u00a0 2000.0\u00a0 \u00a0 \u00a02050.0\u00a0 \u00a0 \u00a0 \u00a0NaN\u00a0 \u00a0 \u00a0 \u00a0 \u00a02111.0\r\nTotal\u00a0 \u00a0 \u00a015245.0\u00a0 \u00a017198.0\u00a0 \u00a013742.0\u00a0 \u00a0 12502.0\u00a0 \u00a0 13785.0<\/pre>\n

Added a new line to the dataframe and \u2018Total\u2019 reference label. Each entry in this line contains the amount of details paid per month.<\/p>\n

How did it work?<\/h4>\n

We have passed the Series to create a Dataframe in one line. All references in the series became columns in the new dataframe. Then add this new data name to the original dataframe. The result was that I added a new line to the dataframe.<\/p>\n

Get Sum of certain rows in Dataframe by row numbers :<\/h3>\n

In the previous example we added all the rows of data but what if we want to get a total of only a few rows of data? As with the data above we want the total value in the top 3 lines eg to get the total monthly salary for only 3 employees from the top,<\/p>\n

import pandas as pd\r\nimport numpy as np\r\n# The List of Tuples\r\nsalary_of_employees = [('Amit', 2000, 2050, 1099, 2134, 2111),\r\n                    ('Rabi', 2122, 3022, 3456, 3111, 2109),\r\n                    ('Abhi', np.NaN, 2334, 2077, np.NaN, 3122),\r\n                    ('Naresh', 3050, 3050, 2010, 2122, 1111),\r\n                    ('Suman', 2023, 2232, 3050, 2123, 1099),\r\n                    ('Viroj', 2050, 2510, np.NaN, 3012, 2122),\r\n                    ('Nabin', 4000, 2000, 2050, np.NaN, 2111)]\r\n# By Creating a DataFrame object from list of tuples\r\ntest = pd.DataFrame(salary_of_employees,\r\n                  columns=['Name',  'Jan', 'Feb', 'March', 'April', 'May'])\r\n# To Set column Name as the index of dataframe\r\ntest.set_index('Name', inplace=True)\r\n\r\n\r\n#By getting sum of values of top 3 DataFrame rows,\r\nsumtabOf = test.iloc[0:3].sum()\r\nprint(sumtabOf)\r\n<\/pre>\n
Output :\r\nJan\u00a0\u00a0\u00a0\u00a0\u00a0 4122.0\r\nFeb\u00a0\u00a0\u00a0\u00a0\u00a0 7406.0\r\nMarch\u00a0\u00a0\u00a0 6632.0\r\nApril\u00a0\u00a0\u00a0 5245.0\r\nMay\u00a0\u00a0\u00a0\u00a0\u00a0 7342.0\r\ndtype: float64<\/pre>\n

We selected the first 3 lines of the data file and called the total () for that. Returns a series containing the total monthly salary paid to selected employees only which means for the first three lines of the actual data list.<\/p>\n

Get the sum of specific rows in Pandas Dataframe by index\/row label :<\/h3>\n

Unlike the previous example, we can select specific lines with the reference label and find the value of values \u200b\u200bin those selected lines only i.e.<\/p>\n

import pandas as pd\r\nimport numpy as np\r\n# The List of Tuples\r\nsalary_of_employees = [('Amit', 2000, 2050, 1099, 2134, 2111),\r\n                    ('Rabi', 2122, 3022, 3456, 3111, 2109),\r\n                    ('Abhi', np.NaN, 2334, 2077, np.NaN, 3122),\r\n                    ('Naresh', 3050, 3050, 2010, 2122, 1111),\r\n                    ('Suman', 2023, 2232, 3050, 2123, 1099),\r\n                    ('Viroj', 2050, 2510, np.NaN, 3012, 2122),\r\n                    ('Nabin', 4000, 2000, 2050, np.NaN, 2111)]\r\n# By Creating a DataFrame object from list of tuples\r\ntest = pd.DataFrame(salary_of_employees,\r\n                  columns=['Name',  'Jan', 'Feb', 'March', 'April', 'May'])\r\n# To Set column Name as the index of dataframe\r\ntest.set_index('Name', inplace=True)\r\n\r\n\r\n# By getting sum of 3 DataFrame rows (selected by index labels)\r\nsumtabOf = test.loc[['Amit', 'Naresh', 'Viroj']].sum()\r\nprint(sumtabOf)\r\n<\/pre>\n
Output :\r\nJan\u00a0\u00a0\u00a0\u00a0\u00a0 7100.0\r\nFeb\u00a0\u00a0\u00a0\u00a0\u00a0 7610.0\r\nMarch\u00a0\u00a0\u00a0 3109.0\r\nApril\u00a0\u00a0\u00a0 7268.0\r\nMay\u00a0\u00a0\u00a0\u00a0\u00a0 5344.0\r\ndtype: float64<\/pre>\n

We have selected 3 lines of data name with the reference label namely ‘Amit’, ‘Naresh’ and ‘Viroj’. We then added the queue values \u200b\u200bfor these selected employees only. Return a series with the total amount of salary paid per month to those selected employees per month only wisely.<\/p>\n

Conclusion:<\/strong><\/p>\n

So in the above cases we found out that to sum the multiple rows given in a dataframe.<\/p>\n","protected":false},"excerpt":{"rendered":"

Sum rows in Dataframe ( all or certain rows) in Python In this article we will discuss how we can merge rows into a dataframe and add values \u200b\u200bas a new queue to the same dataframe. So, let’s start exploring the topic. First, we will build a Dataframe, import pandas as pd import numpy as …<\/p>\n

Pandas: Sum rows in Dataframe ( all or certain rows)<\/span> Read More »<\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[5],"tags":[],"yoast_head":"\nPandas: Sum rows in Dataframe ( all or certain rows) - Python Programs<\/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:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pandas: Sum rows in Dataframe ( all or certain rows) - Python Programs\" \/>\n<meta property=\"og:description\" content=\"Sum rows in Dataframe ( all or certain rows) in Python In this article we will discuss how we can merge rows into a dataframe and add values \u200b\u200bas a new queue to the same dataframe. So, let’s start exploring the topic. First, we will build a Dataframe, import pandas as pd import numpy as … Pandas: Sum rows in Dataframe ( all or certain rows) Read More »\" \/>\n<meta property=\"og:url\" content=\"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Programs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/btechgeeks\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-24T03:19:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-22T13:23:39+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:site\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Satyabrata Jena\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/python-programs.com\/#organization\",\"name\":\"BTech Geeks\",\"url\":\"https:\/\/python-programs.com\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/btechgeeks\/\",\"https:\/\/www.linkedin.com\/in\/btechgeeks\",\"https:\/\/in.pinterest.com\/btechgeek\/\",\"https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg\",\"https:\/\/www.facebook.com\/btechgeeks\",\"https:\/\/twitter.com\/btech_geeks\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"contentUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"width\":350,\"height\":70,\"caption\":\"BTech Geeks\"},\"image\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/python-programs.com\/#website\",\"url\":\"https:\/\/python-programs.com\/\",\"name\":\"Python Programs\",\"description\":\"Python Programs with Examples, How To Guides on Python\",\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/python-programs.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#webpage\",\"url\":\"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/\",\"name\":\"Pandas: Sum rows in Dataframe ( all or certain rows) - Python Programs\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/#website\"},\"datePublished\":\"2021-05-24T03:19:14+00:00\",\"dateModified\":\"2021-11-22T13:23:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/python-programs.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Pandas: Sum rows in Dataframe ( all or certain rows)\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#webpage\"},\"author\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/0f6d731bda7051ce3586f71299f391cd\"},\"headline\":\"Pandas: Sum rows in Dataframe ( all or certain rows)\",\"datePublished\":\"2021-05-24T03:19:14+00:00\",\"dateModified\":\"2021-11-22T13:23:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#webpage\"},\"wordCount\":512,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/0f6d731bda7051ce3586f71299f391cd\",\"name\":\"Satyabrata Jena\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c1bf8033ec357d085f41815bee1625cc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c1bf8033ec357d085f41815bee1625cc?s=96&d=mm&r=g\",\"caption\":\"Satyabrata Jena\"},\"url\":\"https:\/\/python-programs.com\/author\/satyabrata\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pandas: Sum rows in Dataframe ( all or certain rows) - Python Programs","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:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/","og_locale":"en_US","og_type":"article","og_title":"Pandas: Sum rows in Dataframe ( all or certain rows) - Python Programs","og_description":"Sum rows in Dataframe ( all or certain rows) in Python In this article we will discuss how we can merge rows into a dataframe and add values \u200b\u200bas a new queue to the same dataframe. So, let’s start exploring the topic. First, we will build a Dataframe, import pandas as pd import numpy as … Pandas: Sum rows in Dataframe ( all or certain rows) Read More »","og_url":"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/","og_site_name":"Python Programs","article_publisher":"https:\/\/www.facebook.com\/btechgeeks","article_published_time":"2021-05-24T03:19:14+00:00","article_modified_time":"2021-11-22T13:23:39+00:00","twitter_card":"summary_large_image","twitter_creator":"@btech_geeks","twitter_site":"@btech_geeks","twitter_misc":{"Written by":"Satyabrata Jena","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/python-programs.com\/#organization","name":"BTech Geeks","url":"https:\/\/python-programs.com\/","sameAs":["https:\/\/www.instagram.com\/btechgeeks\/","https:\/\/www.linkedin.com\/in\/btechgeeks","https:\/\/in.pinterest.com\/btechgeek\/","https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg","https:\/\/www.facebook.com\/btechgeeks","https:\/\/twitter.com\/btech_geeks"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/","url":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","contentUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","width":350,"height":70,"caption":"BTech Geeks"},"image":{"@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/python-programs.com\/#website","url":"https:\/\/python-programs.com\/","name":"Python Programs","description":"Python Programs with Examples, How To Guides on Python","publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/python-programs.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#webpage","url":"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/","name":"Pandas: Sum rows in Dataframe ( all or certain rows) - Python Programs","isPartOf":{"@id":"https:\/\/python-programs.com\/#website"},"datePublished":"2021-05-24T03:19:14+00:00","dateModified":"2021-11-22T13:23:39+00:00","breadcrumb":{"@id":"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/python-programs.com\/"},{"@type":"ListItem","position":2,"name":"Pandas: Sum rows in Dataframe ( all or certain rows)"}]},{"@type":"Article","@id":"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#article","isPartOf":{"@id":"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#webpage"},"author":{"@id":"https:\/\/python-programs.com\/#\/schema\/person\/0f6d731bda7051ce3586f71299f391cd"},"headline":"Pandas: Sum rows in Dataframe ( all or certain rows)","datePublished":"2021-05-24T03:19:14+00:00","dateModified":"2021-11-22T13:23:39+00:00","mainEntityOfPage":{"@id":"https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#webpage"},"wordCount":512,"commentCount":0,"publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/python-programs.com\/pandas-sum-rows-in-dataframe-all-or-certain-rows\/#respond"]}]},{"@type":"Person","@id":"https:\/\/python-programs.com\/#\/schema\/person\/0f6d731bda7051ce3586f71299f391cd","name":"Satyabrata Jena","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c1bf8033ec357d085f41815bee1625cc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c1bf8033ec357d085f41815bee1625cc?s=96&d=mm&r=g","caption":"Satyabrata Jena"},"url":"https:\/\/python-programs.com\/author\/satyabrata\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/6778"}],"collection":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/comments?post=6778"}],"version-history":[{"count":3,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/6778\/revisions"}],"predecessor-version":[{"id":6976,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/6778\/revisions\/6976"}],"wp:attachment":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/media?parent=6778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/categories?post=6778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/tags?post=6778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}