일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- zabbix
- 성수대교
- 자전거
- 대전
- Kubernetes
- 소모임
- Shell
- 중식
- GitHub
- Python
- 유산소
- Run The Bridge
- 뚝섬유원지
- 건대입구역
- Podman
- 러닝
- docker
- DSEC
- 10km
- 맛집
- 힐링
- Linux
- 달리기
- 대구
- 하체
- 정보처리기사
- 한강
- 오답노트
- 2021
- Grafana
Archives
- Today
- Total
Run The Bridge
Pandas 기초(1) 본문
728x90
Pandas import 방법
1
|
import pandas as pd
|
cs |
data_frame이란 변수에 csv파일 불러오기
1
|
data_frame = pd.read_csv('./friend_list.csv')
|
cs |
pd.read.csv('')안에 csv 파일 경로를 넣어주면 된다.
data_frame 출력결과
data_frame 특정 부분만 읽어오기 (head, tail)
head = 처음 ~ 5번째 목록을 보여준다.tail = 끝에서 5번째 목록을 보여준다.data_frame.head(2)

data_frame.tail(2)

data_frame의 columns들은 모두 Series라는 type으로 구성되어있다.
1
|
type(data_frame.age)
|
cs |
--> pandas.core.series.Series
dataFrame생성하는 방법
1
2
|
s1 = pd.core.series.Series( [1, 2, 3] )
s2 = pd.core.series.Series( ['one', 'two', 'three'] )
|
cs |
s1, s2라는 변수안에 pd.core.series.Series로 안에 리스트를 정의해준다.
1
|
pd.DataFrame(data=dict(num=s1, word=s2))
|
cs |
pd.DataFrame이란 함수로 data=dict(columns=name, columns=name)으로 정의해준다.
728x90
'Python > Pandas' 카테고리의 다른 글
Pandas 기초(6) (0) | 2020.09.03 |
---|---|
Pandas 기초(5) (0) | 2020.09.03 |
Pandas 기초(4) (0) | 2020.08.31 |
Pandas 기초(3) (0) | 2020.08.31 |
Pandas 기초(2) (0) | 2020.08.31 |
Comments