
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.