95959f713c
Agrega funciones Python reutilizables organizadas por dominio: - core: composicion funcional (pipe, compose, map, filter, reduce, etc.) - cybersecurity: analisis de amenazas y puertos - datascience: estadisticas y deteccion de outliers - finance: indicadores tecnicos y analisis financiero
33 lines
744 B
Markdown
33 lines
744 B
Markdown
---
|
|
name: histogram
|
|
kind: function
|
|
lang: py
|
|
domain: datascience
|
|
version: "1.0.0"
|
|
purity: pure
|
|
signature: "def histogram(data: list, buckets: int) -> list"
|
|
description: "Calcula histograma con N buckets. Retorna lista de conteos por bucket."
|
|
tags: [statistics, histogram, python]
|
|
uses_functions: []
|
|
uses_types: []
|
|
returns: []
|
|
returns_optional: false
|
|
error_type: ""
|
|
imports: []
|
|
tested: false
|
|
tests: []
|
|
test_file_path: ""
|
|
file_path: "python/functions/datascience/datascience.py"
|
|
---
|
|
|
|
## Ejemplo
|
|
|
|
```python
|
|
histogram([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5)
|
|
# [2, 2, 2, 2, 2]
|
|
```
|
|
|
|
## Notas
|
|
|
|
Los buckets cubren el rango [min, max] uniformemente. El ultimo bucket incluye el valor maximo. Si todos los valores son iguales, todos caen en el primer bucket.
|