I have a huge list, ex. {a,b,c},{d,e,f} and I must have only {a,c},{d,f}. I using import from url. My sentence:
Drop[Import["url"],{2}]
And it doesn't work. Why?
I have a huge list, ex. {a,b,c},{d,e,f} and I must have only {a,c},{d,f}. I using import from url. My sentence:
Drop[Import["url"],{2}]
And it doesn't work. Why?
Just use the third parameter of the Drop
function, like so:
list = {{a, b, c}, {d, e, f}};
Drop[list, None, {2}]
This will return:
{{a, c}, {d, f}}
You need to map drop over the list.
list = {{a, b, c}, {d, e, f}};
Map[Drop[#, {2}] &, list]
{{a, c}, {d, f}}
Alternatively, use transpose, but this is apparently less efficient because it makes copies of the list.
Transpose@Drop[Transpose@list, {2}]