{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "authorship_tag": "ABX9TyOq+cLOuNHzZQHrVJ2p98+g" }, "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.meta_prices`\n", "WHERE CAST(Date AS DATE) >= DATE_SUB(CURRENT_DATE(), INTERVAL 5 YEAR)\n", "\"\"\"\n", "\n", "meta_df = client.query(query).to_dataframe()" ], "metadata": { "id": "sGFV69ULSWkO" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "meta_df.head(10)\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 363 }, "id": "xmtCUgUTS4FP", "outputId": "d58b7d13-c887-457e-e13d-0503585d9d4b" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " Date Open High Low Close \\\n", "0 2022-06-09 00:00:00+00:00 194.279999 199.449997 183.679993 184.00 \n", "1 2022-02-09 00:00:00+00:00 224.199997 233.369995 222.210007 232.00 \n", "2 2021-03-30 00:00:00+00:00 289.829987 292.470001 286.700012 288.00 \n", "3 2020-04-16 00:00:00+00:00 177.949997 178.050003 172.509995 176.25 \n", "4 2021-06-15 00:00:00+00:00 336.989990 339.920013 335.029999 336.75 \n", "5 2020-06-15 00:00:00+00:00 225.089996 233.770004 224.800003 232.50 \n", "6 2021-11-23 00:00:00+00:00 338.929993 341.399994 333.500000 337.25 \n", "7 2021-03-15 00:00:00+00:00 269.079987 275.959991 268.500000 273.75 \n", "8 2022-06-30 00:00:00+00:00 162.149994 165.229996 158.490005 161.25 \n", "9 2023-03-03 00:00:00+00:00 178.919998 186.619995 177.050003 185.25 \n", "\n", " Adj Close Volume Ticker \n", "0 183.622665 23501600 META \n", "1 231.524231 86563300 META \n", "2 287.409393 17474500 META \n", "3 175.888565 23593200 META \n", "4 336.059448 15795200 META \n", "5 232.023209 15340300 META \n", "6 336.558380 17225000 META \n", "7 273.188629 16844800 META \n", "8 160.919312 35250600 META \n", "9 184.870102 45877700 META " ], "text/html": [ "\n", "
\n", " | Date | \n", "Open | \n", "High | \n", "Low | \n", "Close | \n", "Adj Close | \n", "Volume | \n", "Ticker | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "2022-06-09 00:00:00+00:00 | \n", "194.279999 | \n", "199.449997 | \n", "183.679993 | \n", "184.00 | \n", "183.622665 | \n", "23501600 | \n", "META | \n", "
1 | \n", "2022-02-09 00:00:00+00:00 | \n", "224.199997 | \n", "233.369995 | \n", "222.210007 | \n", "232.00 | \n", "231.524231 | \n", "86563300 | \n", "META | \n", "
2 | \n", "2021-03-30 00:00:00+00:00 | \n", "289.829987 | \n", "292.470001 | \n", "286.700012 | \n", "288.00 | \n", "287.409393 | \n", "17474500 | \n", "META | \n", "
3 | \n", "2020-04-16 00:00:00+00:00 | \n", "177.949997 | \n", "178.050003 | \n", "172.509995 | \n", "176.25 | \n", "175.888565 | \n", "23593200 | \n", "META | \n", "
4 | \n", "2021-06-15 00:00:00+00:00 | \n", "336.989990 | \n", "339.920013 | \n", "335.029999 | \n", "336.75 | \n", "336.059448 | \n", "15795200 | \n", "META | \n", "
5 | \n", "2020-06-15 00:00:00+00:00 | \n", "225.089996 | \n", "233.770004 | \n", "224.800003 | \n", "232.50 | \n", "232.023209 | \n", "15340300 | \n", "META | \n", "
6 | \n", "2021-11-23 00:00:00+00:00 | \n", "338.929993 | \n", "341.399994 | \n", "333.500000 | \n", "337.25 | \n", "336.558380 | \n", "17225000 | \n", "META | \n", "
7 | \n", "2021-03-15 00:00:00+00:00 | \n", "269.079987 | \n", "275.959991 | \n", "268.500000 | \n", "273.75 | \n", "273.188629 | \n", "16844800 | \n", "META | \n", "
8 | \n", "2022-06-30 00:00:00+00:00 | \n", "162.149994 | \n", "165.229996 | \n", "158.490005 | \n", "161.25 | \n", "160.919312 | \n", "35250600 | \n", "META | \n", "
9 | \n", "2023-03-03 00:00:00+00:00 | \n", "178.919998 | \n", "186.619995 | \n", "177.050003 | \n", "185.25 | \n", "184.870102 | \n", "45877700 | \n", "META | \n", "