[PYTHON] Data handling

What is NumPy

numpy is a library for efficient numerical calculation in the Python language. numpy has the following advantages: --High-speed calculation using vectorization notation --Efficient descriptive statistical data manipulation --Condition description in the audience

ndarray: Multidimensional placement object

In ndarray, vectorization notation enables high-speed batch calculation for arrays.

Creation of ndarray object

↓ ↓ ↓ ↓ ↓ ↓ ↓ Contents of your article

ndarray.py


───────

#### **`ndarray1.py`**
```python

 ↑↑↑↑↑↑↑ Contents of edit request
import numpy as np
ndarray1 = np.array([1,2,3,4,5])
 ↓ ↓ ↓ ↓ ↓ ↓ ↓ Contents of your article
print(ndarray)
# Output result [1 2 3 4 5]
───────
print(ndarray1)

↑↑↑↑↑↑↑ Contents of edit request

↓ ↓ ↓ ↓ ↓ ↓ ↓ Contents of your article ndarray2 = np.arrange(1,6,1) ───────

Output result


[1 2 3 4 5]

ndarray2.py


ndarray2 = np.arrange(1,6,1)
 ↑↑↑↑↑↑↑ Contents of edit request
print(ndarray2)
 ↓ ↓ ↓ ↓ ↓ ↓ ↓ Contents of your article
# Output result [1 2 3 4 5]

print(np.ones(5))
# Output result [1 1 1 1 1]

np.The array function can pass a multidimensional list.

ndarry2.py


ndarray4 = np.array([[1,2,3],[4,5,6]])
print(ndarray4)

# Output result [[1 2 3] [4 5 6]]

-shape → shape of the array -size → Total number of elements in the array -ndim → Number of dimensions of array

ndarray3.py


ndarray = np.array([[1, 2, 3], [4, 5, 6]])
print(ndarray.shape)
print(ndarray.size)
print(ndarray.ndim)
# Output result (2,3)
# Output result 6
# Output result 2

───────



#### **`Output result`**
```text

[1 2 3 4 5]

↑↑↑↑↑↑↑ Contents of edit request

Recommended Posts

Data handling
Multi-condition data handling
Data handling 3 (development) About data format
Python Application: Data Handling Part 3: Data Format
Exception handling
Data handling 2 Analysis of various data formats
Data handling 1 Data formatting and file input / output
Mainframe error handling
ALMA data reduction
Data analysis Titanic 2
Data set generation
Creating training data
Data analysis python
Learn data science
Read pandas data
Python Error Handling
Python exception handling
Data analysis Titanic 1
boto3 exception handling
PySpark data manipulation
[SQLAlchemy] Read data
Python timezone handling
[Introduction to cx_Oracle] (5th) Handling of Japanese data
Data analysis Titanic 3
High Memory Handling
Python Application: Data Handling Part 2: Parsing Various Data Formats
django.db.migrations.exceptions.InconsistentMigrationHistory error handling
[Data science memorandum] Handling of missing values ​​[python]
e-Stat GIS data
Python exception handling
[python] Read data