station_result_from_year_2010
This commit is contained in:
parent
ec4be03ea1
commit
89fa45a874
1200
dev-0/out.tsv
1200
dev-0/out.tsv
File diff suppressed because it is too large
Load Diff
14
station_result_from_year_2010/run.py
Normal file
14
station_result_from_year_2010/run.py
Normal 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')
|
1428
test-A/out.tsv
1428
test-A/out.tsv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user