cfdf515228
- .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>
2.7 KiB
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. |
|
|
false |
|
from best_central_tendency import best_central_tendency label, value = best_central_tendency([1, 2, 3, 4, 5], "normal-ish") # ("mean", 3.0) | true |
|
python/functions/datascience/tests/test_best_central_tendency.py | python/functions/datascience/best_central_tendency.py |
|
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 |