-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-46135][PYTHON][DOCS] Fix table format error in ipynb docs #44049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
6157db9
899921e
f52c1c8
b34798c
11f6454
b6fb6db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -218,27 +218,23 @@ | |
| "metadata": {}, | ||
| "outputs": [ | ||
| { | ||
| "data": { | ||
| "text/html": [ | ||
| "<table border='1'>\n", | ||
| "<tr><th>a</th><th>b</th><th>c</th><th>d</th><th>e</th></tr>\n", | ||
| "<tr><td>1</td><td>2.0</td><td>string1</td><td>2000-01-01</td><td>2000-01-01 12:00:00</td></tr>\n", | ||
| "<tr><td>2</td><td>3.0</td><td>string2</td><td>2000-02-01</td><td>2000-01-02 12:00:00</td></tr>\n", | ||
| "<tr><td>3</td><td>4.0</td><td>string3</td><td>2000-03-01</td><td>2000-01-03 12:00:00</td></tr>\n", | ||
| "</table>\n" | ||
| ], | ||
| "text/plain": [ | ||
| "DataFrame[a: bigint, b: double, c: string, d: date, e: timestamp]" | ||
| ] | ||
| }, | ||
| "execution_count": 8, | ||
| "metadata": {}, | ||
| "output_type": "execute_result" | ||
| "name": "stdout", | ||
| "output_type": "stream", | ||
| "text": [ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's present the output results in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, this example should show the output nicely as
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @HyukjinKwon Is the following presentation style appropriate for this special case? |
||
| "+---+---+-------+----------+-------------------+\n", | ||
| "| a| b| c| d| e|\n", | ||
| "+---+---+-------+----------+-------------------+\n", | ||
| "| 1|2.0|string1|2000-01-01|2000-01-01 12:00:00|\n", | ||
| "| 2|3.0|string2|2000-02-01|2000-01-02 12:00:00|\n", | ||
| "| 4|5.0|string3|2000-03-01|2000-01-03 12:00:00|\n", | ||
| "+---+---+-------+----------+-------------------+\n", | ||
| "\n" | ||
| ] | ||
| } | ||
| ], | ||
| "source": [ | ||
| "spark.conf.set('spark.sql.repl.eagerEval.enabled', True)\n", | ||
| "df" | ||
| "df.show()" | ||
| ] | ||
| }, | ||
| { | ||
|
|
@@ -424,76 +420,22 @@ | |
| "metadata": {}, | ||
| "outputs": [ | ||
| { | ||
| "data": { | ||
| "text/html": [ | ||
| "<div>\n", | ||
| "<style scoped>\n", | ||
| " .dataframe tbody tr th:only-of-type {\n", | ||
| " vertical-align: middle;\n", | ||
| " }\n", | ||
| "\n", | ||
| " .dataframe tbody tr th {\n", | ||
| " vertical-align: top;\n", | ||
| " }\n", | ||
| "\n", | ||
| " .dataframe thead th {\n", | ||
| " text-align: right;\n", | ||
| " }\n", | ||
| "</style>\n", | ||
| "<table border=\"1\" class=\"dataframe\">\n", | ||
| " <thead>\n", | ||
| " <tr style=\"text-align: right;\">\n", | ||
| " <th></th>\n", | ||
| " <th>a</th>\n", | ||
| " <th>b</th>\n", | ||
| " <th>c</th>\n", | ||
| " <th>d</th>\n", | ||
| " <th>e</th>\n", | ||
| " </tr>\n", | ||
| " </thead>\n", | ||
| " <tbody>\n", | ||
| " <tr>\n", | ||
| " <th>0</th>\n", | ||
| " <td>1</td>\n", | ||
| " <td>2.0</td>\n", | ||
| " <td>string1</td>\n", | ||
| " <td>2000-01-01</td>\n", | ||
| " <td>2000-01-01 12:00:00</td>\n", | ||
| " </tr>\n", | ||
| " <tr>\n", | ||
| " <th>1</th>\n", | ||
| " <td>2</td>\n", | ||
| " <td>3.0</td>\n", | ||
| " <td>string2</td>\n", | ||
| " <td>2000-02-01</td>\n", | ||
| " <td>2000-01-02 12:00:00</td>\n", | ||
| " </tr>\n", | ||
| " <tr>\n", | ||
| " <th>2</th>\n", | ||
| " <td>3</td>\n", | ||
| " <td>4.0</td>\n", | ||
| " <td>string3</td>\n", | ||
| " <td>2000-03-01</td>\n", | ||
| " <td>2000-01-03 12:00:00</td>\n", | ||
| " </tr>\n", | ||
| " </tbody>\n", | ||
| "</table>\n", | ||
| "</div>" | ||
| ], | ||
| "text/plain": [ | ||
| " a b c d e\n", | ||
| "0 1 2.0 string1 2000-01-01 2000-01-01 12:00:00\n", | ||
| "1 2 3.0 string2 2000-02-01 2000-01-02 12:00:00\n", | ||
| "2 3 4.0 string3 2000-03-01 2000-01-03 12:00:00" | ||
| ] | ||
| }, | ||
| "execution_count": 15, | ||
| "metadata": {}, | ||
| "output_type": "execute_result" | ||
| "name": "stdout", | ||
| "output_type": "stream", | ||
| "text": [ | ||
| "+----+-----+-----+---------+------------+---------------------+\n", | ||
| "| | a | b | c | d | e |\n", | ||
| "|----+-----+-----+---------+------------+---------------------|\n", | ||
| "| 0 | 1 | 2 | string1 | 2000-01-01 | 2000-01-01 12:00:00 |\n", | ||
| "| 1 | 2 | 3 | string2 | 2000-02-01 | 2000-01-02 12:00:00 |\n", | ||
| "| 2 | 4 | 5 | string3 | 2000-03-01 | 2000-01-03 12:00:00 |\n", | ||
| "+----+-----+-----+---------+------------+---------------------+\n" | ||
| ] | ||
| } | ||
| ], | ||
| "source": [ | ||
| "df.toPandas()" | ||
| "from tabulate import tabulate\n", | ||
| "print(tabulate(df.toPandas(), headers = 'keys', tablefmt = 'psql'))" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, the output format looks fine but the whole point of using Can you maybe just manually fix the output
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I understand what you mean.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ] | ||
| }, | ||
| { | ||
|
|
||





There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, I made some changes because currently our scala version is
2.13,2.12is no longer supported.