learn-python/contrib/numpy/introduction.md

31 wiersze
1.1 KiB
Markdown
Czysty Zwykły widok Historia

2024-05-15 12:19:44 +00:00
# Introduction
2024-05-15 12:27:30 +00:00
## What is NumPy?
2024-05-15 12:19:44 +00:00
2024-05-15 12:27:30 +00:00
NumPy is a powerful array-processing library in Python, essential for scientific computing. It provides efficient data structures and tools for working with multidimensional arrays.
2024-05-15 12:19:44 +00:00
2024-05-15 12:27:30 +00:00
## Key Features
2024-05-15 12:19:44 +00:00
2024-05-15 12:27:30 +00:00
1. **Efficient Arrays:** NumPy offers high-performance N-dimensional array objects for swift data manipulation.
2. **Broadcasting:** Advanced broadcasting enables seamless element-wise operations on arrays of varying shapes.
3. **Interoperability:** NumPy seamlessly integrates with C, C++, and Fortran, enhancing performance and versatility.
4. **Mathematical Tools:** Comprehensive support for linear algebra, Fourier transforms, and random number generation.
2024-05-15 12:19:44 +00:00
2024-05-15 12:27:30 +00:00
## Installation
2024-05-15 12:19:44 +00:00
2024-05-15 12:27:30 +00:00
Ensure Python is installed in your system. If not you can install it from here([official Python website](https://www.python.org/)),then install NumPy via:
2024-05-15 12:19:44 +00:00
```bash
pip install numpy
```
2024-05-15 12:28:33 +00:00
## Importing NumPy
2024-05-15 12:19:44 +00:00
2024-05-16 07:38:37 +00:00
To access NumPy functions, import it with the alias `np`.
2024-05-15 12:19:44 +00:00
2024-05-15 12:27:30 +00:00
```python
2024-05-15 12:19:44 +00:00
import numpy as np
```
2024-05-15 12:27:30 +00:00
Using `np` as an alias enhances code readability and is a widely adopted convention.