Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9c08dd2

Browse files
committed
Created using Colab
1 parent34ada04 commit9c08dd2

File tree

1 file changed

+50
-22
lines changed

1 file changed

+50
-22
lines changed

‎PySpark.ipynb

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"metadata": {
55
"colab": {
66
"provenance": [],
7-
"authorship_tag":"ABX9TyP/PsSJyKDfLHGFwZVAJl79",
7+
"authorship_tag":"ABX9TyNxAkUJklJhGRAUU039mAKM",
88
"include_colab_link":true
99
},
1010
"kernelspec": {
@@ -37,7 +37,7 @@
3737
},
3838
{
3939
"cell_type":"code",
40-
"execution_count":null,
40+
"execution_count":19,
4141
"metadata": {
4242
"id":"N6iVXJp7jQME"
4343
},
@@ -65,15 +65,15 @@
6565
"base_uri":"https://localhost:8080/"
6666
},
6767
"id":"DFAon71alA3W",
68-
"outputId":"d85f7c64-1165-4048-9a15-ee1da3cf1969"
68+
"outputId":"f4104f2a-2fcb-4898-da2e-ecacac21bdf1"
6969
},
70-
"execution_count":null,
70+
"execution_count":22,
7171
"outputs": [
7272
{
7373
"output_type":"stream",
7474
"name":"stdout",
7575
"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",
7777
"Requirement already satisfied: py4j==0.10.9.7 in /usr/local/lib/python3.11/dist-packages (from PySpark) (0.10.9.7)\n"
7878
]
7979
}
@@ -98,7 +98,7 @@
9898
"metadata": {
9999
"id":"bMpAL_cPmfH8"
100100
},
101-
"execution_count":null,
101+
"execution_count":24,
102102
"outputs": []
103103
},
104104
{
@@ -128,9 +128,9 @@
128128
"base_uri":"https://localhost:8080/"
129129
},
130130
"id":"m_uZfJ20pfGn",
131-
"outputId":"f5911b7c-275f-42d5-9072-f0dd910b0dfa"
131+
"outputId":"8f0000de-e0d7-48fa-9ec3-7aebc2aa348f"
132132
},
133-
"execution_count":null,
133+
"execution_count":25,
134134
"outputs": [
135135
{
136136
"output_type":"stream",
@@ -232,9 +232,9 @@
232232
"base_uri":"https://localhost:8080/"
233233
},
234234
"id":"McHKdq5sv-VT",
235-
"outputId":"645d537b-68c9-4527-dbe5-95d7b6cbca4d"
235+
"outputId":"8c4ed271-bdc8-4f37-b422-d803f453d4a0"
236236
},
237-
"execution_count":null,
237+
"execution_count":26,
238238
"outputs": [
239239
{
240240
"output_type":"stream",
@@ -300,28 +300,56 @@
300300
"cell_type":"code",
301301
"source": [
302302
"daily_sales.show(10)\n",
303+
"\n",
304+
"#Sort the date.\n",
303305
"daily_sales = daily_sales.sort('Order_Date')\n",
304306
"daily_sales.show(10)"
305307
],
306308
"metadata": {
307309
"id":"N0Fqk2wHNFUB",
308-
"outputId":"91b1cc0a-8547-4a22-d75f-e59c9cf72e31",
310+
"outputId":"9a4423e6-f3e6-4cc1-dbe0-1ae070f14fa1",
309311
"colab": {
310-
"base_uri":"https://localhost:8080/",
311-
"height":176
312+
"base_uri":"https://localhost:8080/"
312313
}
313314
},
314-
"execution_count":1,
315+
"execution_count":27,
315316
"outputs": [
316317
{
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"
325353
]
326354
}
327355
]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp