Pivot Tables
Pivot tables reshape data to create summary tables with rows and columns from your data values.
Basic Pivot Table
Create a summary table:
Loading Pandas Playground...
Aggregation Functions
Specify how to aggregate values:
Loading Pandas Playground...
Multiple Values
Pivot multiple columns:
Loading Pandas Playground...
Adding Totals
Include row and column totals:
Loading Pandas Playground...
Handling Missing Values
Fill or handle NaN in pivots:
Loading Pandas Playground...
Multiple Index Levels
Create hierarchical pivots:
Loading Pandas Playground...
Exercise: Sales Pivot
Loading Exercise...
Exercise: Pivot with Totals
Loading Exercise...
Key Points
pivot_table()creates summary tablesindex=for row labels,columns=for column headersvalues=specifies data to aggregateaggfunc=sets aggregation (default is 'mean')margins=Trueadds row/column totalsfill_value=replaces NaN
التالي · الدرس 22 من 42
Cross Tabulation
قراءة 1 دقيقة
أنهيت 21 من 42 درسًا

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

