From 4cbd3a75eed85395d5f8fcb852f44db61553b5cb Mon Sep 17 00:00:00 2001 From: Chelsea Lin Date: Tue, 9 Apr 2024 18:31:02 +0000 Subject: [PATCH] docs: (Series|Dataframe).dtypes --- .../bigframes_vendored/pandas/core/generic.py | 12 ++++++++++++ .../bigframes_vendored/pandas/core/series.py | 14 ++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/third_party/bigframes_vendored/pandas/core/generic.py b/third_party/bigframes_vendored/pandas/core/generic.py index d14cbfaa52..61bc39bb12 100644 --- a/third_party/bigframes_vendored/pandas/core/generic.py +++ b/third_party/bigframes_vendored/pandas/core/generic.py @@ -589,6 +589,18 @@ def dtypes(self): The result's index is the original DataFrame's columns. Columns with mixed types aren't supported yet in BigQuery DataFrames. + **Examples:** + + >>> import bigframes.pandas as bpd + >>> bpd.options.display.progress_bar = None + + >>> df = bpd.DataFrame({'float': [1.0], 'int': [1], 'string': ['foo']}) + >>> df.dtypes + float Float64 + int Int64 + string string[pyarrow] + dtype: object + Returns: A *pandas* Series with the data type of each column. """ diff --git a/third_party/bigframes_vendored/pandas/core/series.py b/third_party/bigframes_vendored/pandas/core/series.py index 2d306fb05d..a75d6c2167 100644 --- a/third_party/bigframes_vendored/pandas/core/series.py +++ b/third_party/bigframes_vendored/pandas/core/series.py @@ -119,13 +119,15 @@ def shape(self): def dtype(self): """ Return the dtype object of the underlying data. - """ - raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE) - @property - def dtypes(self): - """ - Return the dtype object of the underlying data. + **Examples:** + + >>> import bigframes.pandas as bpd + >>> bpd.options.display.progress_bar = None + + >>> s = bpd.Series([1, 2, 3]) + >>> s.dtype + Int64Dtype() """ raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)