Created
December 20, 2021 11:24
-
-
Save 1ambda/8e99398b8dcc496fb721fe2dff1f20b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 컬럼을 선택하고 이름을 변경합니다. | |
# SQL 의 SELECT 'ID' as id, 'Year_Birth' as 'year_birth'... 과 동일합니다. | |
dfSelected = df.select( | |
col("ID").alias("id"), | |
col("Year_Birth").alias("year_birth"), | |
col("Education").alias("education"), | |
col("Kidhome").alias("count_kid"), | |
col("Teenhome").alias("count_teen"), | |
col("Dt_Customer").alias("date_customer"), | |
col("Recency").alias("days_last_login") | |
) | |
dfSelected.count() | |
dfSelected.printSchema() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment