@@ -2600,6 +2600,14 @@ Notes & Caveats
2600
2600
(e.g. *columns * or *minor_axis *) are determined as the maximum size
2601
2601
of the elements in that axis or by passing the parameter
2602
2602
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
+
2603
2611
DataTypes
2604
2612
~~~~~~~~~
2605
2613
@@ -2911,9 +2919,9 @@ Google BigQuery (Experimental)
2911
2919
------------------------------
2912
2920
2913
2921
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,
2917
2925
DataFrames can be uploaded into BigQuery datasets as tables
2918
2926
if the source datatypes are compatible with BigQuery ones. The general
2919
2927
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.
2930
2938
from pandas.io import gbq
2931
2939
data_frame = gbq.read_gbq(' SELECT * FROM test_dataset.test_table' )
2932
2940
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 -
2934
2942
this usually involves the default browser opening to a login page,
2935
2943
though the process can be done entirely from command line if necessary.
2936
2944
Datasets and additional parameters can be either configured with `bq `,
2937
2945
passed in as options to `read_gbq `, or set using Google's gflags (this
2938
2946
is not officially supported by this module, though care was taken
2939
2947
to ensure that they should be followed regardless of how you call the
2940
- method).
2948
+ method).
2941
2949
2942
2950
Additionally, you can define which column to use as an index as well as a preferred column order as follows:
2943
2951
2944
2952
.. code-block :: python
2945
2953
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,...]' )
2947
2955
2948
2956
Finally, if you would like to create a BigQuery table, `my_dataset.my_table `, from the rows of DataFrame, `df `:
2949
2957
2950
2958
.. code-block :: python
2951
2959
2952
- df = pandas.DataFrame({' string_col_name' : [' hello' ],
2960
+ df = pandas.DataFrame({' string_col_name' : [' hello' ],
2953
2961
' integer_col_name' : [1 ],
2954
2962
' boolean_col_name' : [True ]})
2955
2963
schema = [' STRING' , ' INTEGER' , ' BOOLEAN' ]
@@ -2959,7 +2967,7 @@ To add more rows to this, simply:
2959
2967
2960
2968
.. code-block :: python
2961
2969
2962
- df2 = pandas.DataFrame({' string_col_name' : [' hello2' ],
2970
+ df2 = pandas.DataFrame({' string_col_name' : [' hello2' ],
2963
2971
' integer_col_name' : [2 ],
2964
2972
' boolean_col_name' : [False ]})
2965
2973
data_frame = gbq.to_gbq(df2, ' my_dataset.my_table' , if_exists = ' append' )
@@ -2970,7 +2978,7 @@ To add more rows to this, simply:
2970
2978
2971
2979
* There is a hard cap on BigQuery result sets, at 128MB compressed. Also, the BigQuery SQL query language has some oddities,
2972
2980
see: <https://developers.google.com/bigquery/query-reference>
2973
-
2981
+
2974
2982
STATA Format
2975
2983
------------
2976
2984
0 commit comments