{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "authorship_tag": "ABX9TyMUrEo6U7KnbBgVe+nkhJAG" }, "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.nflx_prices`\n", "WHERE CAST(Date AS DATE) >= DATE_SUB(CURRENT_DATE(), INTERVAL 5 YEAR)\n", "\"\"\"\n", "\n", "nflx_df = client.query(query).to_dataframe()" ], "metadata": { "id": "sGFV69ULSWkO" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "nflx_df.head(10)\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 363 }, "id": "xmtCUgUTS4FP", "outputId": "b444a9c3-4414-4c37-c5f0-e10cca3a94fb" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " Date Open High Low Close \\\n", "0 2019-11-04 00:00:00+00:00 288.00 295.390015 287.160004 292.859985 \n", "1 2022-12-12 00:00:00+00:00 320.00 323.179993 308.850006 315.179993 \n", "2 2022-03-04 00:00:00+00:00 368.00 374.820007 357.170013 361.730011 \n", "3 2020-06-08 00:00:00+00:00 416.00 420.799988 406.500000 419.489990 \n", "4 2023-08-29 00:00:00+00:00 416.00 432.170013 414.500000 429.989990 \n", "5 2020-11-16 00:00:00+00:00 480.00 485.579987 477.299988 479.100006 \n", "6 2024-04-01 00:00:00+00:00 608.00 615.109985 605.570007 614.309998 \n", "7 2022-02-02 00:00:00+00:00 448.25 451.980011 426.480011 429.480011 \n", "8 2021-03-12 00:00:00+00:00 512.50 526.510010 506.589996 518.020020 \n", "9 2021-08-04 00:00:00+00:00 513.00 517.979980 510.369995 517.349976 \n", "\n", " Adj Close Volume Ticker \n", "0 292.859985 5566200 NFLX \n", "1 315.179993 10148600 NFLX \n", "2 361.730011 5325500 NFLX \n", "3 419.489990 5851500 NFLX \n", "4 429.989990 4486700 NFLX \n", "5 479.100006 3953600 NFLX \n", "6 614.309998 2115900 NFLX \n", "7 429.480011 14346000 NFLX \n", "8 518.020020 3981700 NFLX \n", "9 517.349976 2039400 NFLX " ], "text/html": [ "\n", "
\n", " | Date | \n", "Open | \n", "High | \n", "Low | \n", "Close | \n", "Adj Close | \n", "Volume | \n", "Ticker | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "2019-11-04 00:00:00+00:00 | \n", "288.00 | \n", "295.390015 | \n", "287.160004 | \n", "292.859985 | \n", "292.859985 | \n", "5566200 | \n", "NFLX | \n", "
1 | \n", "2022-12-12 00:00:00+00:00 | \n", "320.00 | \n", "323.179993 | \n", "308.850006 | \n", "315.179993 | \n", "315.179993 | \n", "10148600 | \n", "NFLX | \n", "
2 | \n", "2022-03-04 00:00:00+00:00 | \n", "368.00 | \n", "374.820007 | \n", "357.170013 | \n", "361.730011 | \n", "361.730011 | \n", "5325500 | \n", "NFLX | \n", "
3 | \n", "2020-06-08 00:00:00+00:00 | \n", "416.00 | \n", "420.799988 | \n", "406.500000 | \n", "419.489990 | \n", "419.489990 | \n", "5851500 | \n", "NFLX | \n", "
4 | \n", "2023-08-29 00:00:00+00:00 | \n", "416.00 | \n", "432.170013 | \n", "414.500000 | \n", "429.989990 | \n", "429.989990 | \n", "4486700 | \n", "NFLX | \n", "
5 | \n", "2020-11-16 00:00:00+00:00 | \n", "480.00 | \n", "485.579987 | \n", "477.299988 | \n", "479.100006 | \n", "479.100006 | \n", "3953600 | \n", "NFLX | \n", "
6 | \n", "2024-04-01 00:00:00+00:00 | \n", "608.00 | \n", "615.109985 | \n", "605.570007 | \n", "614.309998 | \n", "614.309998 | \n", "2115900 | \n", "NFLX | \n", "
7 | \n", "2022-02-02 00:00:00+00:00 | \n", "448.25 | \n", "451.980011 | \n", "426.480011 | \n", "429.480011 | \n", "429.480011 | \n", "14346000 | \n", "NFLX | \n", "
8 | \n", "2021-03-12 00:00:00+00:00 | \n", "512.50 | \n", "526.510010 | \n", "506.589996 | \n", "518.020020 | \n", "518.020020 | \n", "3981700 | \n", "NFLX | \n", "
9 | \n", "2021-08-04 00:00:00+00:00 | \n", "513.00 | \n", "517.979980 | \n", "510.369995 | \n", "517.349976 | \n", "517.349976 | \n", "2039400 | \n", "NFLX | \n", "