refactoring

This commit is contained in:
Mikołaj Pokrywka 2022-04-03 12:17:21 +02:00
parent 19232ff416
commit 39af11487e
2 changed files with 24 additions and 1 deletions

View File

@ -22,7 +22,7 @@ pipeline {
}
stage("Calcualte stats") {
steps {
sh "python3 download_data_and_process.py"
sh "python3 stats.py"
archiveArtifacts artifacts: "stats.txt"
}
}

23
stats.py Normal file
View File

@ -0,0 +1,23 @@
import subprocess
import pandas as pd
import numpy as np
data=pd.read_csv('data_train.csv')
data_2=pd.read_csv('data_dev.csv')
data_3=pd.read_csv('data_test.csv')
data = pd.concat([data, data_2, data_3], axis=0)
data = data.replace(np.nan, '', regex=True)
print("="*20)
print('Ilość wierszy w zbiorze: ',len(data))
print("="*10, ' data["department"].value_counts() ', 10*'=')
print(data["department"].value_counts())
print("="*10, ' data.median() ', 10*'=')
print(data.median())
print("="*10, ' data.describe(include="all") ', 10*'=')
print(data.describe(include='all'))
data.describe(include="all").to_csv(r'stats.txt', header=None, index=None, sep='\t', mode='a')