Variance is the measure of, the spread between numbers, in a given data set. In other words, it means, how far each number in the data set is, from the mean of this data set. 2. Covariance is the measure of, the directional relationship between, two random variables. In other words, covariance measures, how much, … Continue reading Difference between Variance and Covariance

# Pandas

# Pandas Groupby apply Function on each Group Item

Here we are trying to write a solution for Group by COULUMN_2 Sum the COULUMN_1 values in each group and divide each COULUMN_1 values by Sum of it's group total. # using transform function df_new = df[['COULUMN_1','COULUMN_2']] grp = df_new.groupby('COULUMN_2') sc = lambda x: (x) / x.sum() # sum the COULUMN_1 values in each group … Continue reading Pandas Groupby apply Function on each Group Item

# Handling missing data in pandas data frame python

In this post we are going to discuss how to handle missing data from a pandas data frame. Find total number of missing data in the data frame missing_total = df.isnull().sum().sum() Find number of missing data in each column in a data frame missing_per_column = df.isnull().sum() Investigate patterns in the amount of missing data in … Continue reading Handling missing data in pandas data frame python

# Scaling Data Range using Min Max Scaler

Suppose you have a dataset that has float values and all values in the range 0 to 1. You want to change all values to integer with a range between 10 to 20. In this post we will learn how to do this using MinMaxScaler Data before scaling Now let us scale the data as … Continue reading Scaling Data Range using Min Max Scaler

# Scatter Plot using Regplot Function of Seaborn

Though we have an obvious method named, scatterplot, provided by seaborn to draw a scatterplot, seaborn provides other methods as well to draw scatter plot. One of the other method is regplot. However when we create scatter plots using seaborn's regplot method, it will introduce a regression line in the plot as regplot is based … Continue reading Scatter Plot using Regplot Function of Seaborn

# How to Enable Intellisense or Autocomplete in Jupyter Notebook

No matter how good you are in programming with respect to a language like python you may not be able to remember all the functions names or syntax or function parameters. So you may require to use intellisense or autocomplete feature of Jupyter notebook while programming in pandas, python and similar libraries. In the below … Continue reading How to Enable Intellisense or Autocomplete in Jupyter Notebook

# How to Disable Warnings in Python and Pandas

Many a times when you run Python code in pandas you get warnings like below Disable or filter or suppress warning in python pandas However for various reasons you may want to disable or filter these warnings. For that use the below code import warnings warnings.filterwarnings("ignore") This will disable all the warnings and code will … Continue reading How to Disable Warnings in Python and Pandas