Skip to content

Commit

Permalink
Finishing New Documentation and Code Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherzhafif committed Oct 12, 2024
1 parent 64f8faa commit 9c28bbe
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 35 deletions.
16 changes: 4 additions & 12 deletions FrequencyTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,9 @@ def Populate(self):

# Adding Data Range Limit Of The Class Frequency
data_limit.append(str(old_number - 0.5) + " ~ " + str(current_number + 0.5))

# Assign Value Each Processed Data
self.bottom_limit = lower
self.top_limit = upper
self.frequency = frequency
self.ranges = data_range
self.limit = data_limit

# Append Processed Data into Data Attributes
self.data = ProcessedData(self.bottom_limit, self.top_limit, self.frequency, self.ranges, self.limit)
self.data = ProcessedData(lower, upper, frequency, data_range, data_limit)

# Base 5 Rounding
def roundy(self, x, base = 5):
Expand All @@ -83,7 +76,6 @@ class ProcessedData:
def __init__(self, bottoms, tops, frequency, ranges, limit):
self.bottom = bottoms
self.top = tops
self.frequency = frequency # frekuensi terproses
self.ranges = ranges # rentang terproses
self.limit = limit # batas kelas terproses

self.frequency = frequency
self.ranges = ranges
self.limit = limit
14 changes: 8 additions & 6 deletions Main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# EXAMPLE PROGRAM
import FrequencyTable as ft

# Misalnya, Anda punya data mentah seperti ini:
# Raw Data
data = (
58, 67, 45, 89, 72, 60, 76, 93,
55, 48, 62, 85, 79, 56, 41, 90,
Expand All @@ -9,11 +10,12 @@
49, 87, 88, 50, 69, 84, 43, 65,
83, 70, 44, 61, 75, 80, 71, 63, 47,51)

# Membuat objek dari FrequencyTable dengan data mentah
# Initiate Object From The Raw Data
table = ft.FrequencyTable(data)

# Memproses data mentah menjadi tabel frekuensi
# Processing Raw Data to Frequency Table
table.Populate()

print(table.data.ranges) # Output: [0, 10, 20, 30] (data terproses)
print(table.data.frequency) # Output: [10, 20, 30, 40] (data terproses)
# Print The Data
print(table.data.ranges)
print(table.data.frequency)
54 changes: 37 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,69 @@
- Matplotlib

pip install matplotlib

- Numpy

pip install numpy

### Structure
- Program Structure

+ Main.py [ Main execute file ]
+ Dataset.py [ Place to put the Dataset ]
+ Frequency.py [ Frequency Table Module ]
+ Main.py [ Main Control file ]
+ FrequencyTable.py [ Frequency Table Module ]
+ Chart.py [ Chart Display Module ]

### Module
- Frequency.py Variables Description
- FrequencyTable.py Variables Description

# Data Needed For Frequency Table
# Raw Data Needed For Frequency Table
dataset = sorted dataset from your main.py input
amount = amount/length of data
dataset = the dataset from Dataset.py
lowest = minimum dataset value
highest = maximum dataset value
ranges = amount dataset range
range = amount dataset range ( all dataset value )
classes = amount of dataset class
interval = amount of interval for each frequency
base = frequency table bottom data start point
top = frequency table top data stop point

# Processed Frequency Table Data
data_lower = each bottom data limit of each dataset class
data_upper = each top data limit of each dataset class
data_frequency = frequency for each dataset class
data_range = combination of data_lower and data_upper showing the data frequency range

top = frequency table top data stop point

# Processed Frequency Table Data
data = the main class for processed data
data.bottom = each bottom data limit of each dataset class
data.top = each top data limit of each dataset class
data.frequency = frequency for each dataset class
data.range = combination of data.top and data.bottom showing the data frequency range
data.limit = data range bottom and top limit

### How to run
- Clone This Repositry -> Pythistic Folder

git clone https://github.com/brotherzhafif/Pythistic.git
cd Pythistic
- Open Dataset.py -> paste your 1D array data

- Open Main.py -> paste your 1D array data into data variable

# Example
data = (1,3,6,8,4)
import FrequencyTable as ft

data = (
58, 67, 45, 89, 72, 60, 76, 93,
55, 48, 62, 85, 79, 56, 41, 90,
77, 54, 68, 82, 46, 73, 57, 92,
81, 53, 66, 74, 64, 52, 91, 78,
49, 87, 88, 50, 69, 84, 43, 65,
83, 70, 44, 61, 75, 80, 71, 63, 47,51)
# Initiate Object From The Raw Data
table = ft.FrequencyTable(data)
# Processing Raw Data to Frequency Table
table.Populate()
# Print The Data
print(table.data.ranges)
print(table.data.frequency)

- Run the Main.py

python Main.py # for universal python distribution
Expand Down

0 comments on commit 9c28bbe

Please sign in to comment.