Series Computations
- 1 Change the pandas.series elements using apply and transform Functions apply() and transform() change the values of a pandas.series elements by accepting a mathematical function like sin() or cosine() of math library. The Python examples change the pandas.series elements by using such functions. 11 Aug 2019
- 2 Compute correlation coefficient for the variables represented by two pandas.series objects The pandas function series.corr() computes correlation coefficient using any of the methods:Pearson, Kendall and Spearman. The Python example code computes correlation coefficient(r) between house price and years. 8 Aug 2019
- 3 Counting and retrieving Unique elements from a pandas.Series object The count() function returns the number of elements present in a pandas.series instance. The nunique() and unique() functions returns the unique count and unique elements. The python examples are provided for numeric, string and custom class object types. 11 Aug 2019
- 4 Cumulative Computations On Pandas Series The functions cumsum(), cumprod(), cummax() and cummin() of the pandas.series class perform the operations cumulative sum, product, minimum and maximum. The python examples compute the cumulative results on sample data. 9 Aug 2019
- 5 Finding descriptive statistics of a pandas Series The describe() function of pandas Series returns the summary statistics which include Count, Mean, Standard Deviation, minimum value, quartiles and the maximum value. The Python example uses the rivers.csv from R Datasets to compute the summary statistics for the length of rivers in the USA. 10 Aug 2019
- 6 Finding kurtosis for a pandas.series The series.kurtosis() function of pandas in Python finds the Fisher"s kurtosis value for a distribution. The Python example finds kurtosis values for a Leptokurtic distribution and a Platykurtic distribution 12 Aug 2019
- 7 Find mean absolute deviation of a pandas.series The Python function mad() of the pandas.Series class calculates the Mean Absolute Deviation of a distribution. The pandas example code loads specific data into a Series from a CSV file and calculates the MAD of Assistant Professor Salaries. 13 Aug 2019
- 8 Monotonic functions A monotonic function either does not change the value of its output or increases it or decreases it with the changing value of its input. The pandas series has attributes to test for increasing as well as decreasing monotonic functions. 24 Oct 2019
- 9 Calculating percentage change between element values of a pandas series pct_change() function of pandas.series class in Python pandas library computes the percentage change between the element values. The example code computes the percentage change for stock prices stored in a pandas.series. 9 Aug 2019
- 10 Computing quantiles-Percentiles, Quintiles, Deciles, Quarters Quantile is a measure of location on a statistical distribution. The series.quantile() method finds the location below which the specific fraction of the data lies. The Python example loads a JSON file, loads scores into a pandas.Series and finds the first quarter, second quarter, third quarter, 1st percentile and 100th percentile. 13 Aug 2019
- 11 Rolling window calculations on a pandas series Computations can be performed on each subset of a pandas Series instance which are called rolling window calculations. The subsets are of uniform length. The class Rolling supports several popular computations like average,standard deviations and others including custom computations. 25 Jul 2020
- 12 Computing skewness for a distribution present in a pandas.series Skewness is a statistical measure for the symmetry of the distribution. The Series.skew() of Python pandas library computes the skewness of the distribution represented by the elements of a pandas Series. The Python code example reads the 10 year S&P returns from a csv file and computes skewness of returns. 12 Aug 2019
- 13 Retrieving the smallest and largest n numbers from a Pandas Series The methods nsmallest() and nlargest() returns the smallest and largest elements from a series. The original index from the main series is retained in the new series. 26 Oct 2019
- 14 Sorting a pandas.series The Python functions sort_values(), sort_index() of pandas.Series class sorts the elements based on the values and the index. The pandas example code sorts pandas.Series instances based on value as well as index. 13 Aug 2019