다른 옵션을 명시하지 않으면 로우와 컬럼 이름이 기록된다. 로우와 컬럼 이름을 포함하지 않
으려면 다음과 같이 한다.
In
[
48
]:
data
.
to
_
csv
(
sys
.
stdout
,
index
=
False
,
header
=
False
)
one
,
1
,
2
,
3
.
0
,
4
,
two
,
5
,
6
,,
8
,
world
three
,
9
,
10
,
11
.
0
,
12
,
foo
컬럼의 일부분만 기록할 수도 있으며, 순서를 직접 지정할 수도 있다.
In
[
49
]:
data
.
to
_
csv
(
sys
.
stdout
,
index
=
False
,
columns
=
['
a
',
'
b
',
'
c
'])
a
,
b
,
c
1
,
2
,
3
.
0
5
,
6
,
9
,
10
,
11
.
0
Series
에도
to
_
csv
메서드가 존재한다.
In
[
50
]:
dates
=
pd
.
date
_
range
('
1
/
1
/
2000
',
periods
=
7
)
In
[
51
]:
ts
=
pd
.
Series
(
np
.
arange
(
7
),
index
=
dates
)
In
[
52
]:
ts
.
to
_
csv
('
examples
/
tseries
.
csv
')
In
[
53
]:
!
cat examples
/
tseries
.
csv
2000
-
01
-
01
,
0
2000
-
01
-
02
,
1
2000
-
01
-
03
,
2
2000
-
01
-
04
,
3
2000
-
01
-
05
,
4
2000
-
01
-
06
,
5
2000
-
01
-
07
,
6
6.1.3
구분자 형식 다루기
pandas
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.