From d35a03742ae1c9e723a82e003e998d197f271952 Mon Sep 17 00:00:00 2001 From: Ankita434 <72227671+Ankita434@users.noreply.github.com> Date: Sun, 4 Oct 2020 01:32:28 +0530 Subject: [PATCH] Update Assignment+3.py Question 9 error correction --- Assignment+3.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Assignment+3.py b/Assignment+3.py index a044ed1..ba1fc13 100644 --- a/Assignment+3.py +++ b/Assignment+3.py @@ -249,6 +249,18 @@ def answer_nine(): answer_nine() +//'float' object has no attribute 'shape' this error is coming while running it +//so you could use this instead +// +def answer_nine(): + Top15 = answer_one() + Top15['Population Estimate'] = Top15['Energy Supply']/Top15['Energy Supply per Capita'] + Top15['Citable Documents per Capita'] = Top15['Citable documents']/Top15['Population Estimate'] + Top15['Citable Documents per Capita'] = Top15['Citable Documents per Capita'].astype(float) + Top15['Energy Supply per Capita'] = Top15['Energy Supply per Capita'].astype(float) + return Top15['Citable Documents per Capita'].corr(Top15['Energy Supply per Capita']) +answer_nine() + # In[49]: