ium_464979/IUM_05-split.py

10 lines
308 B
Python
Raw Normal View History

2024-04-16 18:58:43 +02:00
import pandas as pd
from sklearn.model_selection import train_test_split
data = pd.read_csv('./beer_reviews.csv')
train_data, test_data = train_test_split(data, test_size=0.2, random_state=42)
train_data.to_csv('beer_reviews_train.csv', index=False)
test_data.to_csv('beer_reviews_test.csv', index=False)