I have a dataframe with all numeric columns:
import pandas as pd
import numpy as np
np.random.seed(1001)
df = pd.DataFrame(np.random.randn(10, 2), columns=['A', 'B'])
I want to create common quantiles which includes all values of A
and B
. There are some missing values in both. Once the common quantiles are created I want to encode values in the dataframe to show labels according to what quantile the values fall within. I can do it column wise for every column but how can I do it over a dataframe?