station_result_from_year_2010

This commit is contained in:
kubapok 2021-12-23 15:41:18 +01:00
parent ec4be03ea1
commit 89fa45a874
3 changed files with 1328 additions and 1314 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
import pandas as pd
train_in = pd.read_csv('../train/in.tsv', header = None, names = ['id', 'nazwa','typ_zbioru', 'rok', 'miesiąc'], sep='\t')
train_exp = pd.read_csv('../train/expected.tsv', header = None, names = ['opad'], sep='\t')
train = train_in.copy()
train['opad'] = train_exp
for dataset in ('dev-0', 'test-A'):
with open(f'../{dataset}/out.tsv','w') as f_out, open(f'../{dataset}/in.tsv', 'r') as f_in:
for line in f_in:
id, _, _, rok, miesiac = line.rstrip().split('\t')
rok_2010 = train[(train['id'] == int(id) ) & (train['rok'] == 2010) & (train['miesiąc'] == int(miesiac)) ]['opad'].item()
f_out.write(str(rok_2010) + '\n')

File diff suppressed because it is too large Load Diff