Python script for how much total salary cost has increased

0 votes

I have salaries in a csv file along with name, year and other details. How to Compute how much total salary cost has increased from year 2011 to 2014?

Feb 13, 2019 in Python by Himmi

1 answer to this question.

+1 vote

Here you can use groupby() and mean() to get the desired results.

Please try with the below sample code and check.

import pandas as pd

import matplotlib.pyplot as plt




mean_year = data.groupby('Year').mean()['TotalPay']

print ( mean_year)
answered Feb 13, 2019 by Umar

Related Questions In Python

0 votes
1 answer

How to make python script pause for sometime?

You can use the sleep method from the ...READ MORE

answered Apr 4, 2019 in Python by Hrishi
0 votes
1 answer

How to write a python script for downloading a video from YouTube and saving it to a directory?

First download pytube using the following code  pip ...READ MORE

answered Sep 4, 2019 in Python by Neel
• 3,020 points
0 votes
1 answer
0 votes
1 answer

How can I check for NaN in Python?

math.isnan() Checks if the float x is a ...READ MORE

answered Aug 16, 2018 in Python by Priyaj
• 58,140 points
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,364 views
0 votes
0 answers
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
0 votes
1 answer