Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running quicker for Numpy and Pandas( installed via conda) than via pip?

Tags:

I have two Python environments (3.6).

I installed packages in one environment via conda, and in another environment via pip.

Then I found that conda-provided numpy and pandas run quicker than pip version (for most of the scenario).

Just wonder why this happens. Is that because they use different configuration during compilation?

like image 265
MTANG Avatar asked Nov 07 '18 20:11

MTANG


1 Answers

Yes, most likely this difference is due to different compilation configurations. Numpy makes use of the low-level fortran libraries BLAS and LAPACK. The numpy that you get from pip is compiled with different implementations of BLAS and LAPACK than the numpy that you get from conda. The latter uses the MKL implementation which is optimized specifically for Intel processors.

You can check the implementation that numpy is using in a particular environment with:

import numpy as np
np.show_config()

Some comparison benchmarks can be found here (as already noted by crisb).

like image 160
Xukrao Avatar answered Oct 11 '22 10:10

Xukrao