Created
December 19, 2021 03:41
-
-
Save RaMSFT/c5fa16ee946482030b406644232d099f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create a python list of tupels list_of_cars | |
| list_of_cars = [(1,'Honda'),(2,'BMW'), (3,'Ford'),(4,'Toyota'),(5,'Skoda'),(6,'Mercedes'),(7,'Tata'),(8,'Audi')] | |
| # create a list with columns of above data | |
| columns = ['id','car_brands'] | |
| #Create dataframe using createDataFrame method | |
| list_dataframe = spark.createDataFrame(list_of_cars, columns) | |
| # Show the data from dataframe | |
| list_dataframe.show() | |
| # Display the data from dataframe - in a table format | |
| list_dataframe.display() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment