공부
[Java][Spark] rename column - df = df.withColumnRenamed("colName", "newColName")
승가비
2021. 9. 11. 08:38
728x90
df = df.withColumnRenamed("colName", "newColName")\
.withColumnRenamed("colName2", "newColName2")
https://stackoverflow.com/questions/34077353/how-to-change-dataframe-column-names-in-pyspark
How to change dataframe column names in pyspark?
I come from pandas background and am used to reading data from CSV files into a dataframe and then simply changing the column names to something useful using the simple command: df.columns =
stackoverflow.com
728x90