Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Date,Series,Admin,Mining,CPI
- 1990,Ordinary Time Earnings,20,30,96
- 1991,Ordinary Time Earnings,22,33,100
- 1990,Total Earnings,25,38,96
- 1991,Total Earnings,29,43,100
- d3.csv("avgearnings_v1_1.csv", function(error, data) {
- if (error) throw error;
- OrdinaryTimeEarnings = data
- .filter(function(d) {
- if(d.Series == 'Ordinary Time Earnings')
- return d;
- });
- TotalEarnings = data
- .filter(function(d) {
- if(d.Series == "Total Earnings")
- return d;
- });
- OrdinaryTimeEarningsReal = OrdinaryTimeEarnings;
- TotalEarningsReal = TotalEarnings;
- OrdinaryTimeEarningsReal
- .forEach(function (z,i) {
- var CPI = z["CPI"];
- d3.map(z, function(b) {return b;})
- .forEach(function (c) {
- if(c !== "Date" && c !== "Series" && c !== "CPI" )
- OrdinaryTimeEarningsReal[i][c] = ((z[c])/(CPI))*100;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement