@@ -182,26 +182,29 @@ def execute(sql, con, cur=None, params=None):
182
182
def read_sql_table (table_name , con , schema = None , index_col = None ,
183
183
coerce_float = True , parse_dates = None , columns = None ,
184
184
chunksize = None ):
185
- """Read SQL database table into a DataFrame.
185
+ """
186
+ Read SQL database table into a DataFrame.
186
187
187
188
Given a table name and a SQLAlchemy connectable, returns a DataFrame.
188
189
This function does not support DBAPI connections.
189
190
190
191
Parameters
191
192
----------
192
- table_name : string
193
+ table_name : str
193
194
Name of SQL table in database.
194
- con : SQLAlchemy connectable (or database string URI)
195
+ con : SQLAlchemy connectable or str
196
+ A database URI could be provided as as str.
195
197
SQLite DBAPI connection mode not supported.
196
- schema : string , default None
198
+ schema : str , default None
197
199
Name of SQL schema in database to query (if database flavor
198
200
supports this). Uses default schema if None (default).
199
- index_col : string or list of strings , optional, default: None
201
+ index_col : str or list of str , optional, default: None
200
202
Column(s) to set as index(MultiIndex).
201
- coerce_float : boolean , default True
203
+ coerce_float : bool , default True
202
204
Attempts to convert values of non-string, non-numeric objects (like
203
205
decimal.Decimal) to floating point. Can result in loss of Precision.
204
- parse_dates : list or dict, default: None
206
+ parse_dates : list or dict, default None
207
+ The behavior is as follows:
205
208
- List of column names to parse as dates.
206
209
- Dict of ``{column_name: format string}`` where format string is
207
210
strftime compatible in case of parsing string times or is one of
@@ -210,24 +213,30 @@ def read_sql_table(table_name, con, schema=None, index_col=None,
210
213
to the keyword arguments of :func:`pandas.to_datetime`
211
214
Especially useful with databases without native Datetime support,
212
215
such as SQLite.
213
- columns : list, default: None
214
- List of column names to select from SQL table
216
+ columns : list, default None
217
+ List of column names to select from SQL table.
215
218
chunksize : int, default None
216
219
If specified, returns an iterator where `chunksize` is the number of
217
220
rows to include in each chunk.
218
221
219
222
Returns
220
223
-------
221
224
DataFrame
225
+ A SQL table is returned as two-dimensional data structure with labeled
226
+ axes.
222
227
223
228
See Also
224
229
--------
225
230
read_sql_query : Read SQL query into a DataFrame.
226
- read_sql
231
+ read_sql : Read SQL query or database table into a DataFrame.
227
232
228
233
Notes
229
234
-----
230
235
Any datetime values with time zone information will be converted to UTC.
236
+
237
+ Examples
238
+ --------
239
+ >>> pd.read_sql_table('table_name', 'postgres:///db_name') # doctest:+SKIP
231
240
"""
232
241
233
242
con = _engine_builder (con )
0 commit comments