delete!(A, [:C,:D])
On Tuesday, July 1, 2014 7:38:00 PM UTC-4, Andre P. wrote:
>
> I figured out one way to do this...
>
> B = A[:, setdiff(names(A),[symbol("D"), symbol("E")])] # removes columns C
> & D using column names
>
> A less verbose way?
>
> On Wednesday, July 2, 2014 7:01:56 AM UTC+9, Andre P. wrote:
>>
>> I have a data frame with a large number of columns and I would like to
>> remove certain unnecessary columns as part of the initial data wrangling.
>>
>> I can do this succinctly using the numeric index...
>>
>> using DataFrames
>> A = DataFrame(A=1:3, B=4:6, C=7:9, D=10:12, E=13:15)
>> B = A[:, setdiff(1:end,[3,4])] # returns DFs without columns C & D
>>
>> Is there a way to do this using the column names rather than their
>> numeric indices?
>>
>> Andre
>>
>>
>>
>>