Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- Numerical Analysis
- obsidian
- LaTeX
- 수치해석
- ChatGPT
- WOX
- 딥러닝
- 옵시디언
- 텝스
- MATLAB
- matplotlib
- teps
- 우분투
- 고체역학
- 텝스공부
- 생산성
- 논문작성법
- Statics
- pytorch
- Dear abby
- 인공지능
- JAX
- Linear algebra
- IEEE
- Julia
- Zotero
- Python
- 수식삽입
- 논문작성
- 에러기록
Archives
- Today
- Total
뛰는 놈 위에 나는 공대생
[데이터과학] scipy interpolation 종류 정리 본문
모든 scipy interpolation을 다 시도해보았다.
각 interpolation마다 특징이 있으므로 원하는 것을 사용하면 된다.
from scipy import interpolate
import numpy as np
x = np.arange(0, 10)
y = np.sin(-x)
kind_set = [ "zero", "linear", "quadratic","nearest", "nearest-up", "slinear", "cubic", "previous"]
xnew = np.arange(0, 9, 0.1)
for i in range(4):
f = interpolate.interp1d(x, y, kind=kind_set[i])
ynew = f(xnew)
plt.plot(xnew, ynew, label=kind_set[i])
plt.plot(x,y,'o',label='origin')
plt.legend()
plt.show()
기본적으로 zero와 previous는 비슷하고
nearest는 x축에서 가까운 값을 사용한다. linear, cubic, quadratic, slinear는 이름이 말해주는 함수형태로 근사해서 interpolation을 수행한다.
'연구 Research > 데이터과학 Data Science' 카테고리의 다른 글
[matplotlib] x,y축 format 지정하는 방법 (0) | 2023.06.08 |
---|---|
[Matplotlib] 3D scatter plot 그리는 코드 (0) | 2023.04.28 |
[데이터과학] Pandas에서 dataframe 생성 및 export (0) | 2023.04.27 |
[데이터과학] Unbalancing data 처리 (0) | 2021.05.26 |
[데이터과학] 결측치 Missing Data 처리 (0) | 2021.05.25 |
Comments