As I understand it, python uses only one core of the CPU (?)
Does numpy use more cores to speed up calculations?
Reason for my question: I plan to buy a computer, and would like to know what CPU is best for fast numpy ( and scipy) calculations.
To expand upon Michael Szczesny's comment, Numpy can utilize multiple CPU cores for performing basic vector and matrix operations by leveraging the BLAS (Basic Linear Algebra Subprograms) library(1), which gets installed with Numpy. However, it's important to note that not all operating systems and hardware configurations are supported by the BLAS library(2), which is why I tested that both macOS and Windows support BLAS as highlighted below.
Regarding the best processor, generally speaking, the more cores it has, the better — provided that it supports BLAS.
Note: (1) and (2) are citations - See references below.
Curious to see NumPy's multi-core usage in action, I ran the following Python script while monitoring CPU utilization through Activity Monitor on macOS (and similarly on Windows 10 using Task Manager):
import numpy as np
# Creating very large arrays
arr1 = np.random.rand(10000, 10000)
arr2 = np.random.rand(10000, 10000)
# Performing lots of math that should utilize multiple cores
result = np.dot(np.linalg.inv(arr1), arr2)
print("Finished")
Activity Monitor revealed a noticeable spike in utilization across all ten cores when the script was run (See Screenshot). Comparable results were observed on a family member’s Windows machine equipped with an Intel CPU.

Here are the specific CPUs and operating systems I tested:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With