{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "authorship_tag": "ABX9TyP+Ts9Br/cCHZxE06VWX1KE" }, "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.google_prices`\n", "WHERE CAST(Date AS DATE) >= DATE_SUB(CURRENT_DATE(), INTERVAL 5 YEAR)\n", "\"\"\"\n", "\n", "google_df = client.query(query).to_dataframe()" ], "metadata": { "id": "lUR3konIQ-kG" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "googl_df.head(10)" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 363 }, "id": "CQdtnEGsS1lY", "outputId": "bdf20911-8eee-4e51-e02d-4aed6ef3b51d" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " Date Open High Low Close \\\n", "0 2023-03-02 00:00:00+00:00 89.660004 92.279999 89.589996 92.0000 \n", "1 2020-11-05 00:00:00+00:00 88.522499 89.591003 87.051498 88.1250 \n", "2 2023-11-20 00:00:00+00:00 133.690002 136.660004 133.619995 136.2500 \n", "3 2023-10-23 00:00:00+00:00 135.039993 137.660004 133.949997 136.5000 \n", "4 2024-04-05 00:00:00+00:00 150.029999 153.419998 149.600006 152.5000 \n", "5 2021-03-08 00:00:00+00:00 104.203003 105.686996 100.259499 100.3750 \n", "6 2021-02-11 00:00:00+00:00 104.550003 104.699997 103.443001 104.4375 \n", "7 2023-04-18 00:00:00+00:00 106.489998 106.540001 104.070000 104.5000 \n", "8 2023-10-19 00:00:00+00:00 138.500000 139.660004 137.380005 137.7500 \n", "9 2022-09-14 00:00:00+00:00 104.570000 105.279999 103.660004 105.0000 \n", "\n", " Adj Close Volume Ticker \n", "0 91.894531 32204400 GOOGL \n", "1 88.023979 39758000 GOOGL \n", "2 136.093811 27815500 GOOGL \n", "3 136.343521 26317900 GOOGL \n", "4 152.325180 23449300 GOOGL \n", "5 100.259933 36868000 GOOGL \n", "6 104.317772 20480000 GOOGL \n", "7 104.380203 26596400 GOOGL \n", "8 137.592087 26066000 GOOGL \n", "9 104.879631 26395100 GOOGL " ], "text/html": [ "\n", "
\n", " | Date | \n", "Open | \n", "High | \n", "Low | \n", "Close | \n", "Adj Close | \n", "Volume | \n", "Ticker | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "2023-03-02 00:00:00+00:00 | \n", "89.660004 | \n", "92.279999 | \n", "89.589996 | \n", "92.0000 | \n", "91.894531 | \n", "32204400 | \n", "GOOGL | \n", "
1 | \n", "2020-11-05 00:00:00+00:00 | \n", "88.522499 | \n", "89.591003 | \n", "87.051498 | \n", "88.1250 | \n", "88.023979 | \n", "39758000 | \n", "GOOGL | \n", "
2 | \n", "2023-11-20 00:00:00+00:00 | \n", "133.690002 | \n", "136.660004 | \n", "133.619995 | \n", "136.2500 | \n", "136.093811 | \n", "27815500 | \n", "GOOGL | \n", "
3 | \n", "2023-10-23 00:00:00+00:00 | \n", "135.039993 | \n", "137.660004 | \n", "133.949997 | \n", "136.5000 | \n", "136.343521 | \n", "26317900 | \n", "GOOGL | \n", "
4 | \n", "2024-04-05 00:00:00+00:00 | \n", "150.029999 | \n", "153.419998 | \n", "149.600006 | \n", "152.5000 | \n", "152.325180 | \n", "23449300 | \n", "GOOGL | \n", "
5 | \n", "2021-03-08 00:00:00+00:00 | \n", "104.203003 | \n", "105.686996 | \n", "100.259499 | \n", "100.3750 | \n", "100.259933 | \n", "36868000 | \n", "GOOGL | \n", "
6 | \n", "2021-02-11 00:00:00+00:00 | \n", "104.550003 | \n", "104.699997 | \n", "103.443001 | \n", "104.4375 | \n", "104.317772 | \n", "20480000 | \n", "GOOGL | \n", "
7 | \n", "2023-04-18 00:00:00+00:00 | \n", "106.489998 | \n", "106.540001 | \n", "104.070000 | \n", "104.5000 | \n", "104.380203 | \n", "26596400 | \n", "GOOGL | \n", "
8 | \n", "2023-10-19 00:00:00+00:00 | \n", "138.500000 | \n", "139.660004 | \n", "137.380005 | \n", "137.7500 | \n", "137.592087 | \n", "26066000 | \n", "GOOGL | \n", "
9 | \n", "2022-09-14 00:00:00+00:00 | \n", "104.570000 | \n", "105.279999 | \n", "103.660004 | \n", "105.0000 | \n", "104.879631 | \n", "26395100 | \n", "GOOGL | \n", "