refactoring
This commit is contained in:
parent
19232ff416
commit
39af11487e
@ -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
23
stats.py
Normal 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')
|
Loading…
Reference in New Issue
Block a user