With numpy array, you can check a specific column with slicing, i.e. array[:, 0]
.
For a list, checking whether a 2D element is inside is as simple as ["one", "two"] in some_list
. However, just looking if "one"
is present requires one to iterate through the elements, i.e. ["one" == item[0] for item in some_list]
.
I largely prefer numpy array except that my array needs to be modified (adding at the end and removing values). I like to work with list because they are very simple to work with. I am considering dataframe but I feel like I should be able to find some clever and efficient way to this kind of operation using a list.