Skip to content

Commit 93231c7

Browse files
committed
V 1.1 | main English
1 parent 33956bf commit 93231c7

21 files changed

Lines changed: 221 additions & 274 deletions

README.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
1-
## <ins>Giriş</ins>
1+
## <ins>Introduction</ins>
22

3-
Bu repoda, basit istatistiksel kalıpları kolaylıkla hesaplayan python programları mevcuttur. Program aşağıdaki **ana menü** ile başlar.
3+
This repo contains python programs that easily calculate simple statistical patterns. The program starts with the following **main menu**.
44

5-
![cli-ss](https://github.com/tatlilimon/basic-statistics-w-python/assets/43828285/0de22404-8669-434b-a690-7e3aeb125f1a)
65

76

8-
Hangi konuda hesaplama yapılması gerekiyorsa, ana menüden ilgili konu seçilir ve veri seti girilmeye başlanır. Veri seti ve istenilen bilgiler girildikten sonra hesaplama sonucu komut satırında çıktı olarak verilecektir.
7+
If a calculation is required, select the relevant subject from the main menu and start entering the data set. After entering the data set and the desired information, the calculation result will be given as output on the command line.
98

109
* * *
1110

12-
## <ins>Gereksinimlerin Yüklenme Aşaması</ins>
11+
## <ins>Requirements</ins>
1312

14-
Python ile veri analizi yapmak için belirli kütüphanelere ihtiyaç duyulur.
13+
To analyze data with Python, certain libraries are needed.
1514

16-
- İlk olarak python'ın 3.3 ve üzeri sürümünün cihazınızda yüklü olması gerekir. Bunu kontrol etmek için, cmd veya terminal vasıtası ile  `python --version` komutu ile kontrol edilir. Eğer yüklü değil ise; python, cihaza <ins>**mutlaka**</ins> kurulmalıdır.
17-
- Gerekli tüm kütüphaneleri bir anda kurmak için **terminal veya cmd** de proje dizinine `cd` komutu ile gidin ve bu kodu çalıştırınız. `pip install -r requirements.txt`
18-
- Eğer programlar haladaha çalışmıyor ise; **requirements.txt** adlı dosyadaki kütüphaneleri: `pip show kütüphaneAdi` olarak yüklü olup olmadığını kontrol edin.
19-
- Eğer değil ise **manuel** olarak yükleyin. `pip install kütüphaneAdi`
15+
- First, python version 3.3 and above must be installed on your device. To check this, use the `python --version` command via cmd or terminal. If it is not installed, python must be installed on the device <ins>**absolutely**</ins>.
16+
- To install all the necessary libraries at once, go to the project directory in **terminal or cmd** with the `cd` command and run this code. `pip install -r requirements.txt`
17+
- If the programs are still not working, check the libraries in **requirements.txt**: `pip show libraryName` to check if they are installed.
18+
- If not, install them **manually**. `pip install libraryName`
2019

2120
* * *
2221

23-
## <ins>Nasıl Kullanılır?</ins>
22+
## <ins>How to Use</ins>
2423

25-
1. **CMD** veya **Terminal** kullanarak proje dizinine `cd` komutu ile gidilir. Ya da VSCode kullanıyorsanız ve projeyi VSCode içinde açtıysanız, editörün içinde terminal açarsanız direkt olarak proje dizininde açar. cd komutuna gerek kalmaz.
26-
2. Komut satırına `python3 main.py` girilerek **ana menü**ye erişilir.
27-
3. Ana menüden hangi konuda istatistik hesaplamalar yapılacaksa; ilgili konunun başındaki **rakam**<ins>direkt girdi</ins> olarak komut satırına girilir.
28-
4. Veri setini komut satırına girerken, <ins>**her bir veri arasına virgül**</ins> koyup <ins>**son veriden sonra virgül koymamaya**</ins> dikkat edin!
24+
1. Use **CMD** or **Terminal** to go to the project directory with the `cd` command. Or if you are using VSCode and you opened the project in VSCode, if you open the terminal in the editor, it will open directly in the project directory.
25+
2. Enter `python3 main.py` in the command line to access the **main menu**.
26+
3. From the main menu, enter the **digit** at the beginning of the related topic as <ins>direct input</ins> to the command line.
27+
4. When entering the data set into the command line, be careful to put <ins>**commas**</ins> between each data and <ins>**not to put a comma after the last data**</ins>!
2928

3029
* * *
3130

32-
## <ins>Projeye Katkıda Bulunmaktan Çekinmeyin!</ins>
31+
## <ins>Feel Free to Contribute This Project!</ins>
3332

34-
Projede bulunan istatistiksel hesaplama araçlarından farklı olarak başka araçlar da <ins>**PR**</ins> açarak ekleyebilirsiniz.
33+
You can add other tools besides the statistical calculation tools in the project by opening <ins>**PR**</ins>.
3534

36-
> Proje GPL 3 lisanslaması altındadır. Yani bu yazılımı istediğiniz gibi kopyalayıp herhangi bir yerde kullanabilirsiniz lakin bunun tek şartı var o da; GPL 3 lisansı altında yayınlamanız. Yani bu kodları başka yerde kullanacaksanız o projenin de açık kaynaklı olması gerekiyor.
35+
> The project is licensed under GPL 3. This means that you can copy this software and use it anywhere you want, but there is only one condition; you must release it under the GPL 3 license. So if you are going to use this code elsewhere, that project must also be open source.
3736
>
38-
> GPL 3 hakkında daha fazla bilgi için [Tıkla!](https://github.com/tatlilimon/basic-statistics-w-python/blob/main/LICENSE)
37+
> For more information about GPL 3 [Click here!](https://github.com/tatlilimon/basic-statistics-w-python/blob/main/LICENSE)

ort-sapma.py renamed to average-deviation.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ def mean_deviation(data_set):
1111
mean_deviation = total / n
1212
return mean_deviation
1313

14-
# Kullanıcıdan veri sati alınır
15-
input_data = input(Fore.BLUE + "veri grubunu; aralarında virgül olacak şekilde giriniz ve ardından enter'a basınız: " + Fore.RESET)
16-
# Kullanıcıdan alınan giriş, virgülle ayrılır ve numpy arrayine dönüştürülür
14+
input_data = input(Fore.BLUE + "Enter your data set with commas between them " + Fore.RESET)
1715
data = [float(x) for x in input_data.split(",")]
1816

1917
result = mean_deviation(data)
20-
print(Fore.GREEN +"Ortalama Sapma:" + Fore.RESET, result)
18+
print(Fore.GREEN +"average deviation:" + Fore.RESET, result)

central-tendency.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import numpy as np
2+
from scipy import stats
3+
from colorama import Fore, Style
4+
5+
def calculate_statistics(data):
6+
mean = np.mean(data)
7+
print(Fore.GREEN +"Arithmetic mean: " + Fore.RESET, mean)
8+
9+
median = np.median(data)
10+
print(Fore.GREEN +"Median: " + Fore.RESET, median)
11+
12+
mode = stats.mode(data)
13+
print(Fore.GREEN +"Mod: " + Fore.RESET, mode[0][0])
14+
15+
q1 = np.percentile(data, 25)
16+
q3 = np.percentile(data, 75)
17+
print(Fore.GREEN +"Q1: " + Fore.RESET, q1)
18+
print(Fore.GREEN +"Q3: " + Fore.RESET, q3)
19+
20+
std_dev = np.std(data)
21+
print(Fore.GREEN +"Standart deviatio: " + Fore.RESET, std_dev)
22+
23+
variance = np.var(data)
24+
print(Fore.GREEN + "Variance: " + Fore.RESET, variance)
25+
26+
print(Fore.BLUE + "Enter your data set with commas between them" + Fore.RESET)
27+
user_input = input()
28+
29+
data = np.array([float(i) for i in user_input.split(',')])
30+
31+
calculate_statistics(data)

chi-square-independence.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import numpy as np
2+
from scipy.stats import chi2_contingency
3+
from colorama import Fore, Style
4+
5+
num_rows = int(input(Fore.BLUE + "How many rows does your data set have: " + Fore.RESET))
6+
7+
observed_frequencies = []
8+
for i in range(num_rows):
9+
row_data = input(Fore.BLUE + f"Enter the data of the {i+1}.row with commas between them: " + Fore.RESET)
10+
observed_frequencies.append([float(x) for x in row_data.split(",")])
11+
12+
observed_frequencies = np.array(observed_frequencies)
13+
14+
chi2_stat, p_val, dof, expected_frequencies = chi2_contingency(observed_frequencies)
15+
16+
print(Fore.GREEN +"Chi-Square statistics: " + Fore.RESET, chi2_stat)
17+
print(Fore.GREEN +"P value: " + Fore.RESET, p_val)
18+
print(Fore.GREEN +"Degrees of freedom: " + Fore.RESET, dof)
19+
print(Fore.MAGENTA +"If Hypothesis Testing is to be done; after calculating the chi-square statistic value, open the following link in your browser" + Fore.RESET)
20+
print(Fore.BLUE +"https://homepage.divms.uiowa.edu/~mbognar/applets/chisq.html" + Fore.RESET)
21+
print(Fore.MAGENTA +"v=(rowNumber-1)*(columnNumber-1), Red field=0.05 if the question asks for 0.01, type 0.01 and it will give you the x value. if the x value is greater than the chi-square statistic value, h0 is rejected. if it is smaller, h0 is accepted." + Fore.RESET)

chi-square.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import numpy as np
2+
from scipy.stats import chisquare
3+
from colorama import Fore, Style
4+
5+
input_data = input(Fore.BLUE + "Enter your data set with commas between them: " + Fore.RESET)
6+
observed_frequencies = np.array([float(x) for x in input_data.split(",")])
7+
8+
expected_frequencies = np.full_like(observed_frequencies, np.mean(observed_frequencies))
9+
10+
chi2_stat, p_val = chisquare(observed_frequencies, f_exp=expected_frequencies)
11+
12+
print(Fore.GREEN +"Chi-Square statistics: " + Fore.RESET, chi2_stat)
13+
print(Fore.GREEN +"P value: " + Fore.RESET, p_val)
14+
print(Fore.MAGENTA +"If Hypothesis Testing is to be done; after calculating the chi-square statistic value, open the following link in your browser" + Fore.RESET)
15+
print(Fore.BLUE +"https://homepage.divms.uiowa.edu/~mbognar/applets/chisq.html" + Fore.RESET)
16+
print(Fore.MAGENTA +"v=(total number of data-1), Red field=0.05 if the question asks for 0.01, type 0.01 and it will give you the x value. if the x value is greater than the chi-square statistic value, h0 is rejected. if it is smaller, h0 is accepted." + Fore.RESET)
17+

correlation-coefficient.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import numpy as np
2+
from colorama import Fore, Style
3+
4+
input_data1 = input(Fore.BLUE + "Enter the 1st group's data set with commas between them " + Fore.RESET)
5+
input_data2 = input(Fore.BLUE + "Enter the 2nd group's data set with commas between them " + Fore.RESET)
6+
7+
data1 = np.array([float(x) for x in input_data1.split(",")])
8+
data2 = np.array([float(x) for x in input_data2.split(",")])
9+
10+
correlation_matrix = np.corrcoef(data1, data2)
11+
12+
correlation_coefficient = correlation_matrix[0, 1]
13+
14+
print(Fore.GREEN + "Correlation coefficient: " + Fore.RESET, correlation_coefficient)

eslenik-t-guven-araligi.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

f-test.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import numpy as np
2+
from scipy.stats import f_oneway
3+
from colorama import Fore, Style
4+
5+
num_groups = int(input(Fore.BLUE + "How many groups are in your dataset?: " + Fore.RESET))
6+
7+
groups = []
8+
for i in range(num_groups):
9+
group_data = input(Fore.BLUE + f" Enter the data of the {i+1}.group with commas between them: " + Fore.RESET)
10+
groups.append(np.array([float(x) for x in group_data.split(",")]))
11+
12+
F, p = f_oneway(*groups)
13+
14+
print(Fore.GREEN +"F statistics: " + Fore.RESET, F)
15+
print(Fore.GREEN +"P value: " + Fore.RESET, p)
16+
17+
print(Fore.MAGENTA +"To calculate the critical value, open the link below in your browser! " + Fore.RESET)
18+
print(Fore.BLUE +"https://www.danielsoper.com/statcalc/calculator.aspx?id=4" + Fore.RESET)
19+
print(Fore.MAGENTA +"Degrees of freedom is 1: (total number of groups-1)" + Fore.RESET)
20+
print(Fore.MAGENTA +"Degrees of freedom 2: (total number of data in all groups - number of groups)" + Fore.RESET)
21+
print(Fore.MAGENTA +"If the F statistic value is greater than the critical value, h0 is rejected, if it is smaller, it is accepted." + Fore.RESET)

f-testi.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

ki-kare-bagimsizlik.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)