I'm trying to understand the use of map
function and that underscore _
in the code below. keys
is a List[String]
and df
is a DateFrame
. I run an sample and found out listOfVal is a list of column type, but could someone help to explain how this works? What does _
mean in this case and what gets applied by map
fuction? Many thanks
val listOfVal = keys.map(df(_))
ps: I've read the two questions suggested but I think they are different use cases