- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 02:20 PM
Hey everyone, I'm avoiding repeating the When Function for 12x, so I thought of the dictionary. I don't know if it's a limitation of the Spark function or a Logic error. Does the function allow this concatenation?
- Labels:
-
Function
-
Python Dictionary
-
Withcolumn
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 09:05 AM
Hello everyone, I found this alternative to reduce repeated code.
custoDF = (custoDF.withColumn('month', col('Nummes').cast('string'))
.replace(months, subset=['month']))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 03:50 PM
@Werner Stinckens, @pat, @Hubert Dudek Have you ever done something similar?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 09:43 PM
I have read some good stuff here. Certainly price bookmarking for revisiting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 09:05 AM
Hello everyone, I found this alternative to reduce repeated code.
custoDF = (custoDF.withColumn('month', col('Nummes').cast('string'))
.replace(months, subset=['month']))

