Skip to content

Commit a88aa0a

Browse files
DOC: fix sql docs (write example data to database)
1 parent 39b8d92 commit a88aa0a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/source/io.rst

+2
Original file line numberDiff line numberDiff line change
@@ -3133,12 +3133,14 @@ the database using :func:`~pandas.io.sql.to_sql`.
31333133
.. ipython:: python
31343134
:suppress:
31353135
3136+
import datetime
31363137
c = ['id', 'Date', 'Col_1', 'Col_2', 'Col_3']
31373138
d = [(26, datetime.datetime(2010,10,18), 'X', 27.5, True),
31383139
(42, datetime.datetime(2010,10,19), 'Y', -12.5, False),
31393140
(63, datetime.datetime(2010,10,20), 'Z', 5.73, True)]
31403141
31413142
data = DataFrame(d, columns=c)
3143+
sql.to_sql(data, 'data', engine)
31423144
31433145
Reading Tables
31443146
~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)