In the Scala DataFrame API, the select
method takes a variable number of arguments. In the method signature, this is denoted by a *
as in the following example:
// Greet many people
def greet(who: String*): String = ???
// all valid calls
greet()
greet("world")
greet("alice", "bob")
The :
token is used to give a hint to the compiler regarding the type of the argument and the _*
in this case is used to specify that we are passing a collection as a list of arguments:
def people: Seq[String] = getPeopleToGreet()
greet(people) // won't compile
greet(people: _*) // passes the collection of people as a list of arguments -- works
Not sure of how the Python API works, but from my experience I imagine you can either pass a single value or an array, so I believe the problem just doesn't exist in Python.