How to select the first element of an array in a dataframe column

The element “results.address_components.short_name” is an array. I was wondering how can I select the first element of this array instead of the full array.

var (“results”))).toDF(“results”)

This is what I got when I show the DF and print the sheama:

I just want the codes “30002”, “30005”… in the first element of the dataframe

Thanks in advance.

Just in case someone has the same problem I had, see a couple of ways to resolve it: