Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

importing numpy in hackerrank competitions

Tags:

python

numpy

I want to use numpy module for solving problems on hackerrank. But, when I imported numpy, it gave me the following error.

ImportError: No module named 'numpy'.

I understand that this might be a very trivial question. But, I am a beginner in programming. Any help is highly appreciated.

like image 541
Abhijit Avatar asked Jul 08 '17 06:07

Abhijit


People also ask

Can you import NumPy in HackerRank?

Either import numpy or the idiomatic import numpy as np will work just fine on those. I believe you're simply trying to use numpy where they don't want you to. Because it's not part of the standard library, HackerRank would need to intentionally provide it.

Is NumPy not allowed in HackerRank?

Hi Joseduc01 At this point of time, specialized libraries like Numpy, Scipy and Sklearn are only permitted for certain problems and tracks like the Machine learning track, where they are really required.

Can you import packages in HackerRank?

Overview. You can now import Project questions (Front-End, Back-End, Full-Stack) inside a HackerRank interview. With this feature, interviewers can assess candidates on skills such as React, Angular, Node, and so on, during live interviews.


1 Answers

I have run into the same issue on HackerRank. A number of their challenges do support NumPy--indeed, a handful require it. Either import numpy or the idiomatic import numpy as np will work just fine on those.

I believe you're simply trying to use numpy where they don't want you to. Because it's not part of the standard library, HackerRank would need to intentionally provide it. Where they do not, you will need to substitute lower-level, non-numpy code as a result.

like image 150
Jonathan Eunice Avatar answered Oct 07 '22 03:10

Jonathan Eunice