Last active
May 4, 2021 09:55
-
-
Save romeokienzler/208146a03eb65d3531a003b5d26b257d 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
from pyspark.sql import SparkSession | |
spark = SparkSession\ | |
.builder\ | |
.appName("PythonPi")\ | |
.getOrCreate() | |
df = spark.createDataFrame( | |
[ | |
(1, "foo"), # create your data here, be consistent in the types. | |
(2, "bar"), | |
], | |
["id", "label"] # add your column names here | |
) | |
df.printSchema() | |
df.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment