我已经在我的Google Cloud数据实验室中创建了一个数据集,我想在Google Colab中继续对其进行处理(使用Python)。我不知道如何将我的数据集导出到Google Colab (或Jupyter)。你能帮我搬一下吗?
这是我在Google Datalab中的数据集:
%sql --module afewrecords
Select pickup_datetime, dropoff_datetime, pickup_longitude,
pickup_latitude, dropoff_longitude, dropoff_latitude, passenger_count,
trip_distance, tolls_amount, fare_amount, total_amount
From [nyc-tlc:yellow.trips] LIMIT 10
trips = bq.Query(afewrecords).to_dataframe()
trips
我想在谷歌Colab旅行。
提前谢谢。
发布于 2021-03-11 10:40:19
为了将BigQuery数据读取到Colab实例中的DataFrame中,您需要:
如果没有one;
完成这些步骤后,您可以使用文档中的this snippet。请注意,from google.colab import auth auth.authenticate_user()
会对您访问BigQuery的请求进行身份验证。此外,您还将使用pd.io.gbq.read_gbq()
来编写查询。
https://stackoverflow.com/questions/66552837
复制