panbingkun commented on code in PR #44049: URL: https://github.com/apache/spark/pull/44049#discussion_r1408660391
########## python/docs/source/getting_started/quickstart_df.ipynb: ########## @@ -424,76 +424,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'))" Review Comment: Oh, I understand what you mean. For this document, I have modified the style to maintain using `spark.sql.repl.eagerEval.enabled` purpose to show a pretty table format without applying any other operations in the notebook. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org