import datasets # find /wherever -name '*.csv' | tar -T - -c | tar -C /somewhere -x ds = datasets.load_dataset("csv", "/somewhere") ds = ds.class_encode_column('Type')