Python Basic --Pandas, Numpy-

  1. Introduction of Numpy NumPy is a Python package. It stands for 'Numerical Python', and Numpy is a linear algebra library to work with dimensional arrays, which contains useful linear algebra routines and random number capabilities.

  2. Numpy arrange() method The arange() method in the Numpy module in Python is used to generate linear sequence of numbers. If does it on the basis of the pre-provide starting and ending points along with a constant step size.

Syntax

import numpy as np
start = 1  # default 0
stop = 21
step = 1   # default 1
none = int
np.arange(start, stop, step, dtype=none)

Output image.png

Omit

data = np.arange(start, stop, step)
data

Output image.png

Combination of reshape() method

data = np.arange(start, stop, step).reshape(4,5)
data

Output image.png

Combination of array() method

title = np.array(['UserId', 'SomethingId', 'ProductName', 'Price', 'Ratings'])
df = pd.DataFrame(data, columns=title)
df

Output image.png

Pick up (Slice) specific data

df_part = pd.DataFrame(data[:, 3:], columns=title[3:])
df_part

Output image.png

df_part = pd.DataFrame(data[:, :3], columns=title[:3])
df_part

Output image.png

  1. Pandas Pandas is a library providing fast, flexible, and expressive way to work with a relational or table of data, both easily and intuitive. It allows you to process your data in a way similar to SQL. Scikit-learn is a library of classic machine learning algorithms. It features various classification, regression, and clustering algorithms, including support virtual machines, random force, and a lot more.

concat() method

pandas.concat

df12 = pd.concat([df_part2, df_part1], axis=1)
df12

Output image.png

References: LINKS

-Numpy-Official -Pandas-Official -Active engineers explain how to use NumPy's arrange function in Python [for beginners] -GitHub : neural-style -GitHub : Fast Style Transfer in TensorFlow

Recommended Posts

Python Basic --Pandas, Numpy-
Python application: Pandas Part 1: Basic
Numpy [Basic]
1. Statistics learned with Python 1-1. Basic statistics (Pandas)
RF Python Basic_01
My pandas (python)
Basic Python writing
#Python basics (#Numpy 1/2)
#Python basics (#Numpy 2/2)
Python3 basic grammar
RF Python Basic_02
Python #Numpy basics
python pandas notes
[Python] Numpy memo
Python basic course (12 functions)
Python I'm also basic
Python basic grammar / algorithm
Python basic course (2 Python installation)
Install Python3, numpy, pandas, matplotlib, etc. on Windows
Basic sorting in Python
Numpy basic calculation memo
Python basic course (9 iterations)
Basic operation of pandas
Python basics 8 numpy test
Python Basic Course (11 exceptions)
Python basic course (6 sets)
Basic operation of Pandas
Python3 cheat sheet (basic)
[Python] Search (NumPy) ABC165C
Python basic grammar (miscellaneous)
python numpy array calculation
Python Basic Course (Introduction)
Installing pandas on python2.6
Python basic memorandum part 2
python basic on windows ②
Python basic course (13 classes)
Basic Python command memo
Python basic grammar note (4)
Python basic grammar note (3)
Basic knowledge of Python
(Note) Basic statistics on Python & Pandas on IBM DSX
Python basic grammar memo
[Python] Sorting Numpy data
OpenCV basic code (python)
python memorandum super basic
Python basic course (8 branches)
Python basic if statement
Python application: Pandas # 3: Dataframe
Python Basic Course (3 Python Execution)
Basic operation of Python Pandas Series and Dataframe (1)
Introduction to Python numpy pandas matplotlib (~ towards B3 ~ part2)
Basic Python 3 grammar (some Python iterations)
Python / Numpy np.newaxis thinking tips
Read csv with python pandas
Python application: Pandas Part 2: Series
Convert numpy int64 to python int
Refactoring Learned in Python (Basic)
[Python] Convert list to Pandas [Pandas]
BASIC authentication with Python bottle
[Python] Calculation method with numpy
Python basic dict sort order