0
我想在datalab上使用來自bigquery的公共數據,然後使用大熊貓數據框中的公共數據。我將如何去做這件事。我曾嘗試3個不同的版本:將bigquery數據加載到datalab中
from google.cloud import bigquery
client = bigquery.Client()
QUERY = (
'SELECT pickup_datetime, dropoff_datetime FROM `bigquery-public-
data.new_york.tlc_yellow_trips_20*`') --also tried without the ` and wildcard
query = client.run_sync_query('%s LIMIT 100' % QUERY)
query.timeout_ms = 10000
query.run()
錯誤:錯誤請求
import pandas as pd
df=pd.io.gbq.read_gbq("""
SELECT pickup_datetime, dropoff_datetime
FROM bigquery-public-data.new_york.tlc_yellow_trips_20*
LIMIT 10
""", project_id='bigquery-public-data')
錯誤:我要求給訪問熊貓,但是當我同意,我得到This site can’t be reached localhost refused to connect
。
%%bq query
SELECT pickup_datetime, dropoff_datetime
FROM bigquery-public-data.new_york.tlc_yellow_trips_20*
LIMIT 10
錯誤:只是不斷Running
任何幫助什麼我做錯了,將不勝感激。