Problems on Data Cleaning and Processing For Machine Learning

6 / 12

Finding versions of the installed libraries

John is working on a Machine Learning project where he has some specific requirements, one of them being that the Numpy and Pandas library installed in the system needs to be of a specific version.

You need to help John find the Numpy and Pandas version installed.

INSTRUCTIONS
  • Write a function check_ver
  • The function should accept a parameter instance
  • The function should check the version of this parameter instance
  • The function should return the version
  • The function should not print the version
  • Makesure to import numpy as np and pandas as pd.
  • Use this function to calculate the version of Numpy installed
  • Use this function to calculate the version of Pandas installed
  • Use the Jupyter notebook given on the right side of the split screen to write your code and execute it
  • Once done, click on the Submit Answer button given above
See Answer

No hints are availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Please login to comment

12 Comments

Hi the code I wrote is correct but the test case seems outdated. The np version as per my notebook is '1.19.5' but the test case is checking for '1.16.4'. Please check that.

  Upvote    Share

Hi Janhavi,

Thanks for bringing this to our notice. We have fixed it.

  Upvote    Share

def check_ver(instance):
    ver = instance.__version__
    return ver

import numpy as np
check_ver(np)

import pandas as pd
check_ver(pd)

 

'0.25.1'

 

what is the error here

  Upvote    Share

def check_ver(instance):
    return instance.__version__

 

print(check_ver(pd))
print(check_ver(np))

When I submit the above code I am getting error in test case :type(check_ver)

type(check_ver) which is printing the following answer in my code:
function
  Upvote    Share

This comment has been removed.

check_ver is function so it will print function only.

  Upvote    Share

My code is also printing 'function' when I check type(check _ver).  Then also am not able to submit the code.

  Upvote    Share

Please check the instructions. We are supposed to return version and not type 

  Upvote    Share

Sir you please check my code. My function-check_version  is returning version. But when I submit code it is giving error in test case 'type(check_version)' is not returning function. So I have checked type(check_version) in my code which is also returning function. 

 

  Upvote    Share

Please follow these steps if you are facing any challenges with the assessment engine https://discuss.cloudxlab.com/t/im-having-problem-with-assessment-engine-how-should-i-fix/3734

  Upvote    Share

The code is pretty simple and I have matched it with solution provided by cloudaxlab also.  There is no issues related to assessment engine also. 

This type of problem is occuring in some other questions also ( in this module- Mains solutions). I think results of assessment exam also had little issues because of these problems. 

  Upvote    Share

Hi,

Could you please elaborate on the prblem and attach the screenshot if you are still facing an issue?

Thanks.

  Upvote    Share