티스토리 뷰
Intro
- Editor : sublime text3
- python 3.9.1
- numpy 1.19.4
Data
-300 | 300 | 1 | -301 | 302 | 2 | 4 |
-250 | 300 | 1 | -251 | 302 | 2 | 4 |
-200 | 300 | 1 | -201 | 302 | 2 | 4 |
-150 | 300 | 1 | -151 | 302 | 2 | 4 |
-100 | 300 | 1 | -101 | 302 | 2 | 4 |
-50 | 300 | 1 | -51 | 302 | 2 | 4 |
0 | 300 | 1 | -1 | 302 | 2 | 4 |
50 | 300 | 1 | 49 | 302 | 2 | 4 |
100 | 300 | 1 | 99 | 302 | 2 | 4 |
150 | 300 | 1 | 149 | 302 | 2 | 4 |
200 | 300 | 1 | 199 | 302 | 2 | 4 |
250 | 300 | 1 | 249 | 302 | 2 | 4 |
300 | 300 | 1 | 299 | 302 | 2 | 4 |
Directory Tree
.
├── data
└── test1.csv
└── test_read.py
# -*- coding: utf-8 -*-
import os
import numpy as np
#### dir base
fpath_base = './data'
#### file_name, sheet_name
fnames = ('test1.csv','test1.xlsx')
shnames = ('Sheet1','Sheet2','Sheet3')
#### file_dir_base
fpath_bases = [os.path.join(fpath_base,fname) for fname in fnames]
#### file_read_csv : no text, just number
data_csv = np.loadtxt(fpath_bases[0], delimiter=",")
print(data_csv)
실행결과 : ----*REPL*[python]----
[[-300. 300. 1. ... 302. 2. 4.]
[-250. 300. 1. ... 302. 2. 4.]
[-200. 300. 1. ... 302. 2. 4.]
...
[ 200. 300. 1. ... 302. 2. 4.]
[ 250. 300. 1. ... 302. 2. 4.]
[ 300. 300. 1. ... 302. 2. 4.]]
***Repl Closed***
반응형
'python > Numpy, Pandas' 카테고리의 다른 글
(macOS)[python] Numpy Excel 다루기 - 2 : excel .xlsx read (0) | 2021.01.22 |
---|---|
(macOS)[python] Pandas Excel 다루기 - 3 : .csv 파일 읽기 (0) | 2021.01.13 |
(macOS)[python] Regression Analysis with Pandas (0) | 2021.01.12 |
(macOS)[python] Pandas Excel 다루기 - 1 : excel 읽기, 저장, df 분석 (0) | 2020.03.10 |
(macOS) .DS_Store 삭제 (0) | 2020.02.28 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- github
- 확진
- Model
- MacOS
- 자가격리
- Django
- Regression
- Python
- 코로나19
- 코로나
- DAQ
- r
- raspberrypi
- analysis
- vscode
- template
- CSV
- Pandas
- sublime text
- DS18B20
- server
- Raspberry Pi
- SSH
- pyserial
- git
- 라즈베리파이
- arduino
- ERP
- COVID-19
- Templates
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
글 보관함