numpy-wheels | Data Manipulation library
kandi X-RAY | numpy-wheels Summary
kandi X-RAY | numpy-wheels Summary
numpy-wheels
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of numpy-wheels
numpy-wheels Key Features
numpy-wheels Examples and Code Snippets
Community Discussions
Trending Discussions on numpy-wheels
QUESTION
My code contains a for loop with large number of iterations. Within the loop I need to so matrix multiplication and matrix inverse (normally a matrix of size 12 x 12). My loop needs to run 120,000 times and I am currently getting a speed of 14s, which is relatively very high compared to MATLAB (1s) and FORTRAN (0.4s). Below is the function I am trying to optimize:
...ANSWER
Answered 2019-Jan-30 at 15:55There are two steps I usually take before trying to speed up numpy code.
- Profile the code to find what is taking the most time
- Build a couple of test cases calling the code to verify that the optimized version still runs correctly
The test cases should be something simple and quick running, but still reflective of real data. You've provided profiling, but no test cases so what follows is going to be some untested guess work. Looking over the test cases with largest running time it's clear that the running time comes from the loop, and mostly matrix operations in it.
119881 0.049 0.000 0.049 0.000 {method 'reshape' of 'numpy.ndarray' objects} 239763 0.058 0.000 0.058 0.000 {built-in method numpy.core.multiarray.array} 119881 0.103 0.000 0.103 0.000 {method 'diagonal' of 'numpy.ndarray' objects} 239762 0.049 0.000 0.107 0.000 ...\core\numeric.py:504(asanyarray) 119881 0.083 0.000 0.256 0.000 ...\core\fromnumeric.py:1294(diagonal) 119881 0.105 0.000 0.439 0.000 ...\lib\twodim_base.py:197(diag) 839163 0.556 0.000 0.556 0.000 {built-in method numpy.core.multiarray.matmul}
First oddity is that np.linalg.inv(smx)
doesn't show up in the slow operations.
I think you misunderstood a commenters advice and moved it out of the main loop entirely.
It should still be in main loop, but only called a single time.
QUESTION
C:\PY27\Scripts>pip install --no-cache-dir scipy
Collecting scipy
c:\py27\lib\site-
packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:318:
SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name
Indication) extension to TLS is not available on this platform. This may
cause the server to present an incorrect TLS certificate, which can cause
validation failures. You can upgrade to a newer version of Python to solve
this. For more information, see
https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
c:\py27\lib\site-
packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122:
InsecurePlatformWarning: A true SSLContext object is not available. This
prevents urllib3 from configuring SSL appropriately and may cause certain
SSL connections to fail. You can upgrade to a newer version of Python to
solve this. For more information, see
https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading scipy-0.18.1.tar.gz (13.1MB)
100% |################################| 13.1MB 239kB/s
Installing collected packages: scipy
Running setup.py install for scipy ... error
Complete output from command c:\py27\python.exe -u -c "import setuptools,
tokenize;__file__='c:\\users\\puneet~1\\appdata\\local\\temp\\pip-build-
qvvewa\\scipy\\setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code,
__file__, 'exec'))" install --record
c:\users\puneet~1\appdata\local\temp\pip-icoko3-record\install-record.txt --
single-version-externally-managed --compile:
Note: if you need reliable uninstall behavior, then install
with pip instead of using `setup.py install`:
- `pip install .` (from a git repo or downloaded source
release)
- `pip install scipy` (last SciPy release on PyPI)
lapack_opt_info:
lapack_mkl_info:
libraries mkl_rt not found in ['c:\\py27\\lib', 'C:\\', 'c:\\py27\\libs']
NOT AVAILABLE
openblas_lapack_info:
libraries openblas not found in ['c:\\py27\\lib', 'C:\\', 'c:\\py27\\libs']
NOT AVAILABLE
atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
c:\py27\lib\site-packages\numpy\distutils\system_info.py:1051: UserWarning:
Specified path C:\projects\numpy-wheels\windows-wheel-builder\atlas-
builds\atlas-3.11.38-sse2-64\lib is invalid.
pre_dirs = system_info.get_paths(self, section, key)
NOT AVAILABLE
atlas_3_10_info:
NOT AVAILABLE
atlas_threads_info:
Setting PTATLAS=ATLAS
NOT AVAILABLE
atlas_info:
NOT AVAILABLE
c:\py27\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
lapack_info:
libraries lapack not found in ['c:\\py27\\lib', 'C:\\', 'c:\\py27\\libs']
NOT AVAILABLE
c:\py27\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
self.calc_info()
lapack_src_info:
NOT AVAILABLE
c:\py27\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
self.calc_info()
NOT AVAILABLE
Running from scipy source directory.
Traceback (most recent call last):
File "", line 1, in
File "c:\users\puneet~1\appdata\local\temp\pip-build-
qvvewa\scipy\setup.py", line 415, in
setup_package()
File "c:\users\puneet~1\appdata\local\temp\pip-build-
qvvewa\scipy\setup.py", line 411, in setup_package
setup(**metadata)
File "c:\py27\lib\site-packages\numpy\distutils\core.py", line 135, in
setup
config = configuration()
File "c:\users\puneet~1\appdata\local\temp\pip-build-
qvvewa\scipy\setup.py", line 335, in configuration
config.add_subpackage('scipy')
File "c:\py27\lib\site-packages\numpy\distutils\misc_util.py", line 1001,
in add_subpackage
caller_level = 2)
File "c:\py27\lib\site-packages\numpy\distutils\misc_util.py", line 970,
in get_subpackage
caller_level = caller_level + 1)
File "c:\py27\lib\site-packages\numpy\distutils\misc_util.py", line 907,
in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "scipy\setup.py", line 15, in configuration
config.add_subpackage('linalg')
File "c:\py27\lib\site-packages\numpy\distutils\misc_util.py", line 1001,
in add_subpackage
caller_level = 2)
File "c:\py27\lib\site-packages\numpy\distutils\misc_util.py", line 970,
in get_subpackage
caller_level = caller_level + 1)
File "c:\py27\lib\site-packages\numpy\distutils\misc_util.py", line 907,
in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "scipy\linalg\setup.py", line 20, in configuration
raise NotFoundError('no lapack/blas resources found')
numpy.distutils.system_info.NotFoundError: no lapack/blas resources found
----------------------------------------
Command "c:\py27\python.exe -u -c "import setuptools,
tokenize;__file__='c:\\users\\puneet~1\\appdata\\local\\temp\\pip-build-
qvvewa\\scipy\\setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code,
__file__, 'exec'))" install --record
c:\users\puneet~1\appdata\local\temp\pip-icoko3-record\install-record.txt --
single-version-externally-managed --compile" failed with error code 1 in
c:\users\puneet~1\appdata\local\temp\pip-build-qvvewa\scipy\
...ANSWER
Answered 2017-Feb-15 at 11:13You cannot just pip install
scipy on Windows. Use Gohlke wheels or Anaconda.
QUESTION
I am trying to install scipy module in python (on Windows). I am executing the following command in command line: pip install scipy
At first it starts installing but then it give the following error:
ANSWER
Answered 2017-Aug-28 at 16:10As the error says you are missing some dependencies. Try installing from one of these prebuilt binaries for windows: http://www.lfd.uci.edu/~gohlke/pythonlibs/
Download the .whl file appropriate for your version of python then run pip install .whl
QUESTION
I am using Windows 10 (64-bit) ,python 3.6 with the latest pip version and the latest version on NumPy as well (I installed it using the command pip install numpy). When I tried to install SciPy pip gave me this error :
...ANSWER
Answered 2017-Jun-05 at 20:46This is a duplicate of many questions. The short answer is: on Windows, use wheels built by Christoph Gohlke, http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy, or switch over to Anaconda.
QUESTION
I was trying to install Scipy on Pycharm via Project Interpretor. Then it showed an error saying I should try typing pip install scipy
on cmd. I did that and got the following error. It is still showing that it is not installed.
ANSWER
Answered 2017-May-26 at 08:06You can try to use an unofficial installer for SciPy.
Here you can find the link with all unofficial installer, please search and open the scipy link in the list.
Keep in mind to choose the right version, in this way:
- cp = python version (i.e. cp27 = Pythonv2.7)
- win_amd64 = x86_64 or win32 = windows 32 bit
Download it and then install it with the following command
QUESTION
When I attempt to install scipy on Windows 10, it fails
...ANSWER
Answered 2017-Apr-27 at 17:01I had a similar error when I installed scipy. I have found it much easier to just install it using Anaconda. The installer is here: https://www.continuum.io/downloads
Caution: it will also install other python libs related to data science such as NumPy, Pandas, SciPy, Matplotlib, and Jupyter. A full list by python version is here: https://docs.continuum.io/anaconda/pkg-docs#python-3-6
I installed this after having python already installed, and there was no issue.
Sorry for not answering your question directly, but this will deliver you scipy and many more goodies!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install numpy-wheels
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page