Loading tutorials
pd.cut and pd.qcut, and later chapters cover them in detail. This chapter explains5 min readpd.cut in its simplest form: you give it a number of bins, and it splits the range of your data into that many intervals of the same width. La5 min readpd.cut split data into equal-width bins. Here you pass the edges yourself, which is the most common way pd.cut is used in real analysis.5 min readpd.cut with a list of bin edges and read a pandas Series. It covers one question: when a value sits exactly on a bin edge, which bin does it go to, and what happens if no bin claims it?5 min readpd.cut with explicit edges, as in the earlier chapters. It covers the object that pd.cut hands back, which is a categorical, and what you can do with it.5 min readlabels argument of pd.cut and pd.qcut. It assumes you can call both functions with explicit edges or a quantile count. It also assumes you know what the closed side of an interval means. If either is unfamiliar, review the earlier chapters on explicit edges and interval5 min readpd.cut and pd.qcut with explicit edges, and that you know what right=True and include_lowest do. It also assumes you can build a Series or DataFrame and filter it with a boolean mask. Here you learn why binning produces NaN, how to tell the causes apart, a5 min readpd.cut with explicit edges. Here you will learn how pd.qcut places bin edges at quantiles of your data, so each bin receives roughly the same number of rows.5 min readpd.qcut with an integer q and read the interval labels it produces. You should also know what a quantile is. A quantile is the value below which a given fraction of the data falls. The 0.25 quantile is the first quartile.5 min readpd.qcut can fail on data with many repeated values, what duplicates="drop" does about it, and what you give up when you use it. It assumes you know the basics of pd.qcut from the previous chapters. It also assumes you are comfortable with percentiles and with reading a 6 min readpd.cut and pd.qcut, that you know what a pandas Series is, and that you understand percentiles. Here you learn how to get back the bin edges that pandas computed, and what to do with them.5 min readpd.cut and pd.qcut with edges, labels and retbins, and that you know what a quantile is. It does not teach the syntax again. It covers how to decide which function fits a task, what goes wrong when you choose badly, and how to combine them.5 min readvalue_counts, and how to compute statistics per bin with groupby. It also covers the settings that decide whether empty or missing bins show up.6 min readpd.cut and pd.qcut from the earlier chapters, including explicit edges, interval closure and the categorical result. It also assumes you can build a Series and a DataFrame. Here you will learn to define bins once as an IntervalIndex and apply them to any number of5 min read