티스토리 뷰

728x90

https://stackoverflow.com/questions/32788322/how-to-add-a-constant-column-in-a-spark-dataframe

 

How to add a constant column in a Spark DataFrame?

I want to add a column in a DataFrame with some arbitrary value (that is the same for each row). I get an error when I use withColumn as follows: dt.withColumn('new_column', 10).head(5) ---------...

stackoverflow.com

 

728x90
댓글