Watching this piece of code in the book:
def split_train_test_by_id(data, test_ratio, id_column, hash=hashlib.md5):
ids = data[id_column]
in_test_set = ids.apply(lambda id_: test_set_check(id_, test_ratio, hash))
return data.loc[~in_test_set], data.loc[in_test_set]
Never saw this loc[~<..>] before. Probably understanding the functionality, however want to be sure. Also is it working only in pandas or python in general?