I have an array of arrays in my dataframe - split.(df2.name)
:
> 392-element Array{Array{SubString{String},1},1}:
["chevrolet", "chevelle", "malibu"]
["buick", "skylark", "320"]
["plymouth", "satellite"]
["amc", "rebel", "sst"]
["ford", "torino"]
⋮
["ford", "mustang", "gl"]
["vw", "pickup"]
["dodge", "rampage"]
["ford", "ranger"]
["chevy", "s-10"]
I want to select all but the first element of each array and join them together, to get the model names of these cars.
First, I thought to do something like this: model = join.(split.(df2.name)[2:end], " ")
but instead of removing the first element of each array, this removes the first car (The first element of the outer array).
So I thought to broadcast the range [2:end]
to all the elements by puting a point just before the range: model = join.(split.(df2.name).[2:end], " ")
. But this does not seem to work either, because there is a syntax error:
syntax: missing last argument in "2:" range expression
So what is the julian way to broadcast a range in such a case?