Loading tutorials
pd.cut splits a numeric column into a fixed number of bins of equal width.3 min readpd.cut call from the previous chapter. You pass the bin edges yourself instead of asking pandas to split the range into equal widths.2 min readpd.cut, and read a basic Series printout. Here you will learn how pandas decides which bin a value on an edge belongs to.2 min readpd.cut with explicit bin edges. Here you look at the object cut returns, because that object explains most of the behavior you will see later.2 min readpd.cut with explicit edges and know that intervals are closed on the right by default. It covers how the labels argument names the bins and what the labelled result looks like.2 min readpd.cut with explicit edges, and read interval notation such as (0, 18]. Binning functions never raise an error when a value has no bin. They return NaN for that value. This chapter shows how to find those NaN values, tell their causes apart, 2 min readpd.cut with explicit edges. Here you will learn how pd.qcut chooses its own edges so that each bin holds about the same number of rows.2 min readpd.qcut with an integer q and that you know what a quantile is. Here you will pass q a list of fractions to place the cut points where you want them.2 min readpd.qcut with an integer number of quantiles and that you know what a quantile is. It covers why qcut can fail on data with many repeated values and how to handle that.2 min readpd.cut and pd.qcut, and that you know how right-closed intervals work. It shows how to get the bin edges back from either function.2 min readpd.cut and pd.qcut and know what bin edges are. It covers how to decide which function fits a task.2 min readpd.cut and pd.qcut return a categorical result. Binning is rarely the last step. You usually bin a column so you can count or aggregate rows by band.2 min readpd.cut and pd.qcut, the right and include_lowest parameters, and the categorical result that binning returns. It shows how to build the bins once and apply them to more than one dataset.2 min read