- NumPy - 수학/과학 연산을 위한 파이썬 패키지
- NumPy 기초
- NumPy 어레이 만들기
- NumPy 어레이 출력하기
- NumPy 기본 연산
- NumPy 범용 함수 (ufunc)
- NumPy 인덱싱/슬라이싱/이터레이팅
- NumPy 어레이 형태 다루기
- NumPy 난수 생성 (Random 모듈)
- NumPy 다양한 함수들
- numpy.absolute
- numpy.add
- numpy.allclose
- numpy.amax
- numpy.amin
- numpy.append
- numpy.arange
- numpy.arccos
- numpy.arccosh
- numpy.arcsin
- numpy.arcsinh
- numpy.arctan
- numpy.arctanh
- numpy.argmax
- numpy.argsort
- numpy.around
- numpy.array_equal
- numpy.array_split
- numpy.array
- numpy.cbrt
- numpy.ceil
- numpy.clip
- numpy.concatenate
- numpy.copy
- numpy.cos
- numpy.cosh
- numpy.cumsum
- numpy.deg2rad
- numpy.delete
- numpy.digitize
- numpy.divide
- numpy.dot
- numpy.dsplit
- numpy.empty_like
- numpy.empty
- numpy.equal
- numpy.exp
- numpy.exp2
- numpy.expm1
- numpy.fabs
- numpy.fix
- numpy.floor_divide
- numpy.floor
- numpy.full_like
- numpy.full
- numpy.greater_equal
- numpy.greater
- numpy.hsplit
- numpy.identity
- numpy.insert
- numpy.isclose
- numpy.less_equal
- numpy.less
- numpy.linspace
- numpy.loadtxt
- numpy.log
- numpy.log1p
- numpy.log2
- numpy.log10
- numpy.matmul
- numpy.mean
- numpy.mod
- numpy.multiply
- numpy.ndarray.astype
- numpy.ndarray.flatten
- numpy.ndarray.shape
- numpy.negative
- numpy.nonzero
- numpy.not_equal
- numpy.ones_like
- numpy.ones
- numpy.polyfit
- numpy.positive
- numpy.power
- numpy.prod
- numpy.rad2deg
- numpy.random.rand
- numpy.random.randint
- numpy.random.randn
- numpy.random.seed
- numpy.random.standard_normal
- numpy.reciprocal
- numpy.remainder
- numpy.repeat
- numpy.reshape
- numpy.rint
- numpy.round_
- numpy.savetxt
- numpy.set_printoptions
- numpy.sign
- numpy.sin
- numpy.sinh
- numpy.split
- numpy.sqrt
- numpy.square
- numpy.std
- numpy.subtract
- numpy.sum
- numpy.take
- numpy.tan
- numpy.tanh
- numpy.tile
- numpy.transpose
- numpy.tril
- numpy.triu
- numpy.true_divide
- numpy.trunc
- numpy.var
- numpy.vsplit
- numpy.where
- numpy.zeros_like
- numpy.zeros
- NumPy 상수
- Python Tutorial
- NumPy Tutorial
- Matplotlib Tutorial
- PyQt5 Tutorial
- BeautifulSoup Tutorial
- xlrd/xlwt Tutorial
- Pillow Tutorial
- Googletrans Tutorial
- PyWin32 Tutorial
- PyAutoGUI Tutorial
- Pyperclip Tutorial
- TensorFlow Tutorial
- Tips and Examples
numpy.loadtxt¶
numpy.loadtxt 함수는 텍스트 파일로부터 데이터를 불러옵니다.
예제¶
import numpy as np
x = np.array([1, 2, 3, 4])
y = np.array([5, 6, 7, 8])
z = np.array([9, 10, 11, 12])
np.savetxt('array_x.csv', x, delimiter=', ')
np.savetxt('array_xy.csv', (x, y))
np.savetxt('array_z.csv', z, fmt='%1.4e')
load_x = np.loadtxt('array_x.csv')
load_xy = np.loadtxt('array_xy.csv')
load_z = np.loadtxt('array_z.csv')
print(load_x)
print(load_xy)
print(load_z)
[1. 2. 3. 4.]
[[1. 2. 3. 4.]
[5. 6. 7. 8.]]
[ 9. 10. 11. 12.]
np.savetxt를 이용해서 저장한 데이터를 np.loadtxt로 불러옵니다.
저장했던 어레이 x, (x, y), z가 출력됩니다.
관련 페이지¶
이전글/다음글
이전글 : numpy.linspace
다음글 : numpy.log