Python 正在将数据帧上载到Google BigQuery。接收到无效的JSON负载。意外标记

Python 正在将数据帧上载到Google BigQuery。接收到无效的JSON负载。意外标记,python,google-bigquery,google-cloud-storage,google-datalayer,Python,Google Bigquery,Google Cloud Storage,Google Datalayer,我目前正试图将我的数据帧上传到Google Big Query,但我一直收到以下错误: RequestException: HTTP request failed: Invalid JSON payload received. Unexpected token. ": 2013, "abca": NaN, "abcd ^ 这是因为Google BQ无法读取“NaN”值吗 我有以下代码: sample_bucket_name = Context.

我目前正试图将我的数据帧上传到Google Big Query,但我一直收到以下错误:

   RequestException: HTTP request failed: Invalid JSON payload received. Unexpected token.
 ": 2013, "abca": NaN, "abcd
                  ^
这是因为Google BQ无法读取“NaN”值吗

我有以下代码:

   sample_bucket_name = Context.default().project_id 
   sample_bucket_path = 'gs://' + sample_bucket_name
   sample_bucket_object = sample_bucket_path + '/ABC.txt'
bigquery_数据集_名称='ABC' bigquery_表_名称='ABC'

# Define storage bucket
sample_bucket = storage.Bucket(sample_bucket_name)

# Create storage bucket if it does not exist
if not sample_bucket.exists():
sample_bucket.create()

# Define BigQuery dataset and table
dataset = bq.Dataset(bigquery_dataset_name)
table = bq.Table(bigquery_dataset_name + '.' + 
bigquery_table_name)

# Create BigQuery dataset
if not dataset.exists():
dataset.create()

# Create or overwrite the existing table if it exists
table_schema = bq.Schema.from_data(aas_dataframe)
table.create(schema = table_schema, overwrite = True)

# Write the DataFrame to GCS (Google Cloud Storage)
%storage write --variable simple_dataframe --object 
$sample_bucket_object

# Write the DataFrame to a BigQuery table
table.insert(aas_dataframe)
从:

不允许在下面的语法中表示数值(如无穷大和NaN)

因此,否,
NaN
不是数字的有效JSON值。

来自:

不允许在下面的语法中表示数值(如无穷大和NaN)

因此,不,
NaN
不是数字的有效JSON值