Binning Data
Convert continuous values into discrete categories using cut() and qcut().
Basic Binning with cut()
Divide values into fixed-width bins:
Loading Pandas Playground...
Custom Bin Edges
Specify exact boundaries:
Loading Pandas Playground...
Quantile-Based Binning with qcut()
Create bins with equal number of observations:
Loading Pandas Playground...
Without Labels
Get the actual bin ranges:
Loading Pandas Playground...
Include Edge Values
Control which edge is included:
Loading Pandas Playground...
Binning for Visualization
Prepare data for histograms:
Loading Pandas Playground...
Exercise: Grade Bins
Loading Exercise...
Exercise: Quartile Split
Loading Exercise...
Key Points
pd.cut()creates equal-width binspd.qcut()creates equal-frequency binsbins=defines boundaries or number of binslabels=assigns names to binsright=Falseincludes left edge instead- Useful for grading, grouping, visualization
التالي · الدرس 33 من 42
Reshaping Data
قراءة 1 دقيقة
أنهيت 32 من 42 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

