ium_z444510/create-dataset.py
piotrwrzodak e75c417504 4.3.1 v8
2023-05-11 22:58:08 +02:00

22 lines
563 B
Python

import pandas as pd
import os
import numpy as np
cutoff = 10
data = pd.read_csv('./barcelona_weekends.csv')
data = data.sample(cutoff)
data = data.iloc[:, 1:]
train_set, dev_set, test_set = np.split(data.sample(frac=1, random_state=42),
[int(.6 * len(data)), int(.8 * len(data))])
train_set.to_csv('barcelona_weekends.train.csv', index=False)
dev_set.to_csv('barcelona_weekends.dev.csv', index=False)
test_set.to_csv('barcelona_weekends.test.csv', index=False)
check = pd.read_csv('./train.csv')
print(check.head())