- Регистрация
- 9 Май 2015
- Сообщения
- 1,605
- Баллы
- 155
Today I focused on improving my Python skills by practicing NumPy, one of the most powerful libraries used in Data Analytics and Machine Learning.
NumPy makes numerical operations faster, cleaner, and more efficient—especially when working with large datasets.
- Creating arrays: array(), arange(), linspace()
- Indexing & slicing (1D, 2D, 3D)
- Mathematical & statistical operations
- Broadcasting
- Reshaping arrays with reshape()
- Horizontal & vertical stacking
- Boolean filtering
- Using the random module:
np.random.rand()
np.random.randn()
np.random.randint()
- Vectorization for fast computations
np.dot(a, b)
np.matmul(a, b)
np.where(condition, value_if_true, value_if_false)
np.sort(arr)
np.unique(arr)
np.genfromtxt("data.csv", delimiter=",")
- Compared memory usage of Python lists vs NumPy arrays
- Used %timeit in Jupyter Notebook for speed comparison
- Extremely fast numerical operations
- Clean, simple, and vectorized code
- Foundation for Pandas, Matplotlib, Scikit-Learn
- Widely used in data preprocessing and ML models
You can check my NumPy practice code here:
Источник: