Files
fn_registry/python/functions/datascience/best_central_tendency.md
T
egutierrez 47fac22230 chore: auto-commit (799 archivos)
- .claude/CLAUDE.md
- .claude/commands/subagentes.md
- .claude/rules/INDEX.md
- .mcp.json
- bash/functions/cybersecurity/analyze_dns.md
- bash/functions/cybersecurity/audit_http_headers.md
- bash/functions/cybersecurity/audit_ssh_config.md
- bash/functions/cybersecurity/check_firewall.md
- bash/functions/cybersecurity/detect_suspicious_users.md
- bash/functions/cybersecurity/encrypt_file.md
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:28:20 +02:00

2.7 KiB

id, name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, example, tested, tests, test_file_path, file_path, params, output, source_repo, source_license, source_file
id name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports example tested tests test_file_path file_path params output source_repo source_license source_file
best_central_tendency_py_datascience best_central_tendency function py datascience 1.0.0 pure def best_central_tendency(values: list[float], dist_type: str) -> tuple[str, float] Selects the most appropriate central tendency measure for a given distribution type. Returns (label, value) pair.
statistics
central-tendency
distribution
robust
mean
median
pendiente-usar
geometric_mean_py_datascience
trimmed_mean_py_datascience
false
math
numpy
from best_central_tendency import best_central_tendency label, value = best_central_tendency([1, 2, 3, 4, 5], "normal-ish") # ("mean", 3.0) true
test_best_central_tendency_normal_ish
test_best_central_tendency_right_skewed
test_best_central_tendency_left_skewed
test_best_central_tendency_lognormal_ish
test_best_central_tendency_heavy_tail
test_best_central_tendency_empty
test_best_central_tendency_default
python/functions/datascience/tests/test_best_central_tendency.py python/functions/datascience/best_central_tendency.py
name desc
values List of numeric values to summarize.
name desc
dist_type Distribution type string, typically from detect_distribution_type. One of: normal-ish, lognormal-ish, heavy-tail, right-skewed, left-skewed, other, too_few_samples.
Tuple (label, value) where label is one of "mean", "median", "geometric_mean", "trimmed_mean_5%", and value is the computed central tendency. Returns ("median", math.nan) for empty input. internal:footprint_aurgi internal-aurgi aurgi_mapas/generar_pdf_reporte.py:196

Ejemplo

from best_central_tendency import best_central_tendency

best_central_tendency([1, 2, 3, 4, 5], "normal-ish")    # ("mean", 3.0)
best_central_tendency([1, 2, 3, 4, 5], "right-skewed")  # ("median", 3.0)
best_central_tendency([1, 2, 4, 8], "lognormal-ish")    # ("geometric_mean", ~2.83)
best_central_tendency([1, 2, 3, 100], "heavy-tail")     # ("trimmed_mean_5%", ...)

Mapeo de tipos a medidas

dist_type Medida Funcion interna
normal-ish mean numpy.mean
lognormal-ish geometric_mean geometric_mean()
heavy-tail trimmed_mean_5% trimmed_mean(0.05)
right-skewed median numpy.median
left-skewed median numpy.median
otros / default median numpy.median