Question: I am trying to do this:

```
.withColumn("System", when($"SysID".split("-").length > 3, $"SysID".split("-").take(3)).otherwise(null))

```

But I get the following error:

error: value split is not a member of org.apache.spark.sql.ColumnName

What can I do to use the split function?

Thank you.

Answer: 
This will select salary in the last row.

```
df['Salary'][-1]

```
In pandas there exists a tail function:

```
>>> df = pd.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',
                   'monkey', 'parrot', 'shark', 'whale', 'zebra']})

>>> df.tail(1)
    animal
8   zebra

```

(See: <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.tail.html>)

---

Or you could simply do:

```
>>>df[-1:]
    animal
8   zebra

```