pandas
creating a random sample df
creating a random sample df
cat_list = ['pig', 'cow', 'chicken']
columns = ['val1', 'val2', 'val3', 'val4']
np.random.seed(0)
fake_df = pd.DataFrame(np.random.choice(10, (30, 4)), columns=columns)
fake_df['cat1'] = np.random.choice(list(cat_list), len(df))
fake_df
jupyter
jupyter
how to remove data based on criteria:
df = df[df.plant != 'Col']
add to a list:
db_list.insert(0,'Col')