How can I create from scratch a brand new Dataframe with Null values using spark.createDataFrame()?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2021 09:30 AM
from pyspark.sql.types import *
schema = StructType([
StructField("c1", IntegerType(), True),
StructField("c2", StringType(), True),
StructField("c3", StringType(), True)])
df = spark.createDataFrame([(1, "2", None), (3, "4", None)], schema)
Labels:
- Labels:
-
Null
-
Null Values
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2021 05:09 PM
df = spark.createDataFrame(sc.emptyRDD(), schema)Can you try this?