data-science

How Data Science Answers Different Questions

Dimitar Petrov
The blog post starts here. import pandas as pd import numpy as np data = pd.DataFrame( data=np.random.normal(loc=0.0, scale=1.0, size=1000), columns=["gaussian_var"]) data[:10] gaussian_var 0 0.366702 1 0.0247435 2 1.72854 3 0.343894 4 -0.914733 5 -0.186893 6 -0.53095 7 -0.660085 8 -0.740802 9 1.55077 import altair as alt alt.renderers.enable( 'altair_saver', fmts=['svg'], embed_options={'scaleFactor': '1.5', 'theme': 'light'}, # method="selenium", # webdriver="chrome", ) alt.Chart(data).mark_bar().encode( x=alt.X("gaussian_var", bin=alt.BinParams(maxbins=100)), y="count()").properties(width=800)