{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "authorship_tag": "ABX9TyN35ekiQa0FSFn1a0DH0KEq" }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "code", "source": [ "query = \"\"\"\n", "SELECT *\n", "FROM `stockprediction-434721.stock_data.amzn_prices`\n", "WHERE CAST(Date AS DATE) >= DATE_SUB(CURRENT_DATE(), INTERVAL 5 YEAR)\n", "\"\"\"\n", "\n", "amzn_df = client.query(query).to_dataframe()" ], "metadata": { "id": "sGFV69ULSWkO" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "amzn_df.head(10)\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 363 }, "id": "xmtCUgUTS4FP", "outputId": "5267f9e1-7fa8-4660-f51c-3d2c8e720677" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " Date Open High Low Close \\\n", "0 2019-12-03 00:00:00+00:00 88.00 88.643501 87.361504 88.498001 \n", "1 2022-09-23 00:00:00+00:00 116.00 116.050003 112.059998 113.779999 \n", "2 2022-10-26 00:00:00+00:00 116.00 119.349998 114.760002 115.660004 \n", "3 2024-04-04 00:00:00+00:00 184.00 185.100006 180.000000 180.000000 \n", "4 2024-07-10 00:00:00+00:00 200.00 200.110001 197.690002 199.789993 \n", "5 2023-07-06 00:00:00+00:00 128.25 128.729996 127.370003 128.360001 \n", "6 2020-12-23 00:00:00+00:00 160.25 160.506500 159.208496 159.263504 \n", "7 2019-12-13 00:00:00+00:00 88.25 88.449501 87.750000 88.046997 \n", "8 2020-10-09 00:00:00+00:00 160.50 164.449493 159.891495 164.332504 \n", "9 2021-11-04 00:00:00+00:00 168.50 174.931503 168.250000 173.850006 \n", "\n", " Adj Close Volume Ticker \n", "0 88.498001 67618000 AMZN \n", "1 113.779999 65126700 AMZN \n", "2 115.660004 68802300 AMZN \n", "3 180.000000 41624300 AMZN \n", "4 199.789993 32883800 AMZN \n", "5 128.360001 40639900 AMZN \n", "6 159.263504 41876000 AMZN \n", "7 88.046997 54914000 AMZN \n", "8 164.332504 98158000 AMZN \n", "9 173.850006 107060000 AMZN " ], "text/html": [ "\n", "
\n", " | Date | \n", "Open | \n", "High | \n", "Low | \n", "Close | \n", "Adj Close | \n", "Volume | \n", "Ticker | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "2019-12-03 00:00:00+00:00 | \n", "88.00 | \n", "88.643501 | \n", "87.361504 | \n", "88.498001 | \n", "88.498001 | \n", "67618000 | \n", "AMZN | \n", "
1 | \n", "2022-09-23 00:00:00+00:00 | \n", "116.00 | \n", "116.050003 | \n", "112.059998 | \n", "113.779999 | \n", "113.779999 | \n", "65126700 | \n", "AMZN | \n", "
2 | \n", "2022-10-26 00:00:00+00:00 | \n", "116.00 | \n", "119.349998 | \n", "114.760002 | \n", "115.660004 | \n", "115.660004 | \n", "68802300 | \n", "AMZN | \n", "
3 | \n", "2024-04-04 00:00:00+00:00 | \n", "184.00 | \n", "185.100006 | \n", "180.000000 | \n", "180.000000 | \n", "180.000000 | \n", "41624300 | \n", "AMZN | \n", "
4 | \n", "2024-07-10 00:00:00+00:00 | \n", "200.00 | \n", "200.110001 | \n", "197.690002 | \n", "199.789993 | \n", "199.789993 | \n", "32883800 | \n", "AMZN | \n", "
5 | \n", "2023-07-06 00:00:00+00:00 | \n", "128.25 | \n", "128.729996 | \n", "127.370003 | \n", "128.360001 | \n", "128.360001 | \n", "40639900 | \n", "AMZN | \n", "
6 | \n", "2020-12-23 00:00:00+00:00 | \n", "160.25 | \n", "160.506500 | \n", "159.208496 | \n", "159.263504 | \n", "159.263504 | \n", "41876000 | \n", "AMZN | \n", "
7 | \n", "2019-12-13 00:00:00+00:00 | \n", "88.25 | \n", "88.449501 | \n", "87.750000 | \n", "88.046997 | \n", "88.046997 | \n", "54914000 | \n", "AMZN | \n", "
8 | \n", "2020-10-09 00:00:00+00:00 | \n", "160.50 | \n", "164.449493 | \n", "159.891495 | \n", "164.332504 | \n", "164.332504 | \n", "98158000 | \n", "AMZN | \n", "
9 | \n", "2021-11-04 00:00:00+00:00 | \n", "168.50 | \n", "174.931503 | \n", "168.250000 | \n", "173.850006 | \n", "173.850006 | \n", "107060000 | \n", "AMZN | \n", "