
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
robust-average
Advanced tools
A Python package that intelligently selects the most robust average (mean, median, or mode) for price analysis
A Python package that intelligently selects the most robust average (mean, median, or mode) for price analysis based on outlier and skewness detection.
pip install robust-average
from robust_average import robust_average
# Example with clean data
prices = [97.87, 109.99, 129.99, 89.99, 119.99]
result = robust_average(prices)
print(f"Selected average: {result['value']} (method: {result['method']})")
# Output: Selected average: 109.99 (method: mean)
# Example with outliers
prices_with_outlier = [97.87, 109.99, 129.99, 89.99, 119.99, 500.00]
result = robust_average(prices_with_outlier)
print(f"Selected average: {result['value']} (method: {result['method']})")
# Output: Selected average: 109.99 (method: median)
The function uses a systematic approach to select the most appropriate average:
Outlier Detection (IQR Method):
Skewness Analysis:
Decision Criteria:

robust_average(prices, return_all_stats=False)Parameters:
prices (list or pd.Series): List or Series of numeric pricesreturn_all_stats (bool): If True, returns all computed statisticsReturns:
{
'value': selected_average_value,
'method': 'mean' | 'median' | 'mode',
'mean': mean_value,
'median': median_value,
'mode': mode_value_or_None,
'std': standard_deviation,
'skew': skewness,
'outliers': list_of_outlier_values,
'count': number_of_prices
}
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
FAQs
A Python package that intelligently selects the most robust average (mean, median, or mode) for price analysis
We found that robust-average demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.