Python os,glob and statistics

import os 
import glob

print(os.getcwd()) # şuan üzerinde çalıştığımız dizini döner

#komut satırında işlem yaptırma
os.system('ipconfig') 

#py uzantılı dosyaları arayıp listeler
print(glob.glob("*.py"))

#python ile istatistik hesapları yapılabilir.
import statistics

veriGrubu=[12,63,85,63,45,19,12,98,25,12,14,154,12,91,19,2,5]

#Bunu ortalama için yazmanıza gerek yok.Sadece toplamı görmek için yazdım.
print("  toplam : ",sum(veriGrubu)) 

print("ortalama : ",statistics.mean(veriGrubu)) #ortalama hesabı

print("  medyan : ",statistics.median(veriGrubu)) #medyan hesabı

print("     mod : ",statistics.mode(veriGrubu)) #mod hesabı

print(" varyans : ",statistics.variance(veriGrubu)) #varyans hesabı

Comments

Popular posts from this blog

Tech Duos For Web Development

CIFAR-10 Dataset Classification Using Convolutional Neural Networks (CNNs) With PyTorch

Long-short-term-memory (LSTM) Word Prediction With PyTorch