Skip to content

Zaqu1h/fdth-python-fork25.2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

170 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 fdth

A python port of the fdth R library.

🇧🇷 (Portuguese) Ainda falta algo?

Este pacote foi desenvolvido como projeto para a disciplina
"Probabilidade e Estatística" (Ciência da Computação, UESC), nos semestres
de 2025.1 e 2025.2. Vale ressaltar que o projeto já é anterior a isso,
porém incorporou a estruturação com foco em orientação a objetos
apenas em 2025.

O projeto já inclui todas as funcionalidades do pacote fdth original,
que foi feito para ser usado na linguagem R.

🧪 examples

There's an example of the "group by" functionality, which does not supports more than one argument in the original package:

📊 Example

import pandas as pd
from fdth import fdt
import matplotlib.pyplot as plt

df = pd.DataFrame({
    'Altura': [170, 175, 180, 165, 172, 168, 175, 170, 160, 155],
    'Peso': [70, 75, 80, 65, 72, 68, 75, 70, 60, 55],
    'Idade': [30, 20, 30, 18, 30, 27, 24, 50, 60, 9],
    'Sexo': ['M', 'I', 'M', 'I', 'M', 'F', 'I', 'F', 'F', 'F'],
    'Regiao': ['Nordeste', 'Sudeste', 'Nordeste', 'Sudeste', 'Norte', 'Norte', 'Sudeste', 'Nordeste', 'Norte', 'Sudeste'],
    'EstadoCivil': ['Casado', 'Solteiro', 'Solteiro', 'Casado', 'Solteiro', 'Solteiro', 'Casado', 'Casado', 'Solteiro', 'Casado']
})

mfdt_multi = fdt(df, by=['Sexo', 'EstadoCivil', 'Regiao'])

mfdt_multi.plot(numeric_type="fh", categorical_type="fb")

Page 1 image

Page 2 image

More examples can be found at the examples/python folder.

🛠️ development

First of all, clone the repository (para um tutorial em português
disso, olhe este arquivo).

Then, set up a virtual environment:

# on linux and windows
python -m venv venv

# on linux
source venv/bin/activate

# on windows (command prompt)
venv\Scripts\activate.bat

# on windows (PowerShell)
Set-ExecutionPolicy Unrestricted -Scope Process
venv\Scripts\activate.ps1

Install the package to the venv (needs to be done only once):

pip install -e .

🧰 tools

Use unittest for running automatic tests (included in python):

python -m unittest discover -s tests

Use black for code formatting (pip install black):

black .

Use pdoc for doc generation (pip install pdoc):

pdoc -o doc fdth

Use mypy for type checking (pip install mypy):

mypy --strict --cache-fine-grained .

👥 credits

🔹 Original version created by

🔹 Initial python port by

🔹 Previous version made by

  • Gabriel Galdino,
  • Luciene Mª Torquato C. Batista,
  • Stella Ribas,
  • Thainá Guimarães
  • Yohanan Santana.

🔹 Current version made by

  • Alex Amaral dos Santos,
  • Isaque Silva Passos Ribeiro,
  • Kaiala de Jesus Santos
  • Olinoedson Silva Sena.

About

Fork of yohhand1/fdth-python-fork

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%