I often want to get stuck in a long array or column in a data framework, and for each element, see if it is a member of another array. Instead of doing
giant_list = ["a", "c", "j"] good_letters = ["a", "b"] isin = falses(size(giant_list,1)) for i=1:size(giant_list,1) isin[i] = giant_list[i] in good_letters end
Is there any vectorized (double vectorized?) Way to do this in julia? By analogy with the main operators, I want to do something like
isin = giant_list .in good_letters
I understand that this may not be possible, but I just wanted to make sure that I did not miss something. I know that I could use DefaultDict from DataStructures to do this, but I know nothing in the database.
vectorization dataframe julia-lang
ARM
source share