Answers for "how to add row in spark dataframe"

1

how to add row in spark dataframe

# Create hard coded row
unknown_list = [[‘0’, ‘Unknown’]]
# turn row into dataframe
unknown_df = spark.createDataFrame(unknown_list)
# union with existing dataframe
df = df.union(unknown_df)
Posted by: Guest on November-30-2020

Code answers related to "how to add row in spark dataframe"

Python Answers by Framework

Browse Popular Code Answers by Language