bigframes.geopandas.GeoSeries.to_pandas#

GeoSeries.to_pandas(max_download_size:int|None=None,sampling_method:str|None=None,random_state:int|None=None,*,ordered:bool=True,dry_run:bool=False,allow_large_results:bool|None=None)Series#

Writes Series to pandas Series.

Examples:

>>>s=bpd.Series([4,3,2])

Download the data from BigQuery and convert it into an in-memory pandas Series.

>>>s.to_pandas()0    41    32    2dtype: Int64

Estimate job statistics without processing or downloading data by usingdry_run=True.

>>>s.to_pandas(dry_run=True)columnCount                                                            1columnDtypes                                               {None: Int64}indexLevel                                                             1indexDtypes                                                      [Int64]projectId                                                  bigframes-devlocation                                                              USjobType                                                            QUERYdestinationTable       {'projectId': 'bigframes-dev', 'datasetId': '_...useLegacySql                                                       FalsereferencedTables                                                    NonetotalBytesProcessed                                                    0cacheHit                                                           FalsestatementType                                                     SELECTcreationTime                            2025-04-03 18:54:59.219000+00:00dtype: object
Parameters:
  • max_download_size (int,default None) –

    Deprecated since version 2.0.0:max_download_size parameter is deprecated. Please useto_pandas_batches()method instead.

    Download size threshold in MB. Ifmax_download_size is exceeded when downloading data,the data will be downsampled ifbigframes.options.sampling.enable_downsampling isTrue, otherwise, an error will be raised. If set to a value other thanNone,this will supersede the global config.

  • sampling_method (str,default None) –

    Deprecated since version 2.0.0:sampling_method parameter is deprecated. Please usesample() method instead.

    Downsampling algorithms to be chosen from, the choices are: “head”: This algorithmreturns a portion of the data from the beginning. It is fast and requires minimalcomputations to perform the downsampling; “uniform”: This algorithm returns uniformrandom samples of the data. If set to a value other than None, this will supersedethe global config.

  • random_state (int,default None) –

    Deprecated since version 2.0.0:random_state parameter is deprecated. Please usesample() method instead.

    The seed for the uniform downsampling algorithm. If provided, the uniform method maytake longer to execute and require more computation. If set to a value other thanNone, this will supersede the global config.

  • ordered (bool,default True) – Determines whether the resulting pandas series will be ordered.In some cases, unordered may result in a faster-executing query.

  • dry_run (bool,default False) – If this argument is true, this method will not process the data. Instead, it returnsa Pandas Series containing dry run job statistics

  • allow_large_results (bool,default None) – If not None, overrides the global setting to allow or disallow large query resultsover the default size limit of 10 GB.

Returns:

A pandas Series with all rows of this Series if the data_sampling_threshold_mb

is not exceeded; otherwise, a pandas Series with downsampled rows of the DataFrame. If dry_runis set to True, a pandas Series containing dry run statistics will be returned.

Return type:

pandas.Series

This Page