Skip to content

Commit 27e4fb1

Browse files
committed
DOC: pytables natural name docs
1 parent b0cd607 commit 27e4fb1

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

doc/source/io.rst

+17-9
Original file line numberDiff line numberDiff line change
@@ -2600,6 +2600,14 @@ Notes & Caveats
26002600
(e.g. *columns* or *minor_axis*) are determined as the maximum size
26012601
of the elements in that axis or by passing the parameter
26022602

2603+
.. warning::
2604+
2605+
``PyTables`` will show a ``NaturalNameWarning`` if a column name
2606+
cannot be used as an attribute selector. Generally identifiers that
2607+
have spaces, start with numbers, or ``_``, or have ``-`` embedded are not considered
2608+
*natural*. These types of identifiers cannot be used in a ``where`` clause
2609+
and are generally a bad idea.
2610+
26032611
DataTypes
26042612
~~~~~~~~~
26052613

@@ -2911,9 +2919,9 @@ Google BigQuery (Experimental)
29112919
------------------------------
29122920

29132921
The :mod:`pandas.io.gbq` module provides a wrapper for Google's BigQuery
2914-
analytics web service to simplify retrieving results from BigQuery tables
2915-
using SQL-like queries. Result sets are parsed into a pandas
2916-
DataFrame with a shape derived from the source table. Additionally,
2922+
analytics web service to simplify retrieving results from BigQuery tables
2923+
using SQL-like queries. Result sets are parsed into a pandas
2924+
DataFrame with a shape derived from the source table. Additionally,
29172925
DataFrames can be uploaded into BigQuery datasets as tables
29182926
if the source datatypes are compatible with BigQuery ones. The general
29192927
structure of this module and its provided functions are based loosely on those in
@@ -2930,26 +2938,26 @@ into BigQuery and pull it into a DataFrame.
29302938
from pandas.io import gbq
29312939
data_frame = gbq.read_gbq('SELECT * FROM test_dataset.test_table')
29322940
2933-
The user will then be authenticated by the `bq` command line client -
2941+
The user will then be authenticated by the `bq` command line client -
29342942
this usually involves the default browser opening to a login page,
29352943
though the process can be done entirely from command line if necessary.
29362944
Datasets and additional parameters can be either configured with `bq`,
29372945
passed in as options to `read_gbq`, or set using Google's gflags (this
29382946
is not officially supported by this module, though care was taken
29392947
to ensure that they should be followed regardless of how you call the
2940-
method).
2948+
method).
29412949

29422950
Additionally, you can define which column to use as an index as well as a preferred column order as follows:
29432951

29442952
.. code-block:: python
29452953
2946-
data_frame = gbq.read_gbq('SELECT * FROM test_dataset.test_table', index_col='index_column_name', col_order='[col1, col2, col3,...]')
2954+
data_frame = gbq.read_gbq('SELECT * FROM test_dataset.test_table', index_col='index_column_name', col_order='[col1, col2, col3,...]')
29472955
29482956
Finally, if you would like to create a BigQuery table, `my_dataset.my_table`, from the rows of DataFrame, `df`:
29492957

29502958
.. code-block:: python
29512959
2952-
df = pandas.DataFrame({'string_col_name' : ['hello'],
2960+
df = pandas.DataFrame({'string_col_name' : ['hello'],
29532961
'integer_col_name' : [1],
29542962
'boolean_col_name' : [True]})
29552963
schema = ['STRING', 'INTEGER', 'BOOLEAN']
@@ -2959,7 +2967,7 @@ To add more rows to this, simply:
29592967

29602968
.. code-block:: python
29612969
2962-
df2 = pandas.DataFrame({'string_col_name' : ['hello2'],
2970+
df2 = pandas.DataFrame({'string_col_name' : ['hello2'],
29632971
'integer_col_name' : [2],
29642972
'boolean_col_name' : [False]})
29652973
data_frame = gbq.to_gbq(df2, 'my_dataset.my_table', if_exists='append')
@@ -2970,7 +2978,7 @@ To add more rows to this, simply:
29702978

29712979
* There is a hard cap on BigQuery result sets, at 128MB compressed. Also, the BigQuery SQL query language has some oddities,
29722980
see: <https://developers.google.com/bigquery/query-reference>
2973-
2981+
29742982
STATA Format
29752983
------------
29762984

0 commit comments

Comments
 (0)