Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python 3 computer science Please check this following code. HELP!!!!!!!! Python import pandas as pd datapath = 'Eur_pop_rev.csv' '''NOTES Note for changes made in excel

image text in transcribed

Python 3

computer science

Please check this following code.

HELP!!!!!!!!

Python

import pandas as pd datapath = 'Eur_pop_rev.csv'

'''NOTES Note for changes made in excel file: ***renamed the countries column head as "Countries"

''' countries_df = pd.read_csv(datapath, sep=',', header=2, nrows=17,index_col='Countries')

print('Number of rows and columns:', countries_df.shape ) print('Type of values', countries_df.dtypes)

print('Column Labels', countries_df.columns.values.tolist()) print('Row Labels', countries_df.index.values.tolist())

#replace missing data with 0 print (countries_df.fillna(0))

#print each country that has more than 1,000,000 people in 1995

A = countries_df.loc[countries_df['01.01.95'] > 1000000] print ("country that has more than 1,000,000 people in 1995", A.loc[:,'01.01.95':])

#print the average population in the United Kingdom over those 7 years

average_UK = (countries_df.loc['United Kingdom']).mean()

print ('Average population for United Kingdom over those 7 years', ':',average_UK)

************Tell me the error and the output!!*********

1 European Population (1989-1995) 01.01.89 01.01.90 0101.901.01.92 01.01.93 01.01.94 01.01.95 4 Austria 7602431 7660345 77909577860800 7909575 79436528054800 5 Belgium 9927600 9947800 9987000 10068319 10100631 0130574 10143047 6 Denmark 51298005135400 5146500 5162100 5180614 5191000 5251027 7 Finland 4954359 4974383 4998478 5029300 5054982 5098754 5116800 8 France 56269800 9 Germany 61715000 62678000 79753000 80238000 81338000 81353000 81845000 10 Iceland 11 Ireland 12 Italy 13 Luxembur 374900 379300 384400 389800395200 400000 412800 14 Netherlanc 14805240 14892574 15010445 15129200 15354000 15341553 15492800 15 Norway 16 Portugal 10304700 17 Spain 18 Sweden 84588908527040 8590630 86441008700000 8749000 8837000 19 Switzerlan 6619973 6673850 6750693 6831900 6871500 7021200 7060400 20 United Kin 57236200 57410600 57649200 58888800 58191230 58380000 58684000 21 22 Total Euro 3.26E+08 3.27E+08 3.45E+08 3.48E+08 3.49E+08 3.49E+08 3.73E+08 23 24 Sources: Eurostat, national agencies 56893000 57217500 57529577 57847000 58265400 53500 255708259577262193 264922 266783 267806 3526600 3505500 3519000 3542000 3559985 3570700 3591200 57504700 57576400 57746200 57788200 57114161 57201800 57268578 4226901 4241473 4261930 4273634 4324577 4348410 4370000 9858500 9846000 9987500 9776000 9920800 38851900 38924500 38993800 39055900 39790955 39177400 39241900 1 European Population (1989-1995) 01.01.89 01.01.90 0101.901.01.92 01.01.93 01.01.94 01.01.95 4 Austria 7602431 7660345 77909577860800 7909575 79436528054800 5 Belgium 9927600 9947800 9987000 10068319 10100631 0130574 10143047 6 Denmark 51298005135400 5146500 5162100 5180614 5191000 5251027 7 Finland 4954359 4974383 4998478 5029300 5054982 5098754 5116800 8 France 56269800 9 Germany 61715000 62678000 79753000 80238000 81338000 81353000 81845000 10 Iceland 11 Ireland 12 Italy 13 Luxembur 374900 379300 384400 389800395200 400000 412800 14 Netherlanc 14805240 14892574 15010445 15129200 15354000 15341553 15492800 15 Norway 16 Portugal 10304700 17 Spain 18 Sweden 84588908527040 8590630 86441008700000 8749000 8837000 19 Switzerlan 6619973 6673850 6750693 6831900 6871500 7021200 7060400 20 United Kin 57236200 57410600 57649200 58888800 58191230 58380000 58684000 21 22 Total Euro 3.26E+08 3.27E+08 3.45E+08 3.48E+08 3.49E+08 3.49E+08 3.73E+08 23 24 Sources: Eurostat, national agencies 56893000 57217500 57529577 57847000 58265400 53500 255708259577262193 264922 266783 267806 3526600 3505500 3519000 3542000 3559985 3570700 3591200 57504700 57576400 57746200 57788200 57114161 57201800 57268578 4226901 4241473 4261930 4273634 4324577 4348410 4370000 9858500 9846000 9987500 9776000 9920800 38851900 38924500 38993800 39055900 39790955 39177400 39241900

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions