|
4 | 4 | "metadata": {
|
5 | 5 | "colab": {
|
6 | 6 | "provenance": [],
|
7 |
| - "authorship_tag": "ABX9TyP/PsSJyKDfLHGFwZVAJl79", |
| 7 | + "authorship_tag": "ABX9TyNxAkUJklJhGRAUU039mAKM", |
8 | 8 | "include_colab_link": true
|
9 | 9 | },
|
10 | 10 | "kernelspec": {
|
|
37 | 37 | },
|
38 | 38 | {
|
39 | 39 | "cell_type": "code",
|
40 |
| - "execution_count": null, |
| 40 | + "execution_count": 19, |
41 | 41 | "metadata": {
|
42 | 42 | "id": "N6iVXJp7jQME"
|
43 | 43 | },
|
|
65 | 65 | "base_uri": "https://localhost:8080/"
|
66 | 66 | },
|
67 | 67 | "id": "DFAon71alA3W",
|
68 |
| - "outputId": "d85f7c64-1165-4048-9a15-ee1da3cf1969" |
| 68 | + "outputId": "f4104f2a-2fcb-4898-da2e-ecacac21bdf1" |
69 | 69 | },
|
70 |
| - "execution_count": null, |
| 70 | + "execution_count": 22, |
71 | 71 | "outputs": [
|
72 | 72 | {
|
73 | 73 | "output_type": "stream",
|
74 | 74 | "name": "stdout",
|
75 | 75 | "text": [
|
76 |
| - "Requirement already satisfied: PySpark in /usr/local/lib/python3.11/dist-packages (3.5.4)\n", |
| 76 | + "Requirement already satisfied: PySpark in /usr/local/lib/python3.11/dist-packages (3.5.5)\n", |
77 | 77 | "Requirement already satisfied: py4j==0.10.9.7 in /usr/local/lib/python3.11/dist-packages (from PySpark) (0.10.9.7)\n"
|
78 | 78 | ]
|
79 | 79 | }
|
|
98 | 98 | "metadata": {
|
99 | 99 | "id": "bMpAL_cPmfH8"
|
100 | 100 | },
|
101 |
| - "execution_count": null, |
| 101 | + "execution_count": 24, |
102 | 102 | "outputs": []
|
103 | 103 | },
|
104 | 104 | {
|
|
128 | 128 | "base_uri": "https://localhost:8080/"
|
129 | 129 | },
|
130 | 130 | "id": "m_uZfJ20pfGn",
|
131 |
| - "outputId": "f5911b7c-275f-42d5-9072-f0dd910b0dfa" |
| 131 | + "outputId": "8f0000de-e0d7-48fa-9ec3-7aebc2aa348f" |
132 | 132 | },
|
133 |
| - "execution_count": null, |
| 133 | + "execution_count": 25, |
134 | 134 | "outputs": [
|
135 | 135 | {
|
136 | 136 | "output_type": "stream",
|
|
232 | 232 | "base_uri": "https://localhost:8080/"
|
233 | 233 | },
|
234 | 234 | "id": "McHKdq5sv-VT",
|
235 |
| - "outputId": "645d537b-68c9-4527-dbe5-95d7b6cbca4d" |
| 235 | + "outputId": "8c4ed271-bdc8-4f37-b422-d803f453d4a0" |
236 | 236 | },
|
237 |
| - "execution_count": null, |
| 237 | + "execution_count": 26, |
238 | 238 | "outputs": [
|
239 | 239 | {
|
240 | 240 | "output_type": "stream",
|
|
300 | 300 | "cell_type": "code",
|
301 | 301 | "source": [
|
302 | 302 | "daily_sales.show(10)\n",
|
| 303 | + "\n", |
| 304 | + "#Sort the date.\n", |
303 | 305 | "daily_sales = daily_sales.sort('Order_Date')\n",
|
304 | 306 | "daily_sales.show(10)"
|
305 | 307 | ],
|
306 | 308 | "metadata": {
|
307 | 309 | "id": "N0Fqk2wHNFUB",
|
308 |
| - "outputId": "91b1cc0a-8547-4a22-d75f-e59c9cf72e31", |
| 310 | + "outputId": "9a4423e6-f3e6-4cc1-dbe0-1ae070f14fa1", |
309 | 311 | "colab": {
|
310 |
| - "base_uri": "https://localhost:8080/", |
311 |
| - "height": 176 |
| 312 | + "base_uri": "https://localhost:8080/" |
312 | 313 | }
|
313 | 314 | },
|
314 |
| - "execution_count": 1, |
| 315 | + "execution_count": 27, |
315 | 316 | "outputs": [
|
316 | 317 | {
|
317 |
| - "output_type": "error", |
318 |
| - "ename": "NameError", |
319 |
| - "evalue": "name 'daily_sales' is not defined", |
320 |
| - "traceback": [ |
321 |
| - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
322 |
| - "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", |
323 |
| - "\u001b[0;32m<ipython-input-1-9ccd588ae7a1>\u001b[0m in \u001b[0;36m<cell line: 0>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mdaily_sales\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshow\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mdaily_sales\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdaily_sales\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msort\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Order_Date'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mdaily_sales\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshow\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
324 |
| - "\u001b[0;31mNameError\u001b[0m: name 'daily_sales' is not defined" |
| 318 | + "output_type": "stream", |
| 319 | + "name": "stdout", |
| 320 | + "text": [ |
| 321 | + "+----------+------------------+\n", |
| 322 | + "|Order_Date| Daily_Sales|\n", |
| 323 | + "+----------+------------------+\n", |
| 324 | + "|2021-08-27| 2070.13|\n", |
| 325 | + "|2024-09-18|1454.7299999999998|\n", |
| 326 | + "|2021-06-22| 1975.498|\n", |
| 327 | + "|2022-03-28| 243.344|\n", |
| 328 | + "|2022-07-31| 3712.162|\n", |
| 329 | + "|2023-07-15| 380.2|\n", |
| 330 | + "|2021-10-11| 1381.164|\n", |
| 331 | + "|2021-01-27| 426.67|\n", |
| 332 | + "|2023-11-08| 993.9000000000001|\n", |
| 333 | + "|2024-08-27|5992.0779999999995|\n", |
| 334 | + "+----------+------------------+\n", |
| 335 | + "only showing top 10 rows\n", |
| 336 | + "\n", |
| 337 | + "+----------+-----------------+\n", |
| 338 | + "|Order_Date| Daily_Sales|\n", |
| 339 | + "+----------+-----------------+\n", |
| 340 | + "| NULL| 111.104|\n", |
| 341 | + "|2021-01-03| NULL|\n", |
| 342 | + "|2021-01-04| 288.06|\n", |
| 343 | + "|2021-01-05| 19.536|\n", |
| 344 | + "|2021-01-06| 4407.1|\n", |
| 345 | + "|2021-01-07|87.15799999999999|\n", |
| 346 | + "|2021-01-09| 40.544|\n", |
| 347 | + "|2021-01-10| 54.83|\n", |
| 348 | + "|2021-01-11| 9.94|\n", |
| 349 | + "|2021-01-13| 3553.795|\n", |
| 350 | + "+----------+-----------------+\n", |
| 351 | + "only showing top 10 rows\n", |
| 352 | + "\n" |
325 | 353 | ]
|
326 | 354 | }
|
327 | 355 | ]
|
|
0 commit comments