python
20 lines · 1 tab
Dr. Elena Vasquez
Apr 2026
1 tab
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
train_df = pd.read_parquet('train_features.parquet')
prod_df = pd.read_parquet('production_features.parquet')
train_df['dataset'] = 'train'
prod_df['dataset'] = 'production'
combined = pd.concat([
train_df[['transaction_amount', 'dataset']],
prod_df[['transaction_amount', 'dataset']],
])
sns.kdeplot(data=combined, x='transaction_amount', hue='dataset', fill=True, common_norm=False)
plt.xscale('log')
plt.title('Distribution drift for transaction_amount')
plt.tight_layout()
plt.show()
1 file · python
Explain with highlit
I use distribution plots to decide whether a feature is stable enough to model, whether it needs transformation, or whether data drift is already happening. Seaborn makes it easy to compare classes, cohorts, or time windows. The visual check usually catches things that summary statistics hide.
Related snips
python
import numpy as np
from scipy import stats
control = np.array([21.1, 20.5, 19.9, 22.0, 20.8, 21.4])
treatment = np.array([22.8, 23.0, 22.2, 24.1, 23.5, 22.9])
Hypothesis testing for product experiments in Python
statistics
hypothesis-testing
scipy
by Dr. Elena Vasquez
1 tab
python
import numpy as np
from statsmodels.stats.proportion import proportions_ztest, confint_proportions_2indep
control_conversions = 920
control_users = 12_500
treatment_conversions = 1_015
A B testing analysis with confidence intervals and guardrails
ab-testing
experimentation
statistics
by Dr. Elena Vasquez
1 tab
python
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
sns.set_theme(style='whitegrid', palette='deep', context='talk')
plt.rcParams.update({
Matplotlib and Seaborn defaults that make charts publication ready
matplotlib
seaborn
visualization
by Dr. Elena Vasquez
1 tab
Share this code
Here's the card — post it anywhere.