snapedautility.detect_outliers

Module Contents

Functions

detect_outliers(s, width=250, height=250)

Detects outliers in a pandas series

snapedautility.detect_outliers.detect_outliers(s, width=250, height=250)[source]

Detects outliers in a pandas series Returns a threshold value for the lower bound and upper bound of the outliers and Plot a violin plot of the observations :param s: Pandas Series for which the outliers need to be found :type s: pandas.core.series.Series :param width: The width of the plot. Default set to 250 :type width: int, default = 250 :param height: The height of the plot. Default set to 250 :type height: int, default = 250

Returns

  • List of integers – Boolean array with same length as the input, indices of outlier marked.

  • altair plot – An interactive altair correlation plot

Examples

>>> from snapedautility.detect_outliers import detect_outliers
>>> s = pd.Series([1,1,2,3,4,5,6,9,10,13,40])
>>> detect_outliers(s)
[-8.0 , 20.0],  alt.Chart(...)