Skip to content

Instantly share code, notes, and snippets.

@romeokienzler
Last active May 4, 2021 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romeokienzler/208146a03eb65d3531a003b5d26b257d to your computer and use it in GitHub Desktop.
Save romeokienzler/208146a03eb65d3531a003b5d26b257d to your computer and use it in GitHub Desktop.
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