Delete column from a dataset in mathematica
You can use KeyDrop
:
picture = Import["https://i.stack.imgur.com/p7ax0.jpg"];
table = Transpose[Partition[TextRecognize[picture, "Word"], 9] /. "Long_" -> "Long"];
ds = Dataset[AssociationThread[First @ table, #] & /@ Rest[table]]
KeyDrop[{"FIPS", "Admin2"}] @ ds
We also get the same result using any of the following:
ds[KeyDrop[{"FIPS", "Admin2"}]]
Query[KeyDrop[{"FIPS", "Admin2"}]] @ ds
ds[All, Delete[{{"FIPS"}, {"Admin2"}}]]
ds[All, Delete[{{1}, {2}}]]
list = {
<|"a" -> 1, "b" -> "b1", "c" -> {1}, "d" -> 1, "e" -> {1},
"f" -> 1|>,
<|"a" -> 2, "b" -> "b2", "c" -> {2}, "d" -> 2, "e" -> {2},
"f" -> 2|>,
<|"a" -> 3, "b" -> "b3", "c" -> {3}, "d" -> 3, "e" -> {3},
"f" -> 3|>,
<|"a" -> 4, "b" -> "b4", "c" -> {4}, "d" -> 4, "e" -> {4},
"f" -> 4|>,
<|"a" -> 5, "b" -> "b5", "c" -> {5}, "d" -> 5, "e" -> {5},
"f" -> 5|>,
<|"a" -> 6, "b" -> "b6", "c" -> {6}, "d" -> 6, "e" -> {6},
"f" -> 6|>};
list // Dataset
list[[All, 3 ;; 6]] // Dataset