from os import listdir
from os.path import isfile, join
import pandas as pd


path = 'data/samples'
onlyfiles = [f for f in listdir(path) if isfile(join(path, f))]

print(onlyfiles)

for file in onlyfiles:
    df = pd.read_csv(join(path, file))
    valid = df.sample(n=100, random_state=42)
    # train = df.drop(valid.index)
    # train.to_csv(join(path, 'train_' + file), index=False)
    valid.to_csv(join(path, 'sample_' + file), index=False)
