How to view the DataFrames
There are different statements in Spark to view data. The DataFrames that we created in the previous section through different methods all yield the same result as the DataFrame. Let’s look at a few different ways to view DataFrames.
Viewing DataFrames
The first way to show a DataFrame is through the DataFrame.show()
statement. Here’s an example:
data_df.show()
As a result, you will see a DataFrame with our specified columns and the data inside this DataFrame:
+-----+-----+-------------+----------+-------------------+ |col_1|col_2| col_3 | col_4 | col_5 | +-----+-----+-------------+----------+-------------------+ | 100|200.0|string_test_1|2023-01-01|2023-01-01 12:00:00| | 200|300.0|string_test_2|2023-02-01|2023-01-02 12:00:00| | 300|400.0|string_test_3...