[{"data":1,"prerenderedAt":2965},["ShallowReactive",2],{"tutorials-pandas":3,"category-items-pandas":387,"content-/pandas/grouping-and-aggregation":388},[4,21,31,40,49,58,67,78,87,96,105,116,125,134,143,154,163,172,181,192,201,210,219,228,239,248,257,266,276,285,294,303,313,322,331,341,350,359,369,378],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":6,"title":8,"description":9,"slug":10,"order":11,"isParent":12,"icon":13,"_type":14,"_id":15,"_source":16,"_file":17,"_stem":18,"_extension":19,"children":20,"expanded":12},"/pandas","",false,"Getting Started","Learn the basics of Pandas, Python's powerful data analysis library for working with spreadsheet-like data","getting-started",1,true,"pi pi-play","markdown","content:pandas:1.index.md","content","pandas/1.index.md","pandas/1.index","md",[21,31,40,49,58],{"_path":22,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":14,"_id":28,"_source":16,"_file":29,"_stem":30,"_extension":19},"/pandas/what-is-pandas","pandas","What is Pandas","Understand what Pandas is, why it's essential for data analysis, and how it makes working with data simple and powerful","what-is-pandas",2,"content:pandas:2.what-is-pandas.md","pandas/2.what-is-pandas.md","pandas/2.what-is-pandas",{"_path":32,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":14,"_id":37,"_source":16,"_file":38,"_stem":39,"_extension":19},"/pandas/installing-pandas","Installing Pandas","Learn how to install Pandas on your computer and verify it's working properly","installing-pandas",3,"content:pandas:3.installing-pandas.md","pandas/3.installing-pandas.md","pandas/3.installing-pandas",{"_path":41,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":14,"_id":46,"_source":16,"_file":47,"_stem":48,"_extension":19},"/pandas/your-first-dataframe","Your First DataFrame","Create your first Pandas DataFrame and learn the basics of working with tabular data","your-first-dataframe",4,"content:pandas:4.your-first-dataframe.md","pandas/4.your-first-dataframe.md","pandas/4.your-first-dataframe",{"_path":50,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":14,"_id":55,"_source":16,"_file":56,"_stem":57,"_extension":19},"/pandas/series-vs-dataframe","Series vs DataFrame","Understand the difference between Pandas Series and DataFrames, and learn when to use each one","series-vs-dataframe",5,"content:pandas:5.series-vs-dataframe.md","pandas/5.series-vs-dataframe.md","pandas/5.series-vs-dataframe",{"_path":59,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":14,"_id":64,"_source":16,"_file":65,"_stem":66,"_extension":19},"/pandas/basic-dataframe-info","Basic DataFrame Info","Learn how to explore and get basic information about your DataFrames to understand your data","basic-dataframe-info",6,"content:pandas:6.basic-dataframe-info.md","pandas/6.basic-dataframe-info.md","pandas/6.basic-dataframe-info",{"_path":68,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":69,"description":70,"slug":71,"order":72,"isParent":12,"icon":73,"_type":14,"_id":74,"_source":16,"_file":75,"_stem":76,"_extension":19,"children":77,"expanded":12},"/pandas/loading-data","Loading Data","Learn how to load data from various sources into Pandas DataFrames","loading-data",7,"pi pi-download","content:pandas:7.loading-data.md","pandas/7.loading-data.md","pandas/7.loading-data",[78,87,96],{"_path":79,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":80,"description":81,"slug":82,"parentId":68,"order":83,"_type":14,"_id":84,"_source":16,"_file":85,"_stem":86,"_extension":19},"/pandas/reading-files","Reading Files (CSV, Excel, JSON)","Learn how to load data from CSV, Excel, and JSON files into Pandas DataFrames","reading-files",8,"content:pandas:8.reading-files.md","pandas/8.reading-files.md","pandas/8.reading-files",{"_path":88,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":89,"description":90,"slug":91,"parentId":68,"order":92,"_type":14,"_id":93,"_source":16,"_file":94,"_stem":95,"_extension":19},"/pandas/loading-from-databases","Loading from Databases","Learn how to connect to databases and load data directly into Pandas DataFrames","loading-from-databases",9,"content:pandas:9.loading-from-databases.md","pandas/9.loading-from-databases.md","pandas/9.loading-from-databases",{"_path":97,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":98,"description":99,"slug":100,"parentId":68,"order":101,"_type":14,"_id":102,"_source":16,"_file":103,"_stem":104,"_extension":19},"/pandas/handling-file-errors","Handling File Errors","Learn how to handle common errors when loading data files and how to troubleshoot loading problems","handling-file-errors",10,"content:pandas:10.handling-file-errors.md","pandas/10.handling-file-errors.md","pandas/10.handling-file-errors",{"_path":106,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":107,"description":108,"slug":109,"order":110,"isParent":12,"icon":111,"_type":14,"_id":112,"_source":16,"_file":113,"_stem":114,"_extension":19,"children":115,"expanded":12},"/pandas/data-exploration","Data Exploration","Learn how to explore and understand your data using Pandas methods and techniques","data-exploration",11,"pi pi-search","content:pandas:11.data-exploration.md","pandas/11.data-exploration.md","pandas/11.data-exploration",[116,125,134],{"_path":117,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":118,"description":119,"slug":120,"parentId":106,"order":121,"_type":14,"_id":122,"_source":16,"_file":123,"_stem":124,"_extension":19},"/pandas/viewing-your-data","Viewing Your Data","Learn different ways to look at and sample your DataFrame data for exploration and understanding","viewing-your-data",12,"content:pandas:12.viewing-your-data.md","pandas/12.viewing-your-data.md","pandas/12.viewing-your-data",{"_path":126,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":127,"description":128,"slug":129,"parentId":106,"order":130,"_type":14,"_id":131,"_source":16,"_file":132,"_stem":133,"_extension":19},"/pandas/data-shape-and-statistics","Data Shape and Statistics","Learn how to understand your DataFrame's size, structure, and get basic statistical summaries","data-shape-and-statistics",13,"content:pandas:13.data-shape-and-statistics.md","pandas/13.data-shape-and-statistics.md","pandas/13.data-shape-and-statistics",{"_path":135,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":136,"description":137,"slug":138,"parentId":106,"order":139,"_type":14,"_id":140,"_source":16,"_file":141,"_stem":142,"_extension":19},"/pandas/column-information-and-data-types","Column Information and Data Types","Learn how to explore individual columns and understand different data types in your DataFrames","column-information-and-data-types",14,"content:pandas:14.column-information-and-data-types.md","pandas/14.column-information-and-data-types.md","pandas/14.column-information-and-data-types",{"_path":144,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":145,"description":146,"slug":147,"order":148,"isParent":12,"icon":149,"_type":14,"_id":150,"_source":16,"_file":151,"_stem":152,"_extension":19,"children":153,"expanded":12},"/pandas/selecting-data","Selecting Data","Learn how to select specific columns, rows, and subsets of data from your DataFrames","selecting-data",15,"pi pi-filter","content:pandas:15.selecting-data.md","pandas/15.selecting-data.md","pandas/15.selecting-data",[154,163,172],{"_path":155,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":156,"description":157,"slug":158,"parentId":144,"order":159,"_type":14,"_id":160,"_source":16,"_file":161,"_stem":162,"_extension":19},"/pandas/selecting-columns-and-rows","Selecting Columns and Rows","Learn how to select specific columns and rows from your DataFrames using basic selection techniques","selecting-columns-and-rows",16,"content:pandas:16.selecting-columns-and-rows.md","pandas/16.selecting-columns-and-rows.md","pandas/16.selecting-columns-and-rows",{"_path":164,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":165,"description":166,"slug":167,"parentId":144,"order":168,"_type":14,"_id":169,"_source":16,"_file":170,"_stem":171,"_extension":19},"/pandas/using-loc-and-iloc","Using loc and iloc","Master precise data selection with label-based (loc) and position-based (iloc) indexing in pandas","using-loc-and-iloc",17,"content:pandas:17.using-loc-and-iloc.md","pandas/17.using-loc-and-iloc.md","pandas/17.using-loc-and-iloc",{"_path":173,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":174,"description":175,"slug":176,"parentId":144,"order":177,"_type":14,"_id":178,"_source":16,"_file":179,"_stem":180,"_extension":19},"/pandas/boolean-and-conditional-selection","Boolean and Conditional Selection","Learn to filter DataFrames using conditions, boolean logic, and multiple criteria for precise data selection","boolean-and-conditional-selection",18,"content:pandas:18.boolean-and-conditional-selection.md","pandas/18.boolean-and-conditional-selection.md","pandas/18.boolean-and-conditional-selection",{"_path":182,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":183,"description":184,"slug":185,"order":186,"isParent":12,"icon":187,"_type":14,"_id":188,"_source":16,"_file":189,"_stem":190,"_extension":19,"children":191,"expanded":12},"/pandas/data-cleaning","Data Cleaning","Learn essential data cleaning techniques to prepare messy data for analysis","data-cleaning",19,"pi pi-wrench","content:pandas:19.data-cleaning.md","pandas/19.data-cleaning.md","pandas/19.data-cleaning",[192,201,210,219],{"_path":193,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":194,"description":195,"slug":196,"parentId":182,"order":197,"_type":14,"_id":198,"_source":16,"_file":199,"_stem":200,"_extension":19},"/pandas/handling-missing-data","Handling Missing Data","Learn to identify, fill, and remove missing values in your DataFrames effectively","handling-missing-data",20,"content:pandas:20.handling-missing-data.md","pandas/20.handling-missing-data.md","pandas/20.handling-missing-data",{"_path":202,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":203,"description":204,"slug":205,"parentId":182,"order":206,"_type":14,"_id":207,"_source":16,"_file":208,"_stem":209,"_extension":19},"/pandas/removing-duplicates","Removing Duplicates","Learn to find and eliminate duplicate rows from your DataFrames to ensure data quality","removing-duplicates",21,"content:pandas:21.removing-duplicates.md","pandas/21.removing-duplicates.md","pandas/21.removing-duplicates",{"_path":211,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":212,"description":213,"slug":214,"parentId":182,"order":215,"_type":14,"_id":216,"_source":16,"_file":217,"_stem":218,"_extension":19},"/pandas/data-type-conversion","Data Type Conversion","Learn to convert data to the right types for proper analysis and calculations","data-type-conversion",22,"content:pandas:22.data-type-conversion.md","pandas/22.data-type-conversion.md","pandas/22.data-type-conversion",{"_path":220,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":221,"description":222,"slug":223,"parentId":182,"order":224,"_type":14,"_id":225,"_source":16,"_file":226,"_stem":227,"_extension":19},"/pandas/string-cleaning-operations","String Cleaning Operations","Learn to clean and standardize text data for consistent analysis using pandas string methods","string-cleaning-operations",23,"content:pandas:23.string-cleaning-operations.md","pandas/23.string-cleaning-operations.md","pandas/23.string-cleaning-operations",{"_path":229,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":230,"description":231,"slug":232,"order":233,"isParent":12,"icon":234,"_type":14,"_id":235,"_source":16,"_file":236,"_stem":237,"_extension":19,"children":238,"expanded":12},"/pandas/data-transformation","Data Transformation","Learn how to modify, add, and transform data in your DataFrames for analysis","data-transformation",24,"pi pi-folder","content:pandas:24.data-transformation.md","pandas/24.data-transformation.md","pandas/24.data-transformation",[239,248,257],{"_path":240,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":241,"description":242,"slug":243,"parentId":229,"order":244,"_type":14,"_id":245,"_source":16,"_file":246,"_stem":247,"_extension":19},"/pandas/adding-and-modifying-columns","Adding and Modifying Columns","Learn how to create new columns and update existing ones with calculations and conditional logic","adding-and-modifying-columns",25,"content:pandas:25.adding-and-modifying-columns.md","pandas/25.adding-and-modifying-columns.md","pandas/25.adding-and-modifying-columns",{"_path":249,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":250,"description":251,"slug":252,"parentId":229,"order":253,"_type":14,"_id":254,"_source":16,"_file":255,"_stem":256,"_extension":19},"/pandas/applying-functions","Applying Functions","Use built-in and custom functions to transform your data efficiently","applying-functions",26,"content:pandas:26.applying-functions.md","pandas/26.applying-functions.md","pandas/26.applying-functions",{"_path":258,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":259,"description":260,"slug":261,"parentId":229,"order":262,"_type":14,"_id":263,"_source":16,"_file":264,"_stem":265,"_extension":19},"/pandas/renaming-and-sorting-data","Renaming and Sorting Data","Organize your DataFrame with better column names and logical data ordering","renaming-and-sorting-data",27,"content:pandas:27.renaming-and-sorting-data.md","pandas/27.renaming-and-sorting-data.md","pandas/27.renaming-and-sorting-data",{"_path":267,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":268,"description":269,"slug":270,"order":271,"isParent":12,"icon":234,"_type":14,"_id":272,"_source":16,"_file":273,"_stem":274,"_extension":19,"children":275},"/pandas/grouping-and-aggregation","Grouping and Aggregation","Learn to group data and calculate summary statistics for powerful data analysis","grouping-and-aggregation",28,"content:pandas:28.grouping-and-aggregation.md","pandas/28.grouping-and-aggregation.md","pandas/28.grouping-and-aggregation",[276,285,294],{"_path":277,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":278,"description":279,"slug":280,"parentId":267,"order":281,"_type":14,"_id":282,"_source":16,"_file":283,"_stem":284,"_extension":19},"/pandas/groupby-operations","GroupBy Operations","Learn the fundamentals of splitting data into groups and basic aggregations","groupby-operations",29,"content:pandas:29.groupby-operations.md","pandas/29.groupby-operations.md","pandas/29.groupby-operations",{"_path":286,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":287,"description":288,"slug":289,"parentId":267,"order":290,"_type":14,"_id":291,"_source":16,"_file":292,"_stem":293,"_extension":19},"/pandas/aggregation-functions","Aggregation Functions","Explore different ways to summarize your grouped data with built-in and custom functions","aggregation-functions",30,"content:pandas:30.aggregation-functions.md","pandas/30.aggregation-functions.md","pandas/30.aggregation-functions",{"_path":295,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":296,"description":297,"slug":298,"parentId":267,"order":299,"_type":14,"_id":300,"_source":16,"_file":301,"_stem":302,"_extension":19},"/pandas/pivot-tables-and-cross-tabulation","Pivot Tables and Cross Tabulation","Create powerful summary tables and cross-tabulations for analysis","pivot-tables-and-cross-tabulation",31,"content:pandas:31.pivot-tables-and-cross-tabulation.md","pandas/31.pivot-tables-and-cross-tabulation.md","pandas/31.pivot-tables-and-cross-tabulation",{"_path":304,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":305,"description":306,"slug":307,"order":308,"isParent":12,"icon":234,"_type":14,"_id":309,"_source":16,"_file":310,"_stem":311,"_extension":19,"children":312},"/pandas/combining-data","Combining Data","Learn to combine data from multiple DataFrames for comprehensive analysis","combining-data",32,"content:pandas:32.combining-data.md","pandas/32.combining-data.md","pandas/32.combining-data",[313,322],{"_path":314,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":315,"description":316,"slug":317,"parentId":304,"order":318,"_type":14,"_id":319,"_source":16,"_file":320,"_stem":321,"_extension":19},"/pandas/concatenating-dataframes","Concatenating DataFrames","Learn to stack DataFrames vertically and horizontally for simple data combination","concatenating-dataframes",33,"content:pandas:33.concatenating-dataframes.md","pandas/33.concatenating-dataframes.md","pandas/33.concatenating-dataframes",{"_path":323,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":324,"description":325,"slug":326,"parentId":304,"order":327,"_type":14,"_id":328,"_source":16,"_file":329,"_stem":330,"_extension":19},"/pandas/merging-and-join-operations","Merging and Join Operations","Master different types of joins to combine related data from multiple sources","merging-and-join-operations",34,"content:pandas:34.merging-and-join-operations.md","pandas/34.merging-and-join-operations.md","pandas/34.merging-and-join-operations",{"_path":332,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":333,"description":334,"slug":335,"order":336,"isParent":12,"icon":234,"_type":14,"_id":337,"_source":16,"_file":338,"_stem":339,"_extension":19,"children":340},"/pandas/working-with-dates","Working with Dates","Master date and time operations for time-based analysis and reporting","working-with-dates",35,"content:pandas:35.working-with-dates.md","pandas/35.working-with-dates.md","pandas/35.working-with-dates",[341,350],{"_path":342,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":343,"description":344,"slug":345,"parentId":332,"order":346,"_type":14,"_id":347,"_source":16,"_file":348,"_stem":349,"_extension":19},"/pandas/datetime-operations","DateTime Operations","Learn to convert, manipulate, and extract information from dates and times","datetime-operations",36,"content:pandas:36.datetime-operations.md","pandas/36.datetime-operations.md","pandas/36.datetime-operations",{"_path":351,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":352,"description":353,"slug":354,"parentId":332,"order":355,"_type":14,"_id":356,"_source":16,"_file":357,"_stem":358,"_extension":19},"/pandas/time-series-and-resampling","Time Series and Resampling","Discover how to analyze data over time periods and aggregate by different time intervals","time-series-and-resampling",37,"content:pandas:37.time-series-and-resampling.md","pandas/37.time-series-and-resampling.md","pandas/37.time-series-and-resampling",{"_path":360,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":361,"description":362,"slug":363,"order":364,"isParent":12,"icon":234,"_type":14,"_id":365,"_source":16,"_file":366,"_stem":367,"_extension":19,"children":368},"/pandas/saving-your-work","Saving Your Work","Learn to export your analyzed data to different formats for sharing and reporting","saving-your-work",38,"content:pandas:38.saving-your-work.md","pandas/38.saving-your-work.md","pandas/38.saving-your-work",[369,378],{"_path":370,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":371,"description":372,"slug":373,"parentId":360,"order":374,"_type":14,"_id":375,"_source":16,"_file":376,"_stem":377,"_extension":19},"/pandas/exporting-data","Exporting Data (CSV, Excel, JSON)","Learn to save your DataFrames to common file formats for sharing and reporting","exporting-data",39,"content:pandas:39.exporting-data.md","pandas/39.exporting-data.md","pandas/39.exporting-data",{"_path":379,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":380,"description":381,"slug":382,"parentId":360,"order":383,"_type":14,"_id":384,"_source":16,"_file":385,"_stem":386,"_extension":19},"/pandas/database-export","Database Export","Discover how to save data back to databases for integration with other systems","database-export",40,"content:pandas:40.database-export.md","pandas/40.database-export.md","pandas/40.database-export",[266],{"_path":267,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":268,"description":269,"slug":270,"order":271,"isParent":12,"icon":234,"body":389,"_type":14,"_id":272,"_source":16,"_file":273,"_stem":274,"_extension":19},{"type":390,"children":391,"toc":2954},"root",[392,400,406,411,954,961,966,1080,1086,1091,1128,1134,1139,1233,1239,1244,1915,1921,2088,2094,2099,2669,2675,2784,2790,2919,2925,2930,2943,2948],{"type":393,"tag":394,"props":395,"children":396},"element","h1",{"id":270},[397],{"type":398,"value":399},"text","📊 Grouping and Aggregation",{"type":393,"tag":401,"props":402,"children":403},"p",{},[404],{"type":398,"value":405},"Grouping and aggregation are among the most powerful features in pandas! They let you split your data into groups, calculate summaries for each group, and discover patterns you couldn't see before. This is essential for data analysis and reporting.",{"type":393,"tag":401,"props":407,"children":408},{},[409],{"type":398,"value":410},"Think of it like organizing your music by genre, then finding the average song length for each genre - you're grouping (by genre) and aggregating (calculating averages).",{"type":393,"tag":412,"props":413,"children":414},"code-try",{},[415],{"type":393,"tag":416,"props":417,"children":421},"pre",{"className":418,"code":419,"language":420,"meta":6,"style":6},"language-python shiki shiki-themes github-light github-dark","import pandas as pd\n\n# Sales data by department\nsales = pd.DataFrame({\n    'department': ['Sales', 'IT', 'Sales', 'HR', 'IT', 'Sales'],\n    'employee': ['Alice', 'Bob', 'Charlie', 'Diana', 'Eve', 'Frank'],\n    'revenue': [50000, 75000, 45000, 30000, 80000, 55000]\n})\n\nprint(\"Sales data:\")\nprint(sales)\nprint()\n\n# Group by department and calculate total revenue\ndept_summary = sales.groupby('department')['revenue'].sum()\nprint(\"Total revenue by department:\")\nprint(dept_summary)\nprint()\n\n# Multiple statistics at once\ndept_stats = sales.groupby('department')['revenue'].agg(['sum', 'mean', 'count'])\nprint(\"Department statistics:\")\nprint(dept_stats)\n","python",[422],{"type":393,"tag":423,"props":424,"children":425},"code",{"__ignoreMap":6},[426,453,461,470,488,555,621,689,697,704,727,739,751,758,766,803,823,835,846,853,861,922,942],{"type":393,"tag":427,"props":428,"children":430},"span",{"class":429,"line":11},"line",[431,437,443,448],{"type":393,"tag":427,"props":432,"children":434},{"style":433},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[435],{"type":398,"value":436},"import",{"type":393,"tag":427,"props":438,"children":440},{"style":439},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[441],{"type":398,"value":442}," pandas ",{"type":393,"tag":427,"props":444,"children":445},{"style":433},[446],{"type":398,"value":447},"as",{"type":393,"tag":427,"props":449,"children":450},{"style":439},[451],{"type":398,"value":452}," pd\n",{"type":393,"tag":427,"props":454,"children":455},{"class":429,"line":27},[456],{"type":393,"tag":427,"props":457,"children":458},{"emptyLinePlaceholder":12},[459],{"type":398,"value":460},"\n",{"type":393,"tag":427,"props":462,"children":463},{"class":429,"line":36},[464],{"type":393,"tag":427,"props":465,"children":467},{"style":466},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[468],{"type":398,"value":469},"# Sales data by department\n",{"type":393,"tag":427,"props":471,"children":472},{"class":429,"line":45},[473,478,483],{"type":393,"tag":427,"props":474,"children":475},{"style":439},[476],{"type":398,"value":477},"sales ",{"type":393,"tag":427,"props":479,"children":480},{"style":433},[481],{"type":398,"value":482},"=",{"type":393,"tag":427,"props":484,"children":485},{"style":439},[486],{"type":398,"value":487}," pd.DataFrame({\n",{"type":393,"tag":427,"props":489,"children":490},{"class":429,"line":54},[491,497,502,507,512,517,521,525,529,534,538,542,546,550],{"type":393,"tag":427,"props":492,"children":494},{"style":493},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[495],{"type":398,"value":496},"    'department'",{"type":393,"tag":427,"props":498,"children":499},{"style":439},[500],{"type":398,"value":501},": [",{"type":393,"tag":427,"props":503,"children":504},{"style":493},[505],{"type":398,"value":506},"'Sales'",{"type":393,"tag":427,"props":508,"children":509},{"style":439},[510],{"type":398,"value":511},", ",{"type":393,"tag":427,"props":513,"children":514},{"style":493},[515],{"type":398,"value":516},"'IT'",{"type":393,"tag":427,"props":518,"children":519},{"style":439},[520],{"type":398,"value":511},{"type":393,"tag":427,"props":522,"children":523},{"style":493},[524],{"type":398,"value":506},{"type":393,"tag":427,"props":526,"children":527},{"style":439},[528],{"type":398,"value":511},{"type":393,"tag":427,"props":530,"children":531},{"style":493},[532],{"type":398,"value":533},"'HR'",{"type":393,"tag":427,"props":535,"children":536},{"style":439},[537],{"type":398,"value":511},{"type":393,"tag":427,"props":539,"children":540},{"style":493},[541],{"type":398,"value":516},{"type":393,"tag":427,"props":543,"children":544},{"style":439},[545],{"type":398,"value":511},{"type":393,"tag":427,"props":547,"children":548},{"style":493},[549],{"type":398,"value":506},{"type":393,"tag":427,"props":551,"children":552},{"style":439},[553],{"type":398,"value":554},"],\n",{"type":393,"tag":427,"props":556,"children":557},{"class":429,"line":63},[558,563,567,572,576,581,585,590,594,599,603,608,612,617],{"type":393,"tag":427,"props":559,"children":560},{"style":493},[561],{"type":398,"value":562},"    'employee'",{"type":393,"tag":427,"props":564,"children":565},{"style":439},[566],{"type":398,"value":501},{"type":393,"tag":427,"props":568,"children":569},{"style":493},[570],{"type":398,"value":571},"'Alice'",{"type":393,"tag":427,"props":573,"children":574},{"style":439},[575],{"type":398,"value":511},{"type":393,"tag":427,"props":577,"children":578},{"style":493},[579],{"type":398,"value":580},"'Bob'",{"type":393,"tag":427,"props":582,"children":583},{"style":439},[584],{"type":398,"value":511},{"type":393,"tag":427,"props":586,"children":587},{"style":493},[588],{"type":398,"value":589},"'Charlie'",{"type":393,"tag":427,"props":591,"children":592},{"style":439},[593],{"type":398,"value":511},{"type":393,"tag":427,"props":595,"children":596},{"style":493},[597],{"type":398,"value":598},"'Diana'",{"type":393,"tag":427,"props":600,"children":601},{"style":439},[602],{"type":398,"value":511},{"type":393,"tag":427,"props":604,"children":605},{"style":493},[606],{"type":398,"value":607},"'Eve'",{"type":393,"tag":427,"props":609,"children":610},{"style":439},[611],{"type":398,"value":511},{"type":393,"tag":427,"props":613,"children":614},{"style":493},[615],{"type":398,"value":616},"'Frank'",{"type":393,"tag":427,"props":618,"children":619},{"style":439},[620],{"type":398,"value":554},{"type":393,"tag":427,"props":622,"children":623},{"class":429,"line":72},[624,629,633,639,643,648,652,657,661,666,670,675,679,684],{"type":393,"tag":427,"props":625,"children":626},{"style":493},[627],{"type":398,"value":628},"    'revenue'",{"type":393,"tag":427,"props":630,"children":631},{"style":439},[632],{"type":398,"value":501},{"type":393,"tag":427,"props":634,"children":636},{"style":635},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[637],{"type":398,"value":638},"50000",{"type":393,"tag":427,"props":640,"children":641},{"style":439},[642],{"type":398,"value":511},{"type":393,"tag":427,"props":644,"children":645},{"style":635},[646],{"type":398,"value":647},"75000",{"type":393,"tag":427,"props":649,"children":650},{"style":439},[651],{"type":398,"value":511},{"type":393,"tag":427,"props":653,"children":654},{"style":635},[655],{"type":398,"value":656},"45000",{"type":393,"tag":427,"props":658,"children":659},{"style":439},[660],{"type":398,"value":511},{"type":393,"tag":427,"props":662,"children":663},{"style":635},[664],{"type":398,"value":665},"30000",{"type":393,"tag":427,"props":667,"children":668},{"style":439},[669],{"type":398,"value":511},{"type":393,"tag":427,"props":671,"children":672},{"style":635},[673],{"type":398,"value":674},"80000",{"type":393,"tag":427,"props":676,"children":677},{"style":439},[678],{"type":398,"value":511},{"type":393,"tag":427,"props":680,"children":681},{"style":635},[682],{"type":398,"value":683},"55000",{"type":393,"tag":427,"props":685,"children":686},{"style":439},[687],{"type":398,"value":688},"]\n",{"type":393,"tag":427,"props":690,"children":691},{"class":429,"line":83},[692],{"type":393,"tag":427,"props":693,"children":694},{"style":439},[695],{"type":398,"value":696},"})\n",{"type":393,"tag":427,"props":698,"children":699},{"class":429,"line":92},[700],{"type":393,"tag":427,"props":701,"children":702},{"emptyLinePlaceholder":12},[703],{"type":398,"value":460},{"type":393,"tag":427,"props":705,"children":706},{"class":429,"line":101},[707,712,717,722],{"type":393,"tag":427,"props":708,"children":709},{"style":635},[710],{"type":398,"value":711},"print",{"type":393,"tag":427,"props":713,"children":714},{"style":439},[715],{"type":398,"value":716},"(",{"type":393,"tag":427,"props":718,"children":719},{"style":493},[720],{"type":398,"value":721},"\"Sales data:\"",{"type":393,"tag":427,"props":723,"children":724},{"style":439},[725],{"type":398,"value":726},")\n",{"type":393,"tag":427,"props":728,"children":729},{"class":429,"line":110},[730,734],{"type":393,"tag":427,"props":731,"children":732},{"style":635},[733],{"type":398,"value":711},{"type":393,"tag":427,"props":735,"children":736},{"style":439},[737],{"type":398,"value":738},"(sales)\n",{"type":393,"tag":427,"props":740,"children":741},{"class":429,"line":121},[742,746],{"type":393,"tag":427,"props":743,"children":744},{"style":635},[745],{"type":398,"value":711},{"type":393,"tag":427,"props":747,"children":748},{"style":439},[749],{"type":398,"value":750},"()\n",{"type":393,"tag":427,"props":752,"children":753},{"class":429,"line":130},[754],{"type":393,"tag":427,"props":755,"children":756},{"emptyLinePlaceholder":12},[757],{"type":398,"value":460},{"type":393,"tag":427,"props":759,"children":760},{"class":429,"line":139},[761],{"type":393,"tag":427,"props":762,"children":763},{"style":466},[764],{"type":398,"value":765},"# Group by department and calculate total revenue\n",{"type":393,"tag":427,"props":767,"children":768},{"class":429,"line":148},[769,774,778,783,788,793,798],{"type":393,"tag":427,"props":770,"children":771},{"style":439},[772],{"type":398,"value":773},"dept_summary ",{"type":393,"tag":427,"props":775,"children":776},{"style":433},[777],{"type":398,"value":482},{"type":393,"tag":427,"props":779,"children":780},{"style":439},[781],{"type":398,"value":782}," sales.groupby(",{"type":393,"tag":427,"props":784,"children":785},{"style":493},[786],{"type":398,"value":787},"'department'",{"type":393,"tag":427,"props":789,"children":790},{"style":439},[791],{"type":398,"value":792},")[",{"type":393,"tag":427,"props":794,"children":795},{"style":493},[796],{"type":398,"value":797},"'revenue'",{"type":393,"tag":427,"props":799,"children":800},{"style":439},[801],{"type":398,"value":802},"].sum()\n",{"type":393,"tag":427,"props":804,"children":805},{"class":429,"line":159},[806,810,814,819],{"type":393,"tag":427,"props":807,"children":808},{"style":635},[809],{"type":398,"value":711},{"type":393,"tag":427,"props":811,"children":812},{"style":439},[813],{"type":398,"value":716},{"type":393,"tag":427,"props":815,"children":816},{"style":493},[817],{"type":398,"value":818},"\"Total revenue by department:\"",{"type":393,"tag":427,"props":820,"children":821},{"style":439},[822],{"type":398,"value":726},{"type":393,"tag":427,"props":824,"children":825},{"class":429,"line":168},[826,830],{"type":393,"tag":427,"props":827,"children":828},{"style":635},[829],{"type":398,"value":711},{"type":393,"tag":427,"props":831,"children":832},{"style":439},[833],{"type":398,"value":834},"(dept_summary)\n",{"type":393,"tag":427,"props":836,"children":837},{"class":429,"line":177},[838,842],{"type":393,"tag":427,"props":839,"children":840},{"style":635},[841],{"type":398,"value":711},{"type":393,"tag":427,"props":843,"children":844},{"style":439},[845],{"type":398,"value":750},{"type":393,"tag":427,"props":847,"children":848},{"class":429,"line":186},[849],{"type":393,"tag":427,"props":850,"children":851},{"emptyLinePlaceholder":12},[852],{"type":398,"value":460},{"type":393,"tag":427,"props":854,"children":855},{"class":429,"line":197},[856],{"type":393,"tag":427,"props":857,"children":858},{"style":466},[859],{"type":398,"value":860},"# Multiple statistics at once\n",{"type":393,"tag":427,"props":862,"children":863},{"class":429,"line":206},[864,869,873,877,881,885,889,894,899,903,908,912,917],{"type":393,"tag":427,"props":865,"children":866},{"style":439},[867],{"type":398,"value":868},"dept_stats ",{"type":393,"tag":427,"props":870,"children":871},{"style":433},[872],{"type":398,"value":482},{"type":393,"tag":427,"props":874,"children":875},{"style":439},[876],{"type":398,"value":782},{"type":393,"tag":427,"props":878,"children":879},{"style":493},[880],{"type":398,"value":787},{"type":393,"tag":427,"props":882,"children":883},{"style":439},[884],{"type":398,"value":792},{"type":393,"tag":427,"props":886,"children":887},{"style":493},[888],{"type":398,"value":797},{"type":393,"tag":427,"props":890,"children":891},{"style":439},[892],{"type":398,"value":893},"].agg([",{"type":393,"tag":427,"props":895,"children":896},{"style":493},[897],{"type":398,"value":898},"'sum'",{"type":393,"tag":427,"props":900,"children":901},{"style":439},[902],{"type":398,"value":511},{"type":393,"tag":427,"props":904,"children":905},{"style":493},[906],{"type":398,"value":907},"'mean'",{"type":393,"tag":427,"props":909,"children":910},{"style":439},[911],{"type":398,"value":511},{"type":393,"tag":427,"props":913,"children":914},{"style":493},[915],{"type":398,"value":916},"'count'",{"type":393,"tag":427,"props":918,"children":919},{"style":439},[920],{"type":398,"value":921},"])\n",{"type":393,"tag":427,"props":923,"children":924},{"class":429,"line":215},[925,929,933,938],{"type":393,"tag":427,"props":926,"children":927},{"style":635},[928],{"type":398,"value":711},{"type":393,"tag":427,"props":930,"children":931},{"style":439},[932],{"type":398,"value":716},{"type":393,"tag":427,"props":934,"children":935},{"style":493},[936],{"type":398,"value":937},"\"Department statistics:\"",{"type":393,"tag":427,"props":939,"children":940},{"style":439},[941],{"type":398,"value":726},{"type":393,"tag":427,"props":943,"children":944},{"class":429,"line":224},[945,949],{"type":393,"tag":427,"props":946,"children":947},{"style":635},[948],{"type":398,"value":711},{"type":393,"tag":427,"props":950,"children":951},{"style":439},[952],{"type":398,"value":953},"(dept_stats)\n",{"type":393,"tag":955,"props":956,"children":958},"h2",{"id":957},"why-grouping-and-aggregation-matter",[959],{"type":398,"value":960},"🎯 Why Grouping and Aggregation Matter",{"type":393,"tag":401,"props":962,"children":963},{},[964],{"type":398,"value":965},"Raw data often contains details, but insights come from summaries. Grouping helps you:",{"type":393,"tag":967,"props":968,"children":972},"info-box",{"emoji":969,"title":970,"type":971},"✨","Power of Grouping","info",[973,982,1002,1010,1028,1036,1054,1062],{"type":393,"tag":401,"props":974,"children":975},{},[976],{"type":393,"tag":977,"props":978,"children":979},"strong",{},[980],{"type":398,"value":981},"Discover Patterns:",{"type":393,"tag":983,"props":984,"children":985},"ul",{},[986,992,997],{"type":393,"tag":987,"props":988,"children":989},"li",{},[990],{"type":398,"value":991},"Which department has highest sales?",{"type":393,"tag":987,"props":993,"children":994},{},[995],{"type":398,"value":996},"What's the average age by region?",{"type":393,"tag":987,"props":998,"children":999},{},[1000],{"type":398,"value":1001},"How many orders per customer?",{"type":393,"tag":401,"props":1003,"children":1004},{},[1005],{"type":393,"tag":977,"props":1006,"children":1007},{},[1008],{"type":398,"value":1009},"Create Summaries:",{"type":393,"tag":983,"props":1011,"children":1012},{},[1013,1018,1023],{"type":393,"tag":987,"props":1014,"children":1015},{},[1016],{"type":398,"value":1017},"Total revenue by product category",{"type":393,"tag":987,"props":1019,"children":1020},{},[1021],{"type":398,"value":1022},"Average satisfaction by service type",{"type":393,"tag":987,"props":1024,"children":1025},{},[1026],{"type":398,"value":1027},"Count of issues by priority level",{"type":393,"tag":401,"props":1029,"children":1030},{},[1031],{"type":393,"tag":977,"props":1032,"children":1033},{},[1034],{"type":398,"value":1035},"Enable Comparisons:",{"type":393,"tag":983,"props":1037,"children":1038},{},[1039,1044,1049],{"type":393,"tag":987,"props":1040,"children":1041},{},[1042],{"type":398,"value":1043},"Compare performance across teams",{"type":393,"tag":987,"props":1045,"children":1046},{},[1047],{"type":398,"value":1048},"Identify top and bottom performers",{"type":393,"tag":987,"props":1050,"children":1051},{},[1052],{"type":398,"value":1053},"Spot trends over time periods",{"type":393,"tag":401,"props":1055,"children":1056},{},[1057],{"type":393,"tag":977,"props":1058,"children":1059},{},[1060],{"type":398,"value":1061},"Common Business Questions:",{"type":393,"tag":983,"props":1063,"children":1064},{},[1065,1070,1075],{"type":393,"tag":987,"props":1066,"children":1067},{},[1068],{"type":398,"value":1069},"Sales by region, product, or time period",{"type":393,"tag":987,"props":1071,"children":1072},{},[1073],{"type":398,"value":1074},"Customer behavior patterns",{"type":393,"tag":987,"props":1076,"children":1077},{},[1078],{"type":398,"value":1079},"Performance metrics by category",{"type":393,"tag":955,"props":1081,"children":1083},{"id":1082},"what-youll-learn-in-this-section",[1084],{"type":398,"value":1085},"📚 What You'll Learn in This Section",{"type":393,"tag":401,"props":1087,"children":1088},{},[1089],{"type":398,"value":1090},"Master the art of data summarization:",{"type":393,"tag":983,"props":1092,"children":1093},{},[1094,1106,1117],{"type":393,"tag":987,"props":1095,"children":1096},{},[1097,1099,1104],{"type":398,"value":1098},"🔗 ",{"type":393,"tag":1100,"props":1101,"children":1102},"a",{"href":277},[1103],{"type":398,"value":278},{"type":398,"value":1105}," Learn the fundamentals of splitting data into groups and basic aggregations.",{"type":393,"tag":987,"props":1107,"children":1108},{},[1109,1111,1115],{"type":398,"value":1110},"📈 ",{"type":393,"tag":1100,"props":1112,"children":1113},{"href":286},[1114],{"type":398,"value":287},{"type":398,"value":1116}," Explore different ways to summarize your grouped data with built-in and custom functions.",{"type":393,"tag":987,"props":1118,"children":1119},{},[1120,1122,1126],{"type":398,"value":1121},"📋 ",{"type":393,"tag":1100,"props":1123,"children":1124},{"href":295},[1125],{"type":398,"value":296},{"type":398,"value":1127}," Create powerful summary tables and cross-tabulations for analysis.",{"type":393,"tag":955,"props":1129,"children":1131},{"id":1130},"grouping-concepts",[1132],{"type":398,"value":1133},"🔍 Grouping Concepts",{"type":393,"tag":401,"props":1135,"children":1136},{},[1137],{"type":398,"value":1138},"Here's how grouping works conceptually:",{"type":393,"tag":967,"props":1140,"children":1144},{"emoji":1141,"title":1142,"type":1143},"🔄","The GroupBy Process","success",[1145,1153,1171,1179,1197,1205,1223],{"type":393,"tag":401,"props":1146,"children":1147},{},[1148],{"type":393,"tag":977,"props":1149,"children":1150},{},[1151],{"type":398,"value":1152},"Step 1: Split",{"type":393,"tag":983,"props":1154,"children":1155},{},[1156,1161,1166],{"type":393,"tag":987,"props":1157,"children":1158},{},[1159],{"type":398,"value":1160},"Take your DataFrame",{"type":393,"tag":987,"props":1162,"children":1163},{},[1164],{"type":398,"value":1165},"Split it into groups based on column values",{"type":393,"tag":987,"props":1167,"children":1168},{},[1169],{"type":398,"value":1170},"Each unique value becomes a group",{"type":393,"tag":401,"props":1172,"children":1173},{},[1174],{"type":393,"tag":977,"props":1175,"children":1176},{},[1177],{"type":398,"value":1178},"Step 2: Apply",{"type":393,"tag":983,"props":1180,"children":1181},{},[1182,1187,1192],{"type":393,"tag":987,"props":1183,"children":1184},{},[1185],{"type":398,"value":1186},"Apply a function to each group",{"type":393,"tag":987,"props":1188,"children":1189},{},[1190],{"type":398,"value":1191},"Calculate sum, mean, count, etc.",{"type":393,"tag":987,"props":1193,"children":1194},{},[1195],{"type":398,"value":1196},"Each group gets its own result",{"type":393,"tag":401,"props":1198,"children":1199},{},[1200],{"type":393,"tag":977,"props":1201,"children":1202},{},[1203],{"type":398,"value":1204},"Step 3: Combine",{"type":393,"tag":983,"props":1206,"children":1207},{},[1208,1213,1218],{"type":393,"tag":987,"props":1209,"children":1210},{},[1211],{"type":398,"value":1212},"Combine results into a new DataFrame or Series",{"type":393,"tag":987,"props":1214,"children":1215},{},[1216],{"type":398,"value":1217},"One row per group",{"type":393,"tag":987,"props":1219,"children":1220},{},[1221],{"type":398,"value":1222},"Shows the aggregated results",{"type":393,"tag":401,"props":1224,"children":1225},{},[1226,1231],{"type":393,"tag":977,"props":1227,"children":1228},{},[1229],{"type":398,"value":1230},"Example:",{"type":398,"value":1232}," Group employees by department → Calculate average salary per department → Get summary table",{"type":393,"tag":955,"props":1234,"children":1236},{"id":1235},"️-common-grouping-patterns",[1237],{"type":398,"value":1238},"🛠️ Common Grouping Patterns",{"type":393,"tag":401,"props":1240,"children":1241},{},[1242],{"type":398,"value":1243},"Here are the most frequent grouping operations you'll use:",{"type":393,"tag":412,"props":1245,"children":1246},{},[1247],{"type":393,"tag":416,"props":1248,"children":1250},{"className":418,"code":1249,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Customer orders data\norders = pd.DataFrame({\n    'customer': ['Alice', 'Bob', 'Alice', 'Charlie', 'Bob', 'Alice'],\n    'product': ['Laptop', 'Mouse', 'Keyboard', 'Laptop', 'Monitor', 'Mouse'],\n    'quantity': [1, 2, 1, 1, 1, 3],\n    'price': [999, 25, 75, 999, 300, 25]\n})\n\nprint(\"Customer orders:\")\nprint(orders)\nprint()\n\n# Pattern 1: Count by group\ncustomer_orders = orders.groupby('customer').size()\nprint(\"Orders per customer:\")\nprint(customer_orders)\nprint()\n\n# Pattern 2: Sum by group\ncustomer_total = orders.groupby('customer')['price'].sum()\nprint(\"Total spent per customer:\")\nprint(customer_total)\nprint()\n\n# Pattern 3: Multiple aggregations\ncustomer_summary = orders.groupby('customer').agg({\n    'quantity': 'sum',\n    'price': ['sum', 'mean']\n})\nprint(\"Customer summary:\")\nprint(customer_summary)\n",[1251],{"type":393,"tag":423,"props":1252,"children":1253},{"__ignoreMap":6},[1254,1273,1280,1288,1304,1364,1428,1491,1555,1562,1569,1589,1601,1612,1619,1627,1654,1674,1686,1697,1704,1712,1745,1765,1777,1788,1795,1803,1828,1849,1876,1883,1903],{"type":393,"tag":427,"props":1255,"children":1256},{"class":429,"line":11},[1257,1261,1265,1269],{"type":393,"tag":427,"props":1258,"children":1259},{"style":433},[1260],{"type":398,"value":436},{"type":393,"tag":427,"props":1262,"children":1263},{"style":439},[1264],{"type":398,"value":442},{"type":393,"tag":427,"props":1266,"children":1267},{"style":433},[1268],{"type":398,"value":447},{"type":393,"tag":427,"props":1270,"children":1271},{"style":439},[1272],{"type":398,"value":452},{"type":393,"tag":427,"props":1274,"children":1275},{"class":429,"line":27},[1276],{"type":393,"tag":427,"props":1277,"children":1278},{"emptyLinePlaceholder":12},[1279],{"type":398,"value":460},{"type":393,"tag":427,"props":1281,"children":1282},{"class":429,"line":36},[1283],{"type":393,"tag":427,"props":1284,"children":1285},{"style":466},[1286],{"type":398,"value":1287},"# Customer orders data\n",{"type":393,"tag":427,"props":1289,"children":1290},{"class":429,"line":45},[1291,1296,1300],{"type":393,"tag":427,"props":1292,"children":1293},{"style":439},[1294],{"type":398,"value":1295},"orders ",{"type":393,"tag":427,"props":1297,"children":1298},{"style":433},[1299],{"type":398,"value":482},{"type":393,"tag":427,"props":1301,"children":1302},{"style":439},[1303],{"type":398,"value":487},{"type":393,"tag":427,"props":1305,"children":1306},{"class":429,"line":54},[1307,1312,1316,1320,1324,1328,1332,1336,1340,1344,1348,1352,1356,1360],{"type":393,"tag":427,"props":1308,"children":1309},{"style":493},[1310],{"type":398,"value":1311},"    'customer'",{"type":393,"tag":427,"props":1313,"children":1314},{"style":439},[1315],{"type":398,"value":501},{"type":393,"tag":427,"props":1317,"children":1318},{"style":493},[1319],{"type":398,"value":571},{"type":393,"tag":427,"props":1321,"children":1322},{"style":439},[1323],{"type":398,"value":511},{"type":393,"tag":427,"props":1325,"children":1326},{"style":493},[1327],{"type":398,"value":580},{"type":393,"tag":427,"props":1329,"children":1330},{"style":439},[1331],{"type":398,"value":511},{"type":393,"tag":427,"props":1333,"children":1334},{"style":493},[1335],{"type":398,"value":571},{"type":393,"tag":427,"props":1337,"children":1338},{"style":439},[1339],{"type":398,"value":511},{"type":393,"tag":427,"props":1341,"children":1342},{"style":493},[1343],{"type":398,"value":589},{"type":393,"tag":427,"props":1345,"children":1346},{"style":439},[1347],{"type":398,"value":511},{"type":393,"tag":427,"props":1349,"children":1350},{"style":493},[1351],{"type":398,"value":580},{"type":393,"tag":427,"props":1353,"children":1354},{"style":439},[1355],{"type":398,"value":511},{"type":393,"tag":427,"props":1357,"children":1358},{"style":493},[1359],{"type":398,"value":571},{"type":393,"tag":427,"props":1361,"children":1362},{"style":439},[1363],{"type":398,"value":554},{"type":393,"tag":427,"props":1365,"children":1366},{"class":429,"line":63},[1367,1372,1376,1381,1385,1390,1394,1399,1403,1407,1411,1416,1420,1424],{"type":393,"tag":427,"props":1368,"children":1369},{"style":493},[1370],{"type":398,"value":1371},"    'product'",{"type":393,"tag":427,"props":1373,"children":1374},{"style":439},[1375],{"type":398,"value":501},{"type":393,"tag":427,"props":1377,"children":1378},{"style":493},[1379],{"type":398,"value":1380},"'Laptop'",{"type":393,"tag":427,"props":1382,"children":1383},{"style":439},[1384],{"type":398,"value":511},{"type":393,"tag":427,"props":1386,"children":1387},{"style":493},[1388],{"type":398,"value":1389},"'Mouse'",{"type":393,"tag":427,"props":1391,"children":1392},{"style":439},[1393],{"type":398,"value":511},{"type":393,"tag":427,"props":1395,"children":1396},{"style":493},[1397],{"type":398,"value":1398},"'Keyboard'",{"type":393,"tag":427,"props":1400,"children":1401},{"style":439},[1402],{"type":398,"value":511},{"type":393,"tag":427,"props":1404,"children":1405},{"style":493},[1406],{"type":398,"value":1380},{"type":393,"tag":427,"props":1408,"children":1409},{"style":439},[1410],{"type":398,"value":511},{"type":393,"tag":427,"props":1412,"children":1413},{"style":493},[1414],{"type":398,"value":1415},"'Monitor'",{"type":393,"tag":427,"props":1417,"children":1418},{"style":439},[1419],{"type":398,"value":511},{"type":393,"tag":427,"props":1421,"children":1422},{"style":493},[1423],{"type":398,"value":1389},{"type":393,"tag":427,"props":1425,"children":1426},{"style":439},[1427],{"type":398,"value":554},{"type":393,"tag":427,"props":1429,"children":1430},{"class":429,"line":72},[1431,1436,1440,1445,1449,1454,1458,1462,1466,1470,1474,1478,1482,1487],{"type":393,"tag":427,"props":1432,"children":1433},{"style":493},[1434],{"type":398,"value":1435},"    'quantity'",{"type":393,"tag":427,"props":1437,"children":1438},{"style":439},[1439],{"type":398,"value":501},{"type":393,"tag":427,"props":1441,"children":1442},{"style":635},[1443],{"type":398,"value":1444},"1",{"type":393,"tag":427,"props":1446,"children":1447},{"style":439},[1448],{"type":398,"value":511},{"type":393,"tag":427,"props":1450,"children":1451},{"style":635},[1452],{"type":398,"value":1453},"2",{"type":393,"tag":427,"props":1455,"children":1456},{"style":439},[1457],{"type":398,"value":511},{"type":393,"tag":427,"props":1459,"children":1460},{"style":635},[1461],{"type":398,"value":1444},{"type":393,"tag":427,"props":1463,"children":1464},{"style":439},[1465],{"type":398,"value":511},{"type":393,"tag":427,"props":1467,"children":1468},{"style":635},[1469],{"type":398,"value":1444},{"type":393,"tag":427,"props":1471,"children":1472},{"style":439},[1473],{"type":398,"value":511},{"type":393,"tag":427,"props":1475,"children":1476},{"style":635},[1477],{"type":398,"value":1444},{"type":393,"tag":427,"props":1479,"children":1480},{"style":439},[1481],{"type":398,"value":511},{"type":393,"tag":427,"props":1483,"children":1484},{"style":635},[1485],{"type":398,"value":1486},"3",{"type":393,"tag":427,"props":1488,"children":1489},{"style":439},[1490],{"type":398,"value":554},{"type":393,"tag":427,"props":1492,"children":1493},{"class":429,"line":83},[1494,1499,1503,1508,1512,1517,1521,1526,1530,1534,1538,1543,1547,1551],{"type":393,"tag":427,"props":1495,"children":1496},{"style":493},[1497],{"type":398,"value":1498},"    'price'",{"type":393,"tag":427,"props":1500,"children":1501},{"style":439},[1502],{"type":398,"value":501},{"type":393,"tag":427,"props":1504,"children":1505},{"style":635},[1506],{"type":398,"value":1507},"999",{"type":393,"tag":427,"props":1509,"children":1510},{"style":439},[1511],{"type":398,"value":511},{"type":393,"tag":427,"props":1513,"children":1514},{"style":635},[1515],{"type":398,"value":1516},"25",{"type":393,"tag":427,"props":1518,"children":1519},{"style":439},[1520],{"type":398,"value":511},{"type":393,"tag":427,"props":1522,"children":1523},{"style":635},[1524],{"type":398,"value":1525},"75",{"type":393,"tag":427,"props":1527,"children":1528},{"style":439},[1529],{"type":398,"value":511},{"type":393,"tag":427,"props":1531,"children":1532},{"style":635},[1533],{"type":398,"value":1507},{"type":393,"tag":427,"props":1535,"children":1536},{"style":439},[1537],{"type":398,"value":511},{"type":393,"tag":427,"props":1539,"children":1540},{"style":635},[1541],{"type":398,"value":1542},"300",{"type":393,"tag":427,"props":1544,"children":1545},{"style":439},[1546],{"type":398,"value":511},{"type":393,"tag":427,"props":1548,"children":1549},{"style":635},[1550],{"type":398,"value":1516},{"type":393,"tag":427,"props":1552,"children":1553},{"style":439},[1554],{"type":398,"value":688},{"type":393,"tag":427,"props":1556,"children":1557},{"class":429,"line":92},[1558],{"type":393,"tag":427,"props":1559,"children":1560},{"style":439},[1561],{"type":398,"value":696},{"type":393,"tag":427,"props":1563,"children":1564},{"class":429,"line":101},[1565],{"type":393,"tag":427,"props":1566,"children":1567},{"emptyLinePlaceholder":12},[1568],{"type":398,"value":460},{"type":393,"tag":427,"props":1570,"children":1571},{"class":429,"line":110},[1572,1576,1580,1585],{"type":393,"tag":427,"props":1573,"children":1574},{"style":635},[1575],{"type":398,"value":711},{"type":393,"tag":427,"props":1577,"children":1578},{"style":439},[1579],{"type":398,"value":716},{"type":393,"tag":427,"props":1581,"children":1582},{"style":493},[1583],{"type":398,"value":1584},"\"Customer orders:\"",{"type":393,"tag":427,"props":1586,"children":1587},{"style":439},[1588],{"type":398,"value":726},{"type":393,"tag":427,"props":1590,"children":1591},{"class":429,"line":121},[1592,1596],{"type":393,"tag":427,"props":1593,"children":1594},{"style":635},[1595],{"type":398,"value":711},{"type":393,"tag":427,"props":1597,"children":1598},{"style":439},[1599],{"type":398,"value":1600},"(orders)\n",{"type":393,"tag":427,"props":1602,"children":1603},{"class":429,"line":130},[1604,1608],{"type":393,"tag":427,"props":1605,"children":1606},{"style":635},[1607],{"type":398,"value":711},{"type":393,"tag":427,"props":1609,"children":1610},{"style":439},[1611],{"type":398,"value":750},{"type":393,"tag":427,"props":1613,"children":1614},{"class":429,"line":139},[1615],{"type":393,"tag":427,"props":1616,"children":1617},{"emptyLinePlaceholder":12},[1618],{"type":398,"value":460},{"type":393,"tag":427,"props":1620,"children":1621},{"class":429,"line":148},[1622],{"type":393,"tag":427,"props":1623,"children":1624},{"style":466},[1625],{"type":398,"value":1626},"# Pattern 1: Count by group\n",{"type":393,"tag":427,"props":1628,"children":1629},{"class":429,"line":159},[1630,1635,1639,1644,1649],{"type":393,"tag":427,"props":1631,"children":1632},{"style":439},[1633],{"type":398,"value":1634},"customer_orders ",{"type":393,"tag":427,"props":1636,"children":1637},{"style":433},[1638],{"type":398,"value":482},{"type":393,"tag":427,"props":1640,"children":1641},{"style":439},[1642],{"type":398,"value":1643}," orders.groupby(",{"type":393,"tag":427,"props":1645,"children":1646},{"style":493},[1647],{"type":398,"value":1648},"'customer'",{"type":393,"tag":427,"props":1650,"children":1651},{"style":439},[1652],{"type":398,"value":1653},").size()\n",{"type":393,"tag":427,"props":1655,"children":1656},{"class":429,"line":168},[1657,1661,1665,1670],{"type":393,"tag":427,"props":1658,"children":1659},{"style":635},[1660],{"type":398,"value":711},{"type":393,"tag":427,"props":1662,"children":1663},{"style":439},[1664],{"type":398,"value":716},{"type":393,"tag":427,"props":1666,"children":1667},{"style":493},[1668],{"type":398,"value":1669},"\"Orders per customer:\"",{"type":393,"tag":427,"props":1671,"children":1672},{"style":439},[1673],{"type":398,"value":726},{"type":393,"tag":427,"props":1675,"children":1676},{"class":429,"line":177},[1677,1681],{"type":393,"tag":427,"props":1678,"children":1679},{"style":635},[1680],{"type":398,"value":711},{"type":393,"tag":427,"props":1682,"children":1683},{"style":439},[1684],{"type":398,"value":1685},"(customer_orders)\n",{"type":393,"tag":427,"props":1687,"children":1688},{"class":429,"line":186},[1689,1693],{"type":393,"tag":427,"props":1690,"children":1691},{"style":635},[1692],{"type":398,"value":711},{"type":393,"tag":427,"props":1694,"children":1695},{"style":439},[1696],{"type":398,"value":750},{"type":393,"tag":427,"props":1698,"children":1699},{"class":429,"line":197},[1700],{"type":393,"tag":427,"props":1701,"children":1702},{"emptyLinePlaceholder":12},[1703],{"type":398,"value":460},{"type":393,"tag":427,"props":1705,"children":1706},{"class":429,"line":206},[1707],{"type":393,"tag":427,"props":1708,"children":1709},{"style":466},[1710],{"type":398,"value":1711},"# Pattern 2: Sum by group\n",{"type":393,"tag":427,"props":1713,"children":1714},{"class":429,"line":215},[1715,1720,1724,1728,1732,1736,1741],{"type":393,"tag":427,"props":1716,"children":1717},{"style":439},[1718],{"type":398,"value":1719},"customer_total ",{"type":393,"tag":427,"props":1721,"children":1722},{"style":433},[1723],{"type":398,"value":482},{"type":393,"tag":427,"props":1725,"children":1726},{"style":439},[1727],{"type":398,"value":1643},{"type":393,"tag":427,"props":1729,"children":1730},{"style":493},[1731],{"type":398,"value":1648},{"type":393,"tag":427,"props":1733,"children":1734},{"style":439},[1735],{"type":398,"value":792},{"type":393,"tag":427,"props":1737,"children":1738},{"style":493},[1739],{"type":398,"value":1740},"'price'",{"type":393,"tag":427,"props":1742,"children":1743},{"style":439},[1744],{"type":398,"value":802},{"type":393,"tag":427,"props":1746,"children":1747},{"class":429,"line":224},[1748,1752,1756,1761],{"type":393,"tag":427,"props":1749,"children":1750},{"style":635},[1751],{"type":398,"value":711},{"type":393,"tag":427,"props":1753,"children":1754},{"style":439},[1755],{"type":398,"value":716},{"type":393,"tag":427,"props":1757,"children":1758},{"style":493},[1759],{"type":398,"value":1760},"\"Total spent per customer:\"",{"type":393,"tag":427,"props":1762,"children":1763},{"style":439},[1764],{"type":398,"value":726},{"type":393,"tag":427,"props":1766,"children":1767},{"class":429,"line":233},[1768,1772],{"type":393,"tag":427,"props":1769,"children":1770},{"style":635},[1771],{"type":398,"value":711},{"type":393,"tag":427,"props":1773,"children":1774},{"style":439},[1775],{"type":398,"value":1776},"(customer_total)\n",{"type":393,"tag":427,"props":1778,"children":1779},{"class":429,"line":244},[1780,1784],{"type":393,"tag":427,"props":1781,"children":1782},{"style":635},[1783],{"type":398,"value":711},{"type":393,"tag":427,"props":1785,"children":1786},{"style":439},[1787],{"type":398,"value":750},{"type":393,"tag":427,"props":1789,"children":1790},{"class":429,"line":253},[1791],{"type":393,"tag":427,"props":1792,"children":1793},{"emptyLinePlaceholder":12},[1794],{"type":398,"value":460},{"type":393,"tag":427,"props":1796,"children":1797},{"class":429,"line":262},[1798],{"type":393,"tag":427,"props":1799,"children":1800},{"style":466},[1801],{"type":398,"value":1802},"# Pattern 3: Multiple aggregations\n",{"type":393,"tag":427,"props":1804,"children":1805},{"class":429,"line":271},[1806,1811,1815,1819,1823],{"type":393,"tag":427,"props":1807,"children":1808},{"style":439},[1809],{"type":398,"value":1810},"customer_summary ",{"type":393,"tag":427,"props":1812,"children":1813},{"style":433},[1814],{"type":398,"value":482},{"type":393,"tag":427,"props":1816,"children":1817},{"style":439},[1818],{"type":398,"value":1643},{"type":393,"tag":427,"props":1820,"children":1821},{"style":493},[1822],{"type":398,"value":1648},{"type":393,"tag":427,"props":1824,"children":1825},{"style":439},[1826],{"type":398,"value":1827},").agg({\n",{"type":393,"tag":427,"props":1829,"children":1830},{"class":429,"line":281},[1831,1835,1840,1844],{"type":393,"tag":427,"props":1832,"children":1833},{"style":493},[1834],{"type":398,"value":1435},{"type":393,"tag":427,"props":1836,"children":1837},{"style":439},[1838],{"type":398,"value":1839},": ",{"type":393,"tag":427,"props":1841,"children":1842},{"style":493},[1843],{"type":398,"value":898},{"type":393,"tag":427,"props":1845,"children":1846},{"style":439},[1847],{"type":398,"value":1848},",\n",{"type":393,"tag":427,"props":1850,"children":1851},{"class":429,"line":290},[1852,1856,1860,1864,1868,1872],{"type":393,"tag":427,"props":1853,"children":1854},{"style":493},[1855],{"type":398,"value":1498},{"type":393,"tag":427,"props":1857,"children":1858},{"style":439},[1859],{"type":398,"value":501},{"type":393,"tag":427,"props":1861,"children":1862},{"style":493},[1863],{"type":398,"value":898},{"type":393,"tag":427,"props":1865,"children":1866},{"style":439},[1867],{"type":398,"value":511},{"type":393,"tag":427,"props":1869,"children":1870},{"style":493},[1871],{"type":398,"value":907},{"type":393,"tag":427,"props":1873,"children":1874},{"style":439},[1875],{"type":398,"value":688},{"type":393,"tag":427,"props":1877,"children":1878},{"class":429,"line":299},[1879],{"type":393,"tag":427,"props":1880,"children":1881},{"style":439},[1882],{"type":398,"value":696},{"type":393,"tag":427,"props":1884,"children":1885},{"class":429,"line":308},[1886,1890,1894,1899],{"type":393,"tag":427,"props":1887,"children":1888},{"style":635},[1889],{"type":398,"value":711},{"type":393,"tag":427,"props":1891,"children":1892},{"style":439},[1893],{"type":398,"value":716},{"type":393,"tag":427,"props":1895,"children":1896},{"style":493},[1897],{"type":398,"value":1898},"\"Customer summary:\"",{"type":393,"tag":427,"props":1900,"children":1901},{"style":439},[1902],{"type":398,"value":726},{"type":393,"tag":427,"props":1904,"children":1905},{"class":429,"line":318},[1906,1910],{"type":393,"tag":427,"props":1907,"children":1908},{"style":635},[1909],{"type":398,"value":711},{"type":393,"tag":427,"props":1911,"children":1912},{"style":439},[1913],{"type":398,"value":1914},"(customer_summary)\n",{"type":393,"tag":955,"props":1916,"children":1918},{"id":1917},"aggregation-functions-overview",[1919],{"type":398,"value":1920},"📊 Aggregation Functions Overview",{"type":393,"tag":967,"props":1922,"children":1925},{"emoji":1923,"title":1924,"type":971},"🧮","Common Aggregation Functions",[1926,1934,1999,2007,2061,2069],{"type":393,"tag":401,"props":1927,"children":1928},{},[1929],{"type":393,"tag":977,"props":1930,"children":1931},{},[1932],{"type":398,"value":1933},"Statistical Functions:",{"type":393,"tag":983,"props":1935,"children":1936},{},[1937,1948,1959,1970,1988],{"type":393,"tag":987,"props":1938,"children":1939},{},[1940,1946],{"type":393,"tag":423,"props":1941,"children":1943},{"className":1942},[],[1944],{"type":398,"value":1945},"sum()",{"type":398,"value":1947}," - Total of all values",{"type":393,"tag":987,"props":1949,"children":1950},{},[1951,1957],{"type":393,"tag":423,"props":1952,"children":1954},{"className":1953},[],[1955],{"type":398,"value":1956},"mean()",{"type":398,"value":1958}," - Average value",{"type":393,"tag":987,"props":1960,"children":1961},{},[1962,1968],{"type":393,"tag":423,"props":1963,"children":1965},{"className":1964},[],[1966],{"type":398,"value":1967},"count()",{"type":398,"value":1969}," - Number of non-null values",{"type":393,"tag":987,"props":1971,"children":1972},{},[1973,1979,1980,1986],{"type":393,"tag":423,"props":1974,"children":1976},{"className":1975},[],[1977],{"type":398,"value":1978},"min()",{"type":398,"value":511},{"type":393,"tag":423,"props":1981,"children":1983},{"className":1982},[],[1984],{"type":398,"value":1985},"max()",{"type":398,"value":1987}," - Smallest and largest values",{"type":393,"tag":987,"props":1989,"children":1990},{},[1991,1997],{"type":393,"tag":423,"props":1992,"children":1994},{"className":1993},[],[1995],{"type":398,"value":1996},"std()",{"type":398,"value":1998}," - Standard deviation",{"type":393,"tag":401,"props":2000,"children":2001},{},[2002],{"type":393,"tag":977,"props":2003,"children":2004},{},[2005],{"type":398,"value":2006},"Practical Functions:",{"type":393,"tag":983,"props":2008,"children":2009},{},[2010,2021,2032,2050],{"type":393,"tag":987,"props":2011,"children":2012},{},[2013,2019],{"type":393,"tag":423,"props":2014,"children":2016},{"className":2015},[],[2017],{"type":398,"value":2018},"size()",{"type":398,"value":2020}," - Total number of rows (including nulls)",{"type":393,"tag":987,"props":2022,"children":2023},{},[2024,2030],{"type":393,"tag":423,"props":2025,"children":2027},{"className":2026},[],[2028],{"type":398,"value":2029},"nunique()",{"type":398,"value":2031}," - Number of unique values",{"type":393,"tag":987,"props":2033,"children":2034},{},[2035,2041,2042,2048],{"type":393,"tag":423,"props":2036,"children":2038},{"className":2037},[],[2039],{"type":398,"value":2040},"first()",{"type":398,"value":511},{"type":393,"tag":423,"props":2043,"children":2045},{"className":2044},[],[2046],{"type":398,"value":2047},"last()",{"type":398,"value":2049}," - First or last value in group",{"type":393,"tag":987,"props":2051,"children":2052},{},[2053,2059],{"type":393,"tag":423,"props":2054,"children":2056},{"className":2055},[],[2057],{"type":398,"value":2058},"median()",{"type":398,"value":2060}," - Middle value",{"type":393,"tag":401,"props":2062,"children":2063},{},[2064],{"type":393,"tag":977,"props":2065,"children":2066},{},[2067],{"type":398,"value":2068},"Text Functions:",{"type":393,"tag":983,"props":2070,"children":2071},{},[2072,2083],{"type":393,"tag":987,"props":2073,"children":2074},{},[2075,2081],{"type":393,"tag":423,"props":2076,"children":2078},{"className":2077},[],[2079],{"type":398,"value":2080},"', '.join()",{"type":398,"value":2082}," - Combine text values",{"type":393,"tag":987,"props":2084,"children":2085},{},[2086],{"type":398,"value":2087},"Most common value patterns",{"type":393,"tag":955,"props":2089,"children":2091},{"id":2090},"grouping-preview",[2092],{"type":398,"value":2093},"🚀 Grouping Preview",{"type":393,"tag":401,"props":2095,"children":2096},{},[2097],{"type":398,"value":2098},"Get a taste of what's coming:",{"type":393,"tag":412,"props":2100,"children":2101},{},[2102],{"type":393,"tag":416,"props":2103,"children":2105},{"className":418,"code":2104,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Survey responses by age group\nsurvey = pd.DataFrame({\n    'age_group': ['18-25', '26-35', '18-25', '36-45', '26-35', '18-25'],\n    'satisfaction': [4, 5, 3, 4, 5, 4],\n    'recommend': ['Yes', 'Yes', 'No', 'Yes', 'Yes', 'Yes'],\n    'city': ['NYC', 'LA', 'NYC', 'Chicago', 'LA', 'Boston']\n})\n\nprint(\"Survey responses:\")\nprint(survey)\nprint()\n\n# Multiple grouping insights\nprint(\"Average satisfaction by age group:\")\nage_satisfaction = survey.groupby('age_group')['satisfaction'].mean()\nprint(age_satisfaction)\nprint()\n\nprint(\"Recommendation rate by city:\")\ncity_recommend = survey.groupby('city')['recommend'].apply(lambda x: (x == 'Yes').mean())\nprint(city_recommend.round(2))\n",[2106],{"type":393,"tag":423,"props":2107,"children":2108},{"__ignoreMap":6},[2109,2128,2135,2143,2159,2222,2284,2346,2410,2417,2424,2444,2456,2467,2474,2482,2502,2538,2550,2561,2568,2588,2648],{"type":393,"tag":427,"props":2110,"children":2111},{"class":429,"line":11},[2112,2116,2120,2124],{"type":393,"tag":427,"props":2113,"children":2114},{"style":433},[2115],{"type":398,"value":436},{"type":393,"tag":427,"props":2117,"children":2118},{"style":439},[2119],{"type":398,"value":442},{"type":393,"tag":427,"props":2121,"children":2122},{"style":433},[2123],{"type":398,"value":447},{"type":393,"tag":427,"props":2125,"children":2126},{"style":439},[2127],{"type":398,"value":452},{"type":393,"tag":427,"props":2129,"children":2130},{"class":429,"line":27},[2131],{"type":393,"tag":427,"props":2132,"children":2133},{"emptyLinePlaceholder":12},[2134],{"type":398,"value":460},{"type":393,"tag":427,"props":2136,"children":2137},{"class":429,"line":36},[2138],{"type":393,"tag":427,"props":2139,"children":2140},{"style":466},[2141],{"type":398,"value":2142},"# Survey responses by age group\n",{"type":393,"tag":427,"props":2144,"children":2145},{"class":429,"line":45},[2146,2151,2155],{"type":393,"tag":427,"props":2147,"children":2148},{"style":439},[2149],{"type":398,"value":2150},"survey ",{"type":393,"tag":427,"props":2152,"children":2153},{"style":433},[2154],{"type":398,"value":482},{"type":393,"tag":427,"props":2156,"children":2157},{"style":439},[2158],{"type":398,"value":487},{"type":393,"tag":427,"props":2160,"children":2161},{"class":429,"line":54},[2162,2167,2171,2176,2180,2185,2189,2193,2197,2202,2206,2210,2214,2218],{"type":393,"tag":427,"props":2163,"children":2164},{"style":493},[2165],{"type":398,"value":2166},"    'age_group'",{"type":393,"tag":427,"props":2168,"children":2169},{"style":439},[2170],{"type":398,"value":501},{"type":393,"tag":427,"props":2172,"children":2173},{"style":493},[2174],{"type":398,"value":2175},"'18-25'",{"type":393,"tag":427,"props":2177,"children":2178},{"style":439},[2179],{"type":398,"value":511},{"type":393,"tag":427,"props":2181,"children":2182},{"style":493},[2183],{"type":398,"value":2184},"'26-35'",{"type":393,"tag":427,"props":2186,"children":2187},{"style":439},[2188],{"type":398,"value":511},{"type":393,"tag":427,"props":2190,"children":2191},{"style":493},[2192],{"type":398,"value":2175},{"type":393,"tag":427,"props":2194,"children":2195},{"style":439},[2196],{"type":398,"value":511},{"type":393,"tag":427,"props":2198,"children":2199},{"style":493},[2200],{"type":398,"value":2201},"'36-45'",{"type":393,"tag":427,"props":2203,"children":2204},{"style":439},[2205],{"type":398,"value":511},{"type":393,"tag":427,"props":2207,"children":2208},{"style":493},[2209],{"type":398,"value":2184},{"type":393,"tag":427,"props":2211,"children":2212},{"style":439},[2213],{"type":398,"value":511},{"type":393,"tag":427,"props":2215,"children":2216},{"style":493},[2217],{"type":398,"value":2175},{"type":393,"tag":427,"props":2219,"children":2220},{"style":439},[2221],{"type":398,"value":554},{"type":393,"tag":427,"props":2223,"children":2224},{"class":429,"line":63},[2225,2230,2234,2239,2243,2248,2252,2256,2260,2264,2268,2272,2276,2280],{"type":393,"tag":427,"props":2226,"children":2227},{"style":493},[2228],{"type":398,"value":2229},"    'satisfaction'",{"type":393,"tag":427,"props":2231,"children":2232},{"style":439},[2233],{"type":398,"value":501},{"type":393,"tag":427,"props":2235,"children":2236},{"style":635},[2237],{"type":398,"value":2238},"4",{"type":393,"tag":427,"props":2240,"children":2241},{"style":439},[2242],{"type":398,"value":511},{"type":393,"tag":427,"props":2244,"children":2245},{"style":635},[2246],{"type":398,"value":2247},"5",{"type":393,"tag":427,"props":2249,"children":2250},{"style":439},[2251],{"type":398,"value":511},{"type":393,"tag":427,"props":2253,"children":2254},{"style":635},[2255],{"type":398,"value":1486},{"type":393,"tag":427,"props":2257,"children":2258},{"style":439},[2259],{"type":398,"value":511},{"type":393,"tag":427,"props":2261,"children":2262},{"style":635},[2263],{"type":398,"value":2238},{"type":393,"tag":427,"props":2265,"children":2266},{"style":439},[2267],{"type":398,"value":511},{"type":393,"tag":427,"props":2269,"children":2270},{"style":635},[2271],{"type":398,"value":2247},{"type":393,"tag":427,"props":2273,"children":2274},{"style":439},[2275],{"type":398,"value":511},{"type":393,"tag":427,"props":2277,"children":2278},{"style":635},[2279],{"type":398,"value":2238},{"type":393,"tag":427,"props":2281,"children":2282},{"style":439},[2283],{"type":398,"value":554},{"type":393,"tag":427,"props":2285,"children":2286},{"class":429,"line":72},[2287,2292,2296,2301,2305,2309,2313,2318,2322,2326,2330,2334,2338,2342],{"type":393,"tag":427,"props":2288,"children":2289},{"style":493},[2290],{"type":398,"value":2291},"    'recommend'",{"type":393,"tag":427,"props":2293,"children":2294},{"style":439},[2295],{"type":398,"value":501},{"type":393,"tag":427,"props":2297,"children":2298},{"style":493},[2299],{"type":398,"value":2300},"'Yes'",{"type":393,"tag":427,"props":2302,"children":2303},{"style":439},[2304],{"type":398,"value":511},{"type":393,"tag":427,"props":2306,"children":2307},{"style":493},[2308],{"type":398,"value":2300},{"type":393,"tag":427,"props":2310,"children":2311},{"style":439},[2312],{"type":398,"value":511},{"type":393,"tag":427,"props":2314,"children":2315},{"style":493},[2316],{"type":398,"value":2317},"'No'",{"type":393,"tag":427,"props":2319,"children":2320},{"style":439},[2321],{"type":398,"value":511},{"type":393,"tag":427,"props":2323,"children":2324},{"style":493},[2325],{"type":398,"value":2300},{"type":393,"tag":427,"props":2327,"children":2328},{"style":439},[2329],{"type":398,"value":511},{"type":393,"tag":427,"props":2331,"children":2332},{"style":493},[2333],{"type":398,"value":2300},{"type":393,"tag":427,"props":2335,"children":2336},{"style":439},[2337],{"type":398,"value":511},{"type":393,"tag":427,"props":2339,"children":2340},{"style":493},[2341],{"type":398,"value":2300},{"type":393,"tag":427,"props":2343,"children":2344},{"style":439},[2345],{"type":398,"value":554},{"type":393,"tag":427,"props":2347,"children":2348},{"class":429,"line":83},[2349,2354,2358,2363,2367,2372,2376,2380,2384,2389,2393,2397,2401,2406],{"type":393,"tag":427,"props":2350,"children":2351},{"style":493},[2352],{"type":398,"value":2353},"    'city'",{"type":393,"tag":427,"props":2355,"children":2356},{"style":439},[2357],{"type":398,"value":501},{"type":393,"tag":427,"props":2359,"children":2360},{"style":493},[2361],{"type":398,"value":2362},"'NYC'",{"type":393,"tag":427,"props":2364,"children":2365},{"style":439},[2366],{"type":398,"value":511},{"type":393,"tag":427,"props":2368,"children":2369},{"style":493},[2370],{"type":398,"value":2371},"'LA'",{"type":393,"tag":427,"props":2373,"children":2374},{"style":439},[2375],{"type":398,"value":511},{"type":393,"tag":427,"props":2377,"children":2378},{"style":493},[2379],{"type":398,"value":2362},{"type":393,"tag":427,"props":2381,"children":2382},{"style":439},[2383],{"type":398,"value":511},{"type":393,"tag":427,"props":2385,"children":2386},{"style":493},[2387],{"type":398,"value":2388},"'Chicago'",{"type":393,"tag":427,"props":2390,"children":2391},{"style":439},[2392],{"type":398,"value":511},{"type":393,"tag":427,"props":2394,"children":2395},{"style":493},[2396],{"type":398,"value":2371},{"type":393,"tag":427,"props":2398,"children":2399},{"style":439},[2400],{"type":398,"value":511},{"type":393,"tag":427,"props":2402,"children":2403},{"style":493},[2404],{"type":398,"value":2405},"'Boston'",{"type":393,"tag":427,"props":2407,"children":2408},{"style":439},[2409],{"type":398,"value":688},{"type":393,"tag":427,"props":2411,"children":2412},{"class":429,"line":92},[2413],{"type":393,"tag":427,"props":2414,"children":2415},{"style":439},[2416],{"type":398,"value":696},{"type":393,"tag":427,"props":2418,"children":2419},{"class":429,"line":101},[2420],{"type":393,"tag":427,"props":2421,"children":2422},{"emptyLinePlaceholder":12},[2423],{"type":398,"value":460},{"type":393,"tag":427,"props":2425,"children":2426},{"class":429,"line":110},[2427,2431,2435,2440],{"type":393,"tag":427,"props":2428,"children":2429},{"style":635},[2430],{"type":398,"value":711},{"type":393,"tag":427,"props":2432,"children":2433},{"style":439},[2434],{"type":398,"value":716},{"type":393,"tag":427,"props":2436,"children":2437},{"style":493},[2438],{"type":398,"value":2439},"\"Survey responses:\"",{"type":393,"tag":427,"props":2441,"children":2442},{"style":439},[2443],{"type":398,"value":726},{"type":393,"tag":427,"props":2445,"children":2446},{"class":429,"line":121},[2447,2451],{"type":393,"tag":427,"props":2448,"children":2449},{"style":635},[2450],{"type":398,"value":711},{"type":393,"tag":427,"props":2452,"children":2453},{"style":439},[2454],{"type":398,"value":2455},"(survey)\n",{"type":393,"tag":427,"props":2457,"children":2458},{"class":429,"line":130},[2459,2463],{"type":393,"tag":427,"props":2460,"children":2461},{"style":635},[2462],{"type":398,"value":711},{"type":393,"tag":427,"props":2464,"children":2465},{"style":439},[2466],{"type":398,"value":750},{"type":393,"tag":427,"props":2468,"children":2469},{"class":429,"line":139},[2470],{"type":393,"tag":427,"props":2471,"children":2472},{"emptyLinePlaceholder":12},[2473],{"type":398,"value":460},{"type":393,"tag":427,"props":2475,"children":2476},{"class":429,"line":148},[2477],{"type":393,"tag":427,"props":2478,"children":2479},{"style":466},[2480],{"type":398,"value":2481},"# Multiple grouping insights\n",{"type":393,"tag":427,"props":2483,"children":2484},{"class":429,"line":159},[2485,2489,2493,2498],{"type":393,"tag":427,"props":2486,"children":2487},{"style":635},[2488],{"type":398,"value":711},{"type":393,"tag":427,"props":2490,"children":2491},{"style":439},[2492],{"type":398,"value":716},{"type":393,"tag":427,"props":2494,"children":2495},{"style":493},[2496],{"type":398,"value":2497},"\"Average satisfaction by age group:\"",{"type":393,"tag":427,"props":2499,"children":2500},{"style":439},[2501],{"type":398,"value":726},{"type":393,"tag":427,"props":2503,"children":2504},{"class":429,"line":168},[2505,2510,2514,2519,2524,2528,2533],{"type":393,"tag":427,"props":2506,"children":2507},{"style":439},[2508],{"type":398,"value":2509},"age_satisfaction ",{"type":393,"tag":427,"props":2511,"children":2512},{"style":433},[2513],{"type":398,"value":482},{"type":393,"tag":427,"props":2515,"children":2516},{"style":439},[2517],{"type":398,"value":2518}," survey.groupby(",{"type":393,"tag":427,"props":2520,"children":2521},{"style":493},[2522],{"type":398,"value":2523},"'age_group'",{"type":393,"tag":427,"props":2525,"children":2526},{"style":439},[2527],{"type":398,"value":792},{"type":393,"tag":427,"props":2529,"children":2530},{"style":493},[2531],{"type":398,"value":2532},"'satisfaction'",{"type":393,"tag":427,"props":2534,"children":2535},{"style":439},[2536],{"type":398,"value":2537},"].mean()\n",{"type":393,"tag":427,"props":2539,"children":2540},{"class":429,"line":177},[2541,2545],{"type":393,"tag":427,"props":2542,"children":2543},{"style":635},[2544],{"type":398,"value":711},{"type":393,"tag":427,"props":2546,"children":2547},{"style":439},[2548],{"type":398,"value":2549},"(age_satisfaction)\n",{"type":393,"tag":427,"props":2551,"children":2552},{"class":429,"line":186},[2553,2557],{"type":393,"tag":427,"props":2554,"children":2555},{"style":635},[2556],{"type":398,"value":711},{"type":393,"tag":427,"props":2558,"children":2559},{"style":439},[2560],{"type":398,"value":750},{"type":393,"tag":427,"props":2562,"children":2563},{"class":429,"line":197},[2564],{"type":393,"tag":427,"props":2565,"children":2566},{"emptyLinePlaceholder":12},[2567],{"type":398,"value":460},{"type":393,"tag":427,"props":2569,"children":2570},{"class":429,"line":206},[2571,2575,2579,2584],{"type":393,"tag":427,"props":2572,"children":2573},{"style":635},[2574],{"type":398,"value":711},{"type":393,"tag":427,"props":2576,"children":2577},{"style":439},[2578],{"type":398,"value":716},{"type":393,"tag":427,"props":2580,"children":2581},{"style":493},[2582],{"type":398,"value":2583},"\"Recommendation rate by city:\"",{"type":393,"tag":427,"props":2585,"children":2586},{"style":439},[2587],{"type":398,"value":726},{"type":393,"tag":427,"props":2589,"children":2590},{"class":429,"line":215},[2591,2596,2600,2604,2609,2613,2618,2623,2628,2633,2638,2643],{"type":393,"tag":427,"props":2592,"children":2593},{"style":439},[2594],{"type":398,"value":2595},"city_recommend ",{"type":393,"tag":427,"props":2597,"children":2598},{"style":433},[2599],{"type":398,"value":482},{"type":393,"tag":427,"props":2601,"children":2602},{"style":439},[2603],{"type":398,"value":2518},{"type":393,"tag":427,"props":2605,"children":2606},{"style":493},[2607],{"type":398,"value":2608},"'city'",{"type":393,"tag":427,"props":2610,"children":2611},{"style":439},[2612],{"type":398,"value":792},{"type":393,"tag":427,"props":2614,"children":2615},{"style":493},[2616],{"type":398,"value":2617},"'recommend'",{"type":393,"tag":427,"props":2619,"children":2620},{"style":439},[2621],{"type":398,"value":2622},"].apply(",{"type":393,"tag":427,"props":2624,"children":2625},{"style":433},[2626],{"type":398,"value":2627},"lambda",{"type":393,"tag":427,"props":2629,"children":2630},{"style":439},[2631],{"type":398,"value":2632}," x: (x ",{"type":393,"tag":427,"props":2634,"children":2635},{"style":433},[2636],{"type":398,"value":2637},"==",{"type":393,"tag":427,"props":2639,"children":2640},{"style":493},[2641],{"type":398,"value":2642}," 'Yes'",{"type":393,"tag":427,"props":2644,"children":2645},{"style":439},[2646],{"type":398,"value":2647},").mean())\n",{"type":393,"tag":427,"props":2649,"children":2650},{"class":429,"line":224},[2651,2655,2660,2664],{"type":393,"tag":427,"props":2652,"children":2653},{"style":635},[2654],{"type":398,"value":711},{"type":393,"tag":427,"props":2656,"children":2657},{"style":439},[2658],{"type":398,"value":2659},"(city_recommend.round(",{"type":393,"tag":427,"props":2661,"children":2662},{"style":635},[2663],{"type":398,"value":1453},{"type":393,"tag":427,"props":2665,"children":2666},{"style":439},[2667],{"type":398,"value":2668},"))\n",{"type":393,"tag":955,"props":2670,"children":2672},{"id":2671},"real-world-applications",[2673],{"type":398,"value":2674},"📈 Real-World Applications",{"type":393,"tag":967,"props":2676,"children":2679},{"emoji":2677,"title":2678,"type":1143},"💼","Business Applications",[2680,2688,2706,2714,2732,2740,2758,2766],{"type":393,"tag":401,"props":2681,"children":2682},{},[2683],{"type":393,"tag":977,"props":2684,"children":2685},{},[2686],{"type":398,"value":2687},"Sales Analysis:",{"type":393,"tag":983,"props":2689,"children":2690},{},[2691,2696,2701],{"type":393,"tag":987,"props":2692,"children":2693},{},[2694],{"type":398,"value":2695},"Revenue by product, region, salesperson",{"type":393,"tag":987,"props":2697,"children":2698},{},[2699],{"type":398,"value":2700},"Monthly/quarterly performance trends",{"type":393,"tag":987,"props":2702,"children":2703},{},[2704],{"type":398,"value":2705},"Customer lifetime value calculations",{"type":393,"tag":401,"props":2707,"children":2708},{},[2709],{"type":393,"tag":977,"props":2710,"children":2711},{},[2712],{"type":398,"value":2713},"Customer Analytics:",{"type":393,"tag":983,"props":2715,"children":2716},{},[2717,2722,2727],{"type":393,"tag":987,"props":2718,"children":2719},{},[2720],{"type":398,"value":2721},"Purchase patterns by demographics",{"type":393,"tag":987,"props":2723,"children":2724},{},[2725],{"type":398,"value":2726},"Churn analysis by customer segment",{"type":393,"tag":987,"props":2728,"children":2729},{},[2730],{"type":398,"value":2731},"Support ticket resolution by category",{"type":393,"tag":401,"props":2733,"children":2734},{},[2735],{"type":393,"tag":977,"props":2736,"children":2737},{},[2738],{"type":398,"value":2739},"Operations:",{"type":393,"tag":983,"props":2741,"children":2742},{},[2743,2748,2753],{"type":393,"tag":987,"props":2744,"children":2745},{},[2746],{"type":398,"value":2747},"Inventory levels by warehouse",{"type":393,"tag":987,"props":2749,"children":2750},{},[2751],{"type":398,"value":2752},"Employee performance by department",{"type":393,"tag":987,"props":2754,"children":2755},{},[2756],{"type":398,"value":2757},"Quality metrics by production line",{"type":393,"tag":401,"props":2759,"children":2760},{},[2761],{"type":393,"tag":977,"props":2762,"children":2763},{},[2764],{"type":398,"value":2765},"Marketing:",{"type":393,"tag":983,"props":2767,"children":2768},{},[2769,2774,2779],{"type":393,"tag":987,"props":2770,"children":2771},{},[2772],{"type":398,"value":2773},"Campaign effectiveness by channel",{"type":393,"tag":987,"props":2775,"children":2776},{},[2777],{"type":398,"value":2778},"Conversion rates by source",{"type":393,"tag":987,"props":2780,"children":2781},{},[2782],{"type":398,"value":2783},"Customer acquisition costs",{"type":393,"tag":955,"props":2785,"children":2787},{"id":2786},"grouping-best-practices",[2788],{"type":398,"value":2789},"🎯 Grouping Best Practices",{"type":393,"tag":967,"props":2791,"children":2795},{"emoji":2792,"title":2793,"type":2794},"📋","Best Practices","warning",[2796,2804,2822,2830,2867,2875,2893,2901],{"type":393,"tag":401,"props":2797,"children":2798},{},[2799],{"type":393,"tag":977,"props":2800,"children":2801},{},[2802],{"type":398,"value":2803},"Choose the Right Groups:",{"type":393,"tag":983,"props":2805,"children":2806},{},[2807,2812,2817],{"type":393,"tag":987,"props":2808,"children":2809},{},[2810],{"type":398,"value":2811},"Group by meaningful categories",{"type":393,"tag":987,"props":2813,"children":2814},{},[2815],{"type":398,"value":2816},"Ensure groups have enough data points",{"type":393,"tag":987,"props":2818,"children":2819},{},[2820],{"type":398,"value":2821},"Consider multiple grouping levels",{"type":393,"tag":401,"props":2823,"children":2824},{},[2825],{"type":393,"tag":977,"props":2826,"children":2827},{},[2828],{"type":398,"value":2829},"Select Appropriate Aggregations:",{"type":393,"tag":983,"props":2831,"children":2832},{},[2833,2845,2856],{"type":393,"tag":987,"props":2834,"children":2835},{},[2836,2838,2843],{"type":398,"value":2837},"Use ",{"type":393,"tag":423,"props":2839,"children":2841},{"className":2840},[],[2842],{"type":398,"value":1945},{"type":398,"value":2844}," for totals (revenue, quantity)",{"type":393,"tag":987,"props":2846,"children":2847},{},[2848,2849,2854],{"type":398,"value":2837},{"type":393,"tag":423,"props":2850,"children":2852},{"className":2851},[],[2853],{"type":398,"value":1956},{"type":398,"value":2855}," for averages (ratings, scores)",{"type":393,"tag":987,"props":2857,"children":2858},{},[2859,2860,2865],{"type":398,"value":2837},{"type":393,"tag":423,"props":2861,"children":2863},{"className":2862},[],[2864],{"type":398,"value":1967},{"type":398,"value":2866}," for frequencies (number of orders)",{"type":393,"tag":401,"props":2868,"children":2869},{},[2870],{"type":393,"tag":977,"props":2871,"children":2872},{},[2873],{"type":398,"value":2874},"Performance Tips:",{"type":393,"tag":983,"props":2876,"children":2877},{},[2878,2883,2888],{"type":393,"tag":987,"props":2879,"children":2880},{},[2881],{"type":398,"value":2882},"Group by columns with fewer unique values first",{"type":393,"tag":987,"props":2884,"children":2885},{},[2886],{"type":398,"value":2887},"Use built-in aggregation functions when possible",{"type":393,"tag":987,"props":2889,"children":2890},{},[2891],{"type":398,"value":2892},"Consider sampling large datasets before grouping",{"type":393,"tag":401,"props":2894,"children":2895},{},[2896],{"type":393,"tag":977,"props":2897,"children":2898},{},[2899],{"type":398,"value":2900},"Interpretation:",{"type":393,"tag":983,"props":2902,"children":2903},{},[2904,2909,2914],{"type":393,"tag":987,"props":2905,"children":2906},{},[2907],{"type":398,"value":2908},"Always check group sizes (some may be too small)",{"type":393,"tag":987,"props":2910,"children":2911},{},[2912],{"type":398,"value":2913},"Look for outliers in group results",{"type":393,"tag":987,"props":2915,"children":2916},{},[2917],{"type":398,"value":2918},"Validate results with business knowledge",{"type":393,"tag":955,"props":2920,"children":2922},{"id":2921},"whats-next",[2923],{"type":398,"value":2924},"🚀 What's Next?",{"type":393,"tag":401,"props":2926,"children":2927},{},[2928],{"type":398,"value":2929},"Ready to start grouping your data and discovering insights? Let's begin with the fundamentals of GroupBy operations.",{"type":393,"tag":401,"props":2931,"children":2932},{},[2933,2938,2939],{"type":393,"tag":977,"props":2934,"children":2935},{},[2936],{"type":398,"value":2937},"Start with",{"type":398,"value":1839},{"type":393,"tag":1100,"props":2940,"children":2941},{"href":277},[2942],{"type":398,"value":278},{"type":393,"tag":401,"props":2944,"children":2945},{},[2946],{"type":398,"value":2947},"Time to group and aggregate! 📊🔍",{"type":393,"tag":2949,"props":2950,"children":2951},"style",{},[2952],{"type":398,"value":2953},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}html.app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}",{"title":6,"searchDepth":36,"depth":36,"links":2955},[2956,2957,2958,2959,2960,2961,2962,2963,2964],{"id":957,"depth":27,"text":960},{"id":1082,"depth":27,"text":1085},{"id":1130,"depth":27,"text":1133},{"id":1235,"depth":27,"text":1238},{"id":1917,"depth":27,"text":1920},{"id":2090,"depth":27,"text":2093},{"id":2671,"depth":27,"text":2674},{"id":2786,"depth":27,"text":2789},{"id":2921,"depth":27,"text":2924},1782373725707]