[{"data":1,"prerenderedAt":6572},["ShallowReactive",2],{"tutorials-pandas":3,"category-items-pandas":387,"content-/pandas/merging-and-join-operations":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,"expanded":12},"/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,"expanded":12},"/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",[322],{"_path":323,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":324,"description":325,"slug":326,"parentId":304,"order":327,"body":389,"_type":14,"_id":328,"_source":16,"_file":329,"_stem":330,"_extension":19},{"type":390,"children":391,"toc":6557},"root",[392,400,406,411,977,984,989,1100,1106,1111,1248,1255,1825,1831,2279,2285,2730,2736,2741,3270,3276,3281,3984,3990,3995,4097,4670,4676,4681,5704,5710,5715,5806,6343,6349,6520,6526,6531,6546,6551],{"type":393,"tag":394,"props":395,"children":396},"element","h1",{"id":326},[397],{"type":398,"value":399},"text","🔗 Merging and Join Operations",{"type":393,"tag":401,"props":402,"children":403},"p",{},[404],{"type":398,"value":405},"Merging is like connecting the dots between related data! When you have DataFrames that share common information (like customer IDs or product codes), merging helps you combine them based on these relationships. This is essential for comprehensive data analysis.",{"type":393,"tag":401,"props":407,"children":408},{},[409],{"type":398,"value":410},"Think of merging like looking up information in different address books - you use a person's name to find their phone number in one book and their address in another.",{"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# Customer information\ncustomers = pd.DataFrame({\n    'customer_id': [1, 2, 3, 4],\n    'name': ['Alice', 'Bob', 'Charlie', 'Diana'],\n    'city': ['NYC', 'LA', 'Chicago', 'Boston']\n})\n\n# Order information\norders = pd.DataFrame({\n    'order_id': [101, 102, 103],\n    'customer_id': [1, 2, 1],\n    'amount': [250, 150, 300]\n})\n\nprint(\"Customers:\")\nprint(customers)\nprint()\nprint(\"Orders:\")\nprint(orders)\nprint()\n\n# Merge customer info with orders\ncustomer_orders = orders.merge(customers, on='customer_id')\nprint(\"Orders with customer details:\")\nprint(customer_orders)\n","python",[422],{"type":393,"tag":423,"props":424,"children":425},"code",{"__ignoreMap":6},[426,453,461,470,488,541,589,638,646,653,661,677,716,751,790,797,804,827,839,851,871,883,894,901,909,945,965],{"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},"# Customer information\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},"customers ",{"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,508,513,518,522,527,531,536],{"type":393,"tag":427,"props":492,"children":494},{"style":493},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[495],{"type":398,"value":496},"    'customer_id'",{"type":393,"tag":427,"props":498,"children":499},{"style":439},[500],{"type":398,"value":501},": [",{"type":393,"tag":427,"props":503,"children":505},{"style":504},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[506],{"type":398,"value":507},"1",{"type":393,"tag":427,"props":509,"children":510},{"style":439},[511],{"type":398,"value":512},", ",{"type":393,"tag":427,"props":514,"children":515},{"style":504},[516],{"type":398,"value":517},"2",{"type":393,"tag":427,"props":519,"children":520},{"style":439},[521],{"type":398,"value":512},{"type":393,"tag":427,"props":523,"children":524},{"style":504},[525],{"type":398,"value":526},"3",{"type":393,"tag":427,"props":528,"children":529},{"style":439},[530],{"type":398,"value":512},{"type":393,"tag":427,"props":532,"children":533},{"style":504},[534],{"type":398,"value":535},"4",{"type":393,"tag":427,"props":537,"children":538},{"style":439},[539],{"type":398,"value":540},"],\n",{"type":393,"tag":427,"props":542,"children":543},{"class":429,"line":63},[544,549,553,558,562,567,571,576,580,585],{"type":393,"tag":427,"props":545,"children":546},{"style":493},[547],{"type":398,"value":548},"    'name'",{"type":393,"tag":427,"props":550,"children":551},{"style":439},[552],{"type":398,"value":501},{"type":393,"tag":427,"props":554,"children":555},{"style":493},[556],{"type":398,"value":557},"'Alice'",{"type":393,"tag":427,"props":559,"children":560},{"style":439},[561],{"type":398,"value":512},{"type":393,"tag":427,"props":563,"children":564},{"style":493},[565],{"type":398,"value":566},"'Bob'",{"type":393,"tag":427,"props":568,"children":569},{"style":439},[570],{"type":398,"value":512},{"type":393,"tag":427,"props":572,"children":573},{"style":493},[574],{"type":398,"value":575},"'Charlie'",{"type":393,"tag":427,"props":577,"children":578},{"style":439},[579],{"type":398,"value":512},{"type":393,"tag":427,"props":581,"children":582},{"style":493},[583],{"type":398,"value":584},"'Diana'",{"type":393,"tag":427,"props":586,"children":587},{"style":439},[588],{"type":398,"value":540},{"type":393,"tag":427,"props":590,"children":591},{"class":429,"line":72},[592,597,601,606,610,615,619,624,628,633],{"type":393,"tag":427,"props":593,"children":594},{"style":493},[595],{"type":398,"value":596},"    'city'",{"type":393,"tag":427,"props":598,"children":599},{"style":439},[600],{"type":398,"value":501},{"type":393,"tag":427,"props":602,"children":603},{"style":493},[604],{"type":398,"value":605},"'NYC'",{"type":393,"tag":427,"props":607,"children":608},{"style":439},[609],{"type":398,"value":512},{"type":393,"tag":427,"props":611,"children":612},{"style":493},[613],{"type":398,"value":614},"'LA'",{"type":393,"tag":427,"props":616,"children":617},{"style":439},[618],{"type":398,"value":512},{"type":393,"tag":427,"props":620,"children":621},{"style":493},[622],{"type":398,"value":623},"'Chicago'",{"type":393,"tag":427,"props":625,"children":626},{"style":439},[627],{"type":398,"value":512},{"type":393,"tag":427,"props":629,"children":630},{"style":493},[631],{"type":398,"value":632},"'Boston'",{"type":393,"tag":427,"props":634,"children":635},{"style":439},[636],{"type":398,"value":637},"]\n",{"type":393,"tag":427,"props":639,"children":640},{"class":429,"line":83},[641],{"type":393,"tag":427,"props":642,"children":643},{"style":439},[644],{"type":398,"value":645},"})\n",{"type":393,"tag":427,"props":647,"children":648},{"class":429,"line":92},[649],{"type":393,"tag":427,"props":650,"children":651},{"emptyLinePlaceholder":12},[652],{"type":398,"value":460},{"type":393,"tag":427,"props":654,"children":655},{"class":429,"line":101},[656],{"type":393,"tag":427,"props":657,"children":658},{"style":466},[659],{"type":398,"value":660},"# Order information\n",{"type":393,"tag":427,"props":662,"children":663},{"class":429,"line":110},[664,669,673],{"type":393,"tag":427,"props":665,"children":666},{"style":439},[667],{"type":398,"value":668},"orders ",{"type":393,"tag":427,"props":670,"children":671},{"style":433},[672],{"type":398,"value":482},{"type":393,"tag":427,"props":674,"children":675},{"style":439},[676],{"type":398,"value":487},{"type":393,"tag":427,"props":678,"children":679},{"class":429,"line":121},[680,685,689,694,698,703,707,712],{"type":393,"tag":427,"props":681,"children":682},{"style":493},[683],{"type":398,"value":684},"    'order_id'",{"type":393,"tag":427,"props":686,"children":687},{"style":439},[688],{"type":398,"value":501},{"type":393,"tag":427,"props":690,"children":691},{"style":504},[692],{"type":398,"value":693},"101",{"type":393,"tag":427,"props":695,"children":696},{"style":439},[697],{"type":398,"value":512},{"type":393,"tag":427,"props":699,"children":700},{"style":504},[701],{"type":398,"value":702},"102",{"type":393,"tag":427,"props":704,"children":705},{"style":439},[706],{"type":398,"value":512},{"type":393,"tag":427,"props":708,"children":709},{"style":504},[710],{"type":398,"value":711},"103",{"type":393,"tag":427,"props":713,"children":714},{"style":439},[715],{"type":398,"value":540},{"type":393,"tag":427,"props":717,"children":718},{"class":429,"line":130},[719,723,727,731,735,739,743,747],{"type":393,"tag":427,"props":720,"children":721},{"style":493},[722],{"type":398,"value":496},{"type":393,"tag":427,"props":724,"children":725},{"style":439},[726],{"type":398,"value":501},{"type":393,"tag":427,"props":728,"children":729},{"style":504},[730],{"type":398,"value":507},{"type":393,"tag":427,"props":732,"children":733},{"style":439},[734],{"type":398,"value":512},{"type":393,"tag":427,"props":736,"children":737},{"style":504},[738],{"type":398,"value":517},{"type":393,"tag":427,"props":740,"children":741},{"style":439},[742],{"type":398,"value":512},{"type":393,"tag":427,"props":744,"children":745},{"style":504},[746],{"type":398,"value":507},{"type":393,"tag":427,"props":748,"children":749},{"style":439},[750],{"type":398,"value":540},{"type":393,"tag":427,"props":752,"children":753},{"class":429,"line":139},[754,759,763,768,772,777,781,786],{"type":393,"tag":427,"props":755,"children":756},{"style":493},[757],{"type":398,"value":758},"    'amount'",{"type":393,"tag":427,"props":760,"children":761},{"style":439},[762],{"type":398,"value":501},{"type":393,"tag":427,"props":764,"children":765},{"style":504},[766],{"type":398,"value":767},"250",{"type":393,"tag":427,"props":769,"children":770},{"style":439},[771],{"type":398,"value":512},{"type":393,"tag":427,"props":773,"children":774},{"style":504},[775],{"type":398,"value":776},"150",{"type":393,"tag":427,"props":778,"children":779},{"style":439},[780],{"type":398,"value":512},{"type":393,"tag":427,"props":782,"children":783},{"style":504},[784],{"type":398,"value":785},"300",{"type":393,"tag":427,"props":787,"children":788},{"style":439},[789],{"type":398,"value":637},{"type":393,"tag":427,"props":791,"children":792},{"class":429,"line":148},[793],{"type":393,"tag":427,"props":794,"children":795},{"style":439},[796],{"type":398,"value":645},{"type":393,"tag":427,"props":798,"children":799},{"class":429,"line":159},[800],{"type":393,"tag":427,"props":801,"children":802},{"emptyLinePlaceholder":12},[803],{"type":398,"value":460},{"type":393,"tag":427,"props":805,"children":806},{"class":429,"line":168},[807,812,817,822],{"type":393,"tag":427,"props":808,"children":809},{"style":504},[810],{"type":398,"value":811},"print",{"type":393,"tag":427,"props":813,"children":814},{"style":439},[815],{"type":398,"value":816},"(",{"type":393,"tag":427,"props":818,"children":819},{"style":493},[820],{"type":398,"value":821},"\"Customers:\"",{"type":393,"tag":427,"props":823,"children":824},{"style":439},[825],{"type":398,"value":826},")\n",{"type":393,"tag":427,"props":828,"children":829},{"class":429,"line":177},[830,834],{"type":393,"tag":427,"props":831,"children":832},{"style":504},[833],{"type":398,"value":811},{"type":393,"tag":427,"props":835,"children":836},{"style":439},[837],{"type":398,"value":838},"(customers)\n",{"type":393,"tag":427,"props":840,"children":841},{"class":429,"line":186},[842,846],{"type":393,"tag":427,"props":843,"children":844},{"style":504},[845],{"type":398,"value":811},{"type":393,"tag":427,"props":847,"children":848},{"style":439},[849],{"type":398,"value":850},"()\n",{"type":393,"tag":427,"props":852,"children":853},{"class":429,"line":197},[854,858,862,867],{"type":393,"tag":427,"props":855,"children":856},{"style":504},[857],{"type":398,"value":811},{"type":393,"tag":427,"props":859,"children":860},{"style":439},[861],{"type":398,"value":816},{"type":393,"tag":427,"props":863,"children":864},{"style":493},[865],{"type":398,"value":866},"\"Orders:\"",{"type":393,"tag":427,"props":868,"children":869},{"style":439},[870],{"type":398,"value":826},{"type":393,"tag":427,"props":872,"children":873},{"class":429,"line":206},[874,878],{"type":393,"tag":427,"props":875,"children":876},{"style":504},[877],{"type":398,"value":811},{"type":393,"tag":427,"props":879,"children":880},{"style":439},[881],{"type":398,"value":882},"(orders)\n",{"type":393,"tag":427,"props":884,"children":885},{"class":429,"line":215},[886,890],{"type":393,"tag":427,"props":887,"children":888},{"style":504},[889],{"type":398,"value":811},{"type":393,"tag":427,"props":891,"children":892},{"style":439},[893],{"type":398,"value":850},{"type":393,"tag":427,"props":895,"children":896},{"class":429,"line":224},[897],{"type":393,"tag":427,"props":898,"children":899},{"emptyLinePlaceholder":12},[900],{"type":398,"value":460},{"type":393,"tag":427,"props":902,"children":903},{"class":429,"line":233},[904],{"type":393,"tag":427,"props":905,"children":906},{"style":466},[907],{"type":398,"value":908},"# Merge customer info with orders\n",{"type":393,"tag":427,"props":910,"children":911},{"class":429,"line":244},[912,917,921,926,932,936,941],{"type":393,"tag":427,"props":913,"children":914},{"style":439},[915],{"type":398,"value":916},"customer_orders ",{"type":393,"tag":427,"props":918,"children":919},{"style":433},[920],{"type":398,"value":482},{"type":393,"tag":427,"props":922,"children":923},{"style":439},[924],{"type":398,"value":925}," orders.merge(customers, ",{"type":393,"tag":427,"props":927,"children":929},{"style":928},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[930],{"type":398,"value":931},"on",{"type":393,"tag":427,"props":933,"children":934},{"style":433},[935],{"type":398,"value":482},{"type":393,"tag":427,"props":937,"children":938},{"style":493},[939],{"type":398,"value":940},"'customer_id'",{"type":393,"tag":427,"props":942,"children":943},{"style":439},[944],{"type":398,"value":826},{"type":393,"tag":427,"props":946,"children":947},{"class":429,"line":253},[948,952,956,961],{"type":393,"tag":427,"props":949,"children":950},{"style":504},[951],{"type":398,"value":811},{"type":393,"tag":427,"props":953,"children":954},{"style":439},[955],{"type":398,"value":816},{"type":393,"tag":427,"props":957,"children":958},{"style":493},[959],{"type":398,"value":960},"\"Orders with customer details:\"",{"type":393,"tag":427,"props":962,"children":963},{"style":439},[964],{"type":398,"value":826},{"type":393,"tag":427,"props":966,"children":967},{"class":429,"line":262},[968,972],{"type":393,"tag":427,"props":969,"children":970},{"style":504},[971],{"type":398,"value":811},{"type":393,"tag":427,"props":973,"children":974},{"style":439},[975],{"type":398,"value":976},"(customer_orders)\n",{"type":393,"tag":978,"props":979,"children":981},"h2",{"id":980},"understanding-merge-operations",[982],{"type":398,"value":983},"🎯 Understanding Merge Operations",{"type":393,"tag":401,"props":985,"children":986},{},[987],{"type":398,"value":988},"Merging combines DataFrames based on common columns (keys):",{"type":393,"tag":990,"props":991,"children":995},"info-box",{"emoji":992,"title":993,"type":994},"🔑","Merge Basics","info",[996,1005,1040,1048,1069,1077],{"type":393,"tag":401,"props":997,"children":998},{},[999],{"type":393,"tag":1000,"props":1001,"children":1002},"strong",{},[1003],{"type":398,"value":1004},"Key Concepts:",{"type":393,"tag":1006,"props":1007,"children":1008},"ul",{},[1009,1020,1030],{"type":393,"tag":1010,"props":1011,"children":1012},"li",{},[1013,1018],{"type":393,"tag":1000,"props":1014,"children":1015},{},[1016],{"type":398,"value":1017},"Join Key",{"type":398,"value":1019},": The column(s) that link DataFrames together",{"type":393,"tag":1010,"props":1021,"children":1022},{},[1023,1028],{"type":393,"tag":1000,"props":1024,"children":1025},{},[1026],{"type":398,"value":1027},"Left DataFrame",{"type":398,"value":1029},": The first DataFrame in the merge",{"type":393,"tag":1010,"props":1031,"children":1032},{},[1033,1038],{"type":393,"tag":1000,"props":1034,"children":1035},{},[1036],{"type":398,"value":1037},"Right DataFrame",{"type":398,"value":1039},": The second DataFrame in the merge",{"type":393,"tag":401,"props":1041,"children":1042},{},[1043],{"type":393,"tag":1000,"props":1044,"children":1045},{},[1046],{"type":398,"value":1047},"Basic Syntax:",{"type":393,"tag":1006,"props":1049,"children":1050},{},[1051,1060],{"type":393,"tag":1010,"props":1052,"children":1053},{},[1054],{"type":393,"tag":423,"props":1055,"children":1057},{"className":1056},[],[1058],{"type":398,"value":1059},"left_df.merge(right_df, on='key_column')",{"type":393,"tag":1010,"props":1061,"children":1062},{},[1063],{"type":393,"tag":423,"props":1064,"children":1066},{"className":1065},[],[1067],{"type":398,"value":1068},"pd.merge(left_df, right_df, on='key_column')",{"type":393,"tag":401,"props":1070,"children":1071},{},[1072],{"type":393,"tag":1000,"props":1073,"children":1074},{},[1075],{"type":398,"value":1076},"When to Use:",{"type":393,"tag":1006,"props":1078,"children":1079},{},[1080,1085,1090,1095],{"type":393,"tag":1010,"props":1081,"children":1082},{},[1083],{"type":398,"value":1084},"DataFrames have related but different information",{"type":393,"tag":1010,"props":1086,"children":1087},{},[1088],{"type":398,"value":1089},"You need to lookup details from another table",{"type":393,"tag":1010,"props":1091,"children":1092},{},[1093],{"type":398,"value":1094},"Combining master data with transaction data",{"type":393,"tag":1010,"props":1096,"children":1097},{},[1098],{"type":398,"value":1099},"Database-style operations in pandas",{"type":393,"tag":978,"props":1101,"children":1103},{"id":1102},"types-of-joins",[1104],{"type":398,"value":1105},"🔄 Types of Joins",{"type":393,"tag":401,"props":1107,"children":1108},{},[1109],{"type":398,"value":1110},"Different join types determine which records are included in the result:",{"type":393,"tag":990,"props":1112,"children":1116},{"emoji":1113,"title":1114,"type":1115},"🔄","Join Types Explained","success",[1117,1133,1151,1166,1184,1199,1216,1231],{"type":393,"tag":401,"props":1118,"children":1119},{},[1120],{"type":393,"tag":1000,"props":1121,"children":1122},{},[1123,1125,1131],{"type":398,"value":1124},"Inner Join (",{"type":393,"tag":423,"props":1126,"children":1128},{"className":1127},[],[1129],{"type":398,"value":1130},"how='inner'",{"type":398,"value":1132},"):",{"type":393,"tag":1006,"props":1134,"children":1135},{},[1136,1141,1146],{"type":393,"tag":1010,"props":1137,"children":1138},{},[1139],{"type":398,"value":1140},"Only records that exist in BOTH DataFrames",{"type":393,"tag":1010,"props":1142,"children":1143},{},[1144],{"type":398,"value":1145},"Most restrictive, safest choice",{"type":393,"tag":1010,"props":1147,"children":1148},{},[1149],{"type":398,"value":1150},"Default behavior",{"type":393,"tag":401,"props":1152,"children":1153},{},[1154],{"type":393,"tag":1000,"props":1155,"children":1156},{},[1157,1159,1165],{"type":398,"value":1158},"Left Join (",{"type":393,"tag":423,"props":1160,"children":1162},{"className":1161},[],[1163],{"type":398,"value":1164},"how='left'",{"type":398,"value":1132},{"type":393,"tag":1006,"props":1167,"children":1168},{},[1169,1174,1179],{"type":393,"tag":1010,"props":1170,"children":1171},{},[1172],{"type":398,"value":1173},"ALL records from left DataFrame",{"type":393,"tag":1010,"props":1175,"children":1176},{},[1177],{"type":398,"value":1178},"Matching records from right DataFrame",{"type":393,"tag":1010,"props":1180,"children":1181},{},[1182],{"type":398,"value":1183},"Missing matches filled with NaN",{"type":393,"tag":401,"props":1185,"children":1186},{},[1187],{"type":393,"tag":1000,"props":1188,"children":1189},{},[1190,1192,1198],{"type":398,"value":1191},"Right Join (",{"type":393,"tag":423,"props":1193,"children":1195},{"className":1194},[],[1196],{"type":398,"value":1197},"how='right'",{"type":398,"value":1132},{"type":393,"tag":1006,"props":1200,"children":1201},{},[1202,1207,1212],{"type":393,"tag":1010,"props":1203,"children":1204},{},[1205],{"type":398,"value":1206},"ALL records from right DataFrame",{"type":393,"tag":1010,"props":1208,"children":1209},{},[1210],{"type":398,"value":1211},"Matching records from left DataFrame",{"type":393,"tag":1010,"props":1213,"children":1214},{},[1215],{"type":398,"value":1183},{"type":393,"tag":401,"props":1217,"children":1218},{},[1219],{"type":393,"tag":1000,"props":1220,"children":1221},{},[1222,1224,1230],{"type":398,"value":1223},"Outer Join (",{"type":393,"tag":423,"props":1225,"children":1227},{"className":1226},[],[1228],{"type":398,"value":1229},"how='outer'",{"type":398,"value":1132},{"type":393,"tag":1006,"props":1232,"children":1233},{},[1234,1239,1244],{"type":393,"tag":1010,"props":1235,"children":1236},{},[1237],{"type":398,"value":1238},"ALL records from BOTH DataFrames",{"type":393,"tag":1010,"props":1240,"children":1241},{},[1242],{"type":398,"value":1243},"Most inclusive, shows everything",{"type":393,"tag":1010,"props":1245,"children":1246},{},[1247],{"type":398,"value":1183},{"type":393,"tag":1249,"props":1250,"children":1252},"h3",{"id":1251},"inner-join-example",[1253],{"type":398,"value":1254},"Inner Join Example",{"type":393,"tag":412,"props":1256,"children":1257},{},[1258],{"type":393,"tag":416,"props":1259,"children":1261},{"className":418,"code":1260,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Product catalog\nproducts = pd.DataFrame({\n    'product_id': [1, 2, 3, 4],\n    'name': ['Laptop', 'Mouse', 'Keyboard', 'Monitor'],\n    'category': ['Electronics', 'Accessories', 'Accessories', 'Electronics']\n})\n\n# Sales data (not all products sold)\nsales = pd.DataFrame({\n    'product_id': [1, 2, 1, 3],\n    'quantity': [2, 5, 1, 3],\n    'revenue': [2000, 125, 1000, 225]\n})\n\nprint(\"Products:\")\nprint(products)\nprint()\nprint(\"Sales:\")\nprint(sales)\nprint()\n\n# Inner join - only products that were sold\ninner_result = sales.merge(products, on='product_id', how='inner')\nprint(\"Inner join - only sold products:\")\nprint(inner_result)\n",[1262],{"type":393,"tag":423,"props":1263,"children":1264},{"__ignoreMap":6},[1265,1284,1291,1299,1315,1359,1406,1452,1459,1466,1474,1490,1533,1578,1626,1633,1640,1660,1672,1683,1703,1715,1726,1733,1741,1793,1813],{"type":393,"tag":427,"props":1266,"children":1267},{"class":429,"line":11},[1268,1272,1276,1280],{"type":393,"tag":427,"props":1269,"children":1270},{"style":433},[1271],{"type":398,"value":436},{"type":393,"tag":427,"props":1273,"children":1274},{"style":439},[1275],{"type":398,"value":442},{"type":393,"tag":427,"props":1277,"children":1278},{"style":433},[1279],{"type":398,"value":447},{"type":393,"tag":427,"props":1281,"children":1282},{"style":439},[1283],{"type":398,"value":452},{"type":393,"tag":427,"props":1285,"children":1286},{"class":429,"line":27},[1287],{"type":393,"tag":427,"props":1288,"children":1289},{"emptyLinePlaceholder":12},[1290],{"type":398,"value":460},{"type":393,"tag":427,"props":1292,"children":1293},{"class":429,"line":36},[1294],{"type":393,"tag":427,"props":1295,"children":1296},{"style":466},[1297],{"type":398,"value":1298},"# Product catalog\n",{"type":393,"tag":427,"props":1300,"children":1301},{"class":429,"line":45},[1302,1307,1311],{"type":393,"tag":427,"props":1303,"children":1304},{"style":439},[1305],{"type":398,"value":1306},"products ",{"type":393,"tag":427,"props":1308,"children":1309},{"style":433},[1310],{"type":398,"value":482},{"type":393,"tag":427,"props":1312,"children":1313},{"style":439},[1314],{"type":398,"value":487},{"type":393,"tag":427,"props":1316,"children":1317},{"class":429,"line":54},[1318,1323,1327,1331,1335,1339,1343,1347,1351,1355],{"type":393,"tag":427,"props":1319,"children":1320},{"style":493},[1321],{"type":398,"value":1322},"    'product_id'",{"type":393,"tag":427,"props":1324,"children":1325},{"style":439},[1326],{"type":398,"value":501},{"type":393,"tag":427,"props":1328,"children":1329},{"style":504},[1330],{"type":398,"value":507},{"type":393,"tag":427,"props":1332,"children":1333},{"style":439},[1334],{"type":398,"value":512},{"type":393,"tag":427,"props":1336,"children":1337},{"style":504},[1338],{"type":398,"value":517},{"type":393,"tag":427,"props":1340,"children":1341},{"style":439},[1342],{"type":398,"value":512},{"type":393,"tag":427,"props":1344,"children":1345},{"style":504},[1346],{"type":398,"value":526},{"type":393,"tag":427,"props":1348,"children":1349},{"style":439},[1350],{"type":398,"value":512},{"type":393,"tag":427,"props":1352,"children":1353},{"style":504},[1354],{"type":398,"value":535},{"type":393,"tag":427,"props":1356,"children":1357},{"style":439},[1358],{"type":398,"value":540},{"type":393,"tag":427,"props":1360,"children":1361},{"class":429,"line":63},[1362,1366,1370,1375,1379,1384,1388,1393,1397,1402],{"type":393,"tag":427,"props":1363,"children":1364},{"style":493},[1365],{"type":398,"value":548},{"type":393,"tag":427,"props":1367,"children":1368},{"style":439},[1369],{"type":398,"value":501},{"type":393,"tag":427,"props":1371,"children":1372},{"style":493},[1373],{"type":398,"value":1374},"'Laptop'",{"type":393,"tag":427,"props":1376,"children":1377},{"style":439},[1378],{"type":398,"value":512},{"type":393,"tag":427,"props":1380,"children":1381},{"style":493},[1382],{"type":398,"value":1383},"'Mouse'",{"type":393,"tag":427,"props":1385,"children":1386},{"style":439},[1387],{"type":398,"value":512},{"type":393,"tag":427,"props":1389,"children":1390},{"style":493},[1391],{"type":398,"value":1392},"'Keyboard'",{"type":393,"tag":427,"props":1394,"children":1395},{"style":439},[1396],{"type":398,"value":512},{"type":393,"tag":427,"props":1398,"children":1399},{"style":493},[1400],{"type":398,"value":1401},"'Monitor'",{"type":393,"tag":427,"props":1403,"children":1404},{"style":439},[1405],{"type":398,"value":540},{"type":393,"tag":427,"props":1407,"children":1408},{"class":429,"line":72},[1409,1414,1418,1423,1427,1432,1436,1440,1444,1448],{"type":393,"tag":427,"props":1410,"children":1411},{"style":493},[1412],{"type":398,"value":1413},"    'category'",{"type":393,"tag":427,"props":1415,"children":1416},{"style":439},[1417],{"type":398,"value":501},{"type":393,"tag":427,"props":1419,"children":1420},{"style":493},[1421],{"type":398,"value":1422},"'Electronics'",{"type":393,"tag":427,"props":1424,"children":1425},{"style":439},[1426],{"type":398,"value":512},{"type":393,"tag":427,"props":1428,"children":1429},{"style":493},[1430],{"type":398,"value":1431},"'Accessories'",{"type":393,"tag":427,"props":1433,"children":1434},{"style":439},[1435],{"type":398,"value":512},{"type":393,"tag":427,"props":1437,"children":1438},{"style":493},[1439],{"type":398,"value":1431},{"type":393,"tag":427,"props":1441,"children":1442},{"style":439},[1443],{"type":398,"value":512},{"type":393,"tag":427,"props":1445,"children":1446},{"style":493},[1447],{"type":398,"value":1422},{"type":393,"tag":427,"props":1449,"children":1450},{"style":439},[1451],{"type":398,"value":637},{"type":393,"tag":427,"props":1453,"children":1454},{"class":429,"line":83},[1455],{"type":393,"tag":427,"props":1456,"children":1457},{"style":439},[1458],{"type":398,"value":645},{"type":393,"tag":427,"props":1460,"children":1461},{"class":429,"line":92},[1462],{"type":393,"tag":427,"props":1463,"children":1464},{"emptyLinePlaceholder":12},[1465],{"type":398,"value":460},{"type":393,"tag":427,"props":1467,"children":1468},{"class":429,"line":101},[1469],{"type":393,"tag":427,"props":1470,"children":1471},{"style":466},[1472],{"type":398,"value":1473},"# Sales data (not all products sold)\n",{"type":393,"tag":427,"props":1475,"children":1476},{"class":429,"line":110},[1477,1482,1486],{"type":393,"tag":427,"props":1478,"children":1479},{"style":439},[1480],{"type":398,"value":1481},"sales ",{"type":393,"tag":427,"props":1483,"children":1484},{"style":433},[1485],{"type":398,"value":482},{"type":393,"tag":427,"props":1487,"children":1488},{"style":439},[1489],{"type":398,"value":487},{"type":393,"tag":427,"props":1491,"children":1492},{"class":429,"line":121},[1493,1497,1501,1505,1509,1513,1517,1521,1525,1529],{"type":393,"tag":427,"props":1494,"children":1495},{"style":493},[1496],{"type":398,"value":1322},{"type":393,"tag":427,"props":1498,"children":1499},{"style":439},[1500],{"type":398,"value":501},{"type":393,"tag":427,"props":1502,"children":1503},{"style":504},[1504],{"type":398,"value":507},{"type":393,"tag":427,"props":1506,"children":1507},{"style":439},[1508],{"type":398,"value":512},{"type":393,"tag":427,"props":1510,"children":1511},{"style":504},[1512],{"type":398,"value":517},{"type":393,"tag":427,"props":1514,"children":1515},{"style":439},[1516],{"type":398,"value":512},{"type":393,"tag":427,"props":1518,"children":1519},{"style":504},[1520],{"type":398,"value":507},{"type":393,"tag":427,"props":1522,"children":1523},{"style":439},[1524],{"type":398,"value":512},{"type":393,"tag":427,"props":1526,"children":1527},{"style":504},[1528],{"type":398,"value":526},{"type":393,"tag":427,"props":1530,"children":1531},{"style":439},[1532],{"type":398,"value":540},{"type":393,"tag":427,"props":1534,"children":1535},{"class":429,"line":130},[1536,1541,1545,1549,1553,1558,1562,1566,1570,1574],{"type":393,"tag":427,"props":1537,"children":1538},{"style":493},[1539],{"type":398,"value":1540},"    'quantity'",{"type":393,"tag":427,"props":1542,"children":1543},{"style":439},[1544],{"type":398,"value":501},{"type":393,"tag":427,"props":1546,"children":1547},{"style":504},[1548],{"type":398,"value":517},{"type":393,"tag":427,"props":1550,"children":1551},{"style":439},[1552],{"type":398,"value":512},{"type":393,"tag":427,"props":1554,"children":1555},{"style":504},[1556],{"type":398,"value":1557},"5",{"type":393,"tag":427,"props":1559,"children":1560},{"style":439},[1561],{"type":398,"value":512},{"type":393,"tag":427,"props":1563,"children":1564},{"style":504},[1565],{"type":398,"value":507},{"type":393,"tag":427,"props":1567,"children":1568},{"style":439},[1569],{"type":398,"value":512},{"type":393,"tag":427,"props":1571,"children":1572},{"style":504},[1573],{"type":398,"value":526},{"type":393,"tag":427,"props":1575,"children":1576},{"style":439},[1577],{"type":398,"value":540},{"type":393,"tag":427,"props":1579,"children":1580},{"class":429,"line":139},[1581,1586,1590,1595,1599,1604,1608,1613,1617,1622],{"type":393,"tag":427,"props":1582,"children":1583},{"style":493},[1584],{"type":398,"value":1585},"    'revenue'",{"type":393,"tag":427,"props":1587,"children":1588},{"style":439},[1589],{"type":398,"value":501},{"type":393,"tag":427,"props":1591,"children":1592},{"style":504},[1593],{"type":398,"value":1594},"2000",{"type":393,"tag":427,"props":1596,"children":1597},{"style":439},[1598],{"type":398,"value":512},{"type":393,"tag":427,"props":1600,"children":1601},{"style":504},[1602],{"type":398,"value":1603},"125",{"type":393,"tag":427,"props":1605,"children":1606},{"style":439},[1607],{"type":398,"value":512},{"type":393,"tag":427,"props":1609,"children":1610},{"style":504},[1611],{"type":398,"value":1612},"1000",{"type":393,"tag":427,"props":1614,"children":1615},{"style":439},[1616],{"type":398,"value":512},{"type":393,"tag":427,"props":1618,"children":1619},{"style":504},[1620],{"type":398,"value":1621},"225",{"type":393,"tag":427,"props":1623,"children":1624},{"style":439},[1625],{"type":398,"value":637},{"type":393,"tag":427,"props":1627,"children":1628},{"class":429,"line":148},[1629],{"type":393,"tag":427,"props":1630,"children":1631},{"style":439},[1632],{"type":398,"value":645},{"type":393,"tag":427,"props":1634,"children":1635},{"class":429,"line":159},[1636],{"type":393,"tag":427,"props":1637,"children":1638},{"emptyLinePlaceholder":12},[1639],{"type":398,"value":460},{"type":393,"tag":427,"props":1641,"children":1642},{"class":429,"line":168},[1643,1647,1651,1656],{"type":393,"tag":427,"props":1644,"children":1645},{"style":504},[1646],{"type":398,"value":811},{"type":393,"tag":427,"props":1648,"children":1649},{"style":439},[1650],{"type":398,"value":816},{"type":393,"tag":427,"props":1652,"children":1653},{"style":493},[1654],{"type":398,"value":1655},"\"Products:\"",{"type":393,"tag":427,"props":1657,"children":1658},{"style":439},[1659],{"type":398,"value":826},{"type":393,"tag":427,"props":1661,"children":1662},{"class":429,"line":177},[1663,1667],{"type":393,"tag":427,"props":1664,"children":1665},{"style":504},[1666],{"type":398,"value":811},{"type":393,"tag":427,"props":1668,"children":1669},{"style":439},[1670],{"type":398,"value":1671},"(products)\n",{"type":393,"tag":427,"props":1673,"children":1674},{"class":429,"line":186},[1675,1679],{"type":393,"tag":427,"props":1676,"children":1677},{"style":504},[1678],{"type":398,"value":811},{"type":393,"tag":427,"props":1680,"children":1681},{"style":439},[1682],{"type":398,"value":850},{"type":393,"tag":427,"props":1684,"children":1685},{"class":429,"line":197},[1686,1690,1694,1699],{"type":393,"tag":427,"props":1687,"children":1688},{"style":504},[1689],{"type":398,"value":811},{"type":393,"tag":427,"props":1691,"children":1692},{"style":439},[1693],{"type":398,"value":816},{"type":393,"tag":427,"props":1695,"children":1696},{"style":493},[1697],{"type":398,"value":1698},"\"Sales:\"",{"type":393,"tag":427,"props":1700,"children":1701},{"style":439},[1702],{"type":398,"value":826},{"type":393,"tag":427,"props":1704,"children":1705},{"class":429,"line":206},[1706,1710],{"type":393,"tag":427,"props":1707,"children":1708},{"style":504},[1709],{"type":398,"value":811},{"type":393,"tag":427,"props":1711,"children":1712},{"style":439},[1713],{"type":398,"value":1714},"(sales)\n",{"type":393,"tag":427,"props":1716,"children":1717},{"class":429,"line":215},[1718,1722],{"type":393,"tag":427,"props":1719,"children":1720},{"style":504},[1721],{"type":398,"value":811},{"type":393,"tag":427,"props":1723,"children":1724},{"style":439},[1725],{"type":398,"value":850},{"type":393,"tag":427,"props":1727,"children":1728},{"class":429,"line":224},[1729],{"type":393,"tag":427,"props":1730,"children":1731},{"emptyLinePlaceholder":12},[1732],{"type":398,"value":460},{"type":393,"tag":427,"props":1734,"children":1735},{"class":429,"line":233},[1736],{"type":393,"tag":427,"props":1737,"children":1738},{"style":466},[1739],{"type":398,"value":1740},"# Inner join - only products that were sold\n",{"type":393,"tag":427,"props":1742,"children":1743},{"class":429,"line":244},[1744,1749,1753,1758,1762,1766,1771,1775,1780,1784,1789],{"type":393,"tag":427,"props":1745,"children":1746},{"style":439},[1747],{"type":398,"value":1748},"inner_result ",{"type":393,"tag":427,"props":1750,"children":1751},{"style":433},[1752],{"type":398,"value":482},{"type":393,"tag":427,"props":1754,"children":1755},{"style":439},[1756],{"type":398,"value":1757}," sales.merge(products, ",{"type":393,"tag":427,"props":1759,"children":1760},{"style":928},[1761],{"type":398,"value":931},{"type":393,"tag":427,"props":1763,"children":1764},{"style":433},[1765],{"type":398,"value":482},{"type":393,"tag":427,"props":1767,"children":1768},{"style":493},[1769],{"type":398,"value":1770},"'product_id'",{"type":393,"tag":427,"props":1772,"children":1773},{"style":439},[1774],{"type":398,"value":512},{"type":393,"tag":427,"props":1776,"children":1777},{"style":928},[1778],{"type":398,"value":1779},"how",{"type":393,"tag":427,"props":1781,"children":1782},{"style":433},[1783],{"type":398,"value":482},{"type":393,"tag":427,"props":1785,"children":1786},{"style":493},[1787],{"type":398,"value":1788},"'inner'",{"type":393,"tag":427,"props":1790,"children":1791},{"style":439},[1792],{"type":398,"value":826},{"type":393,"tag":427,"props":1794,"children":1795},{"class":429,"line":253},[1796,1800,1804,1809],{"type":393,"tag":427,"props":1797,"children":1798},{"style":504},[1799],{"type":398,"value":811},{"type":393,"tag":427,"props":1801,"children":1802},{"style":439},[1803],{"type":398,"value":816},{"type":393,"tag":427,"props":1805,"children":1806},{"style":493},[1807],{"type":398,"value":1808},"\"Inner join - only sold products:\"",{"type":393,"tag":427,"props":1810,"children":1811},{"style":439},[1812],{"type":398,"value":826},{"type":393,"tag":427,"props":1814,"children":1815},{"class":429,"line":262},[1816,1820],{"type":393,"tag":427,"props":1817,"children":1818},{"style":504},[1819],{"type":398,"value":811},{"type":393,"tag":427,"props":1821,"children":1822},{"style":439},[1823],{"type":398,"value":1824},"(inner_result)\n",{"type":393,"tag":1249,"props":1826,"children":1828},{"id":1827},"left-join-example",[1829],{"type":398,"value":1830},"Left Join Example",{"type":393,"tag":412,"props":1832,"children":1833},{},[1834],{"type":393,"tag":416,"props":1835,"children":1837},{"className":418,"code":1836,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Customer list\ncustomers = pd.DataFrame({\n    'customer_id': [1, 2, 3, 4],\n    'name': ['Alice', 'Bob', 'Charlie', 'Diana']\n})\n\n# Orders (not all customers placed orders)\norders = pd.DataFrame({\n    'customer_id': [1, 1, 2],\n    'order_amount': [100, 150, 200]\n})\n\nprint(\"Customers:\")\nprint(customers)\nprint()\nprint(\"Orders:\")\nprint(orders)\nprint()\n\n# Left join - all customers, even those without orders\nleft_result = customers.merge(orders, on='customer_id', how='left')\nprint(\"Left join - all customers:\")\nprint(left_result)\n",[1838],{"type":393,"tag":423,"props":1839,"children":1840},{"__ignoreMap":6},[1841,1860,1867,1875,1890,1933,1976,1983,1990,1998,2013,2048,2086,2093,2100,2119,2130,2141,2160,2171,2182,2189,2197,2247,2267],{"type":393,"tag":427,"props":1842,"children":1843},{"class":429,"line":11},[1844,1848,1852,1856],{"type":393,"tag":427,"props":1845,"children":1846},{"style":433},[1847],{"type":398,"value":436},{"type":393,"tag":427,"props":1849,"children":1850},{"style":439},[1851],{"type":398,"value":442},{"type":393,"tag":427,"props":1853,"children":1854},{"style":433},[1855],{"type":398,"value":447},{"type":393,"tag":427,"props":1857,"children":1858},{"style":439},[1859],{"type":398,"value":452},{"type":393,"tag":427,"props":1861,"children":1862},{"class":429,"line":27},[1863],{"type":393,"tag":427,"props":1864,"children":1865},{"emptyLinePlaceholder":12},[1866],{"type":398,"value":460},{"type":393,"tag":427,"props":1868,"children":1869},{"class":429,"line":36},[1870],{"type":393,"tag":427,"props":1871,"children":1872},{"style":466},[1873],{"type":398,"value":1874},"# Customer list\n",{"type":393,"tag":427,"props":1876,"children":1877},{"class":429,"line":45},[1878,1882,1886],{"type":393,"tag":427,"props":1879,"children":1880},{"style":439},[1881],{"type":398,"value":477},{"type":393,"tag":427,"props":1883,"children":1884},{"style":433},[1885],{"type":398,"value":482},{"type":393,"tag":427,"props":1887,"children":1888},{"style":439},[1889],{"type":398,"value":487},{"type":393,"tag":427,"props":1891,"children":1892},{"class":429,"line":54},[1893,1897,1901,1905,1909,1913,1917,1921,1925,1929],{"type":393,"tag":427,"props":1894,"children":1895},{"style":493},[1896],{"type":398,"value":496},{"type":393,"tag":427,"props":1898,"children":1899},{"style":439},[1900],{"type":398,"value":501},{"type":393,"tag":427,"props":1902,"children":1903},{"style":504},[1904],{"type":398,"value":507},{"type":393,"tag":427,"props":1906,"children":1907},{"style":439},[1908],{"type":398,"value":512},{"type":393,"tag":427,"props":1910,"children":1911},{"style":504},[1912],{"type":398,"value":517},{"type":393,"tag":427,"props":1914,"children":1915},{"style":439},[1916],{"type":398,"value":512},{"type":393,"tag":427,"props":1918,"children":1919},{"style":504},[1920],{"type":398,"value":526},{"type":393,"tag":427,"props":1922,"children":1923},{"style":439},[1924],{"type":398,"value":512},{"type":393,"tag":427,"props":1926,"children":1927},{"style":504},[1928],{"type":398,"value":535},{"type":393,"tag":427,"props":1930,"children":1931},{"style":439},[1932],{"type":398,"value":540},{"type":393,"tag":427,"props":1934,"children":1935},{"class":429,"line":63},[1936,1940,1944,1948,1952,1956,1960,1964,1968,1972],{"type":393,"tag":427,"props":1937,"children":1938},{"style":493},[1939],{"type":398,"value":548},{"type":393,"tag":427,"props":1941,"children":1942},{"style":439},[1943],{"type":398,"value":501},{"type":393,"tag":427,"props":1945,"children":1946},{"style":493},[1947],{"type":398,"value":557},{"type":393,"tag":427,"props":1949,"children":1950},{"style":439},[1951],{"type":398,"value":512},{"type":393,"tag":427,"props":1953,"children":1954},{"style":493},[1955],{"type":398,"value":566},{"type":393,"tag":427,"props":1957,"children":1958},{"style":439},[1959],{"type":398,"value":512},{"type":393,"tag":427,"props":1961,"children":1962},{"style":493},[1963],{"type":398,"value":575},{"type":393,"tag":427,"props":1965,"children":1966},{"style":439},[1967],{"type":398,"value":512},{"type":393,"tag":427,"props":1969,"children":1970},{"style":493},[1971],{"type":398,"value":584},{"type":393,"tag":427,"props":1973,"children":1974},{"style":439},[1975],{"type":398,"value":637},{"type":393,"tag":427,"props":1977,"children":1978},{"class":429,"line":72},[1979],{"type":393,"tag":427,"props":1980,"children":1981},{"style":439},[1982],{"type":398,"value":645},{"type":393,"tag":427,"props":1984,"children":1985},{"class":429,"line":83},[1986],{"type":393,"tag":427,"props":1987,"children":1988},{"emptyLinePlaceholder":12},[1989],{"type":398,"value":460},{"type":393,"tag":427,"props":1991,"children":1992},{"class":429,"line":92},[1993],{"type":393,"tag":427,"props":1994,"children":1995},{"style":466},[1996],{"type":398,"value":1997},"# Orders (not all customers placed orders)\n",{"type":393,"tag":427,"props":1999,"children":2000},{"class":429,"line":101},[2001,2005,2009],{"type":393,"tag":427,"props":2002,"children":2003},{"style":439},[2004],{"type":398,"value":668},{"type":393,"tag":427,"props":2006,"children":2007},{"style":433},[2008],{"type":398,"value":482},{"type":393,"tag":427,"props":2010,"children":2011},{"style":439},[2012],{"type":398,"value":487},{"type":393,"tag":427,"props":2014,"children":2015},{"class":429,"line":110},[2016,2020,2024,2028,2032,2036,2040,2044],{"type":393,"tag":427,"props":2017,"children":2018},{"style":493},[2019],{"type":398,"value":496},{"type":393,"tag":427,"props":2021,"children":2022},{"style":439},[2023],{"type":398,"value":501},{"type":393,"tag":427,"props":2025,"children":2026},{"style":504},[2027],{"type":398,"value":507},{"type":393,"tag":427,"props":2029,"children":2030},{"style":439},[2031],{"type":398,"value":512},{"type":393,"tag":427,"props":2033,"children":2034},{"style":504},[2035],{"type":398,"value":507},{"type":393,"tag":427,"props":2037,"children":2038},{"style":439},[2039],{"type":398,"value":512},{"type":393,"tag":427,"props":2041,"children":2042},{"style":504},[2043],{"type":398,"value":517},{"type":393,"tag":427,"props":2045,"children":2046},{"style":439},[2047],{"type":398,"value":540},{"type":393,"tag":427,"props":2049,"children":2050},{"class":429,"line":121},[2051,2056,2060,2065,2069,2073,2077,2082],{"type":393,"tag":427,"props":2052,"children":2053},{"style":493},[2054],{"type":398,"value":2055},"    'order_amount'",{"type":393,"tag":427,"props":2057,"children":2058},{"style":439},[2059],{"type":398,"value":501},{"type":393,"tag":427,"props":2061,"children":2062},{"style":504},[2063],{"type":398,"value":2064},"100",{"type":393,"tag":427,"props":2066,"children":2067},{"style":439},[2068],{"type":398,"value":512},{"type":393,"tag":427,"props":2070,"children":2071},{"style":504},[2072],{"type":398,"value":776},{"type":393,"tag":427,"props":2074,"children":2075},{"style":439},[2076],{"type":398,"value":512},{"type":393,"tag":427,"props":2078,"children":2079},{"style":504},[2080],{"type":398,"value":2081},"200",{"type":393,"tag":427,"props":2083,"children":2084},{"style":439},[2085],{"type":398,"value":637},{"type":393,"tag":427,"props":2087,"children":2088},{"class":429,"line":130},[2089],{"type":393,"tag":427,"props":2090,"children":2091},{"style":439},[2092],{"type":398,"value":645},{"type":393,"tag":427,"props":2094,"children":2095},{"class":429,"line":139},[2096],{"type":393,"tag":427,"props":2097,"children":2098},{"emptyLinePlaceholder":12},[2099],{"type":398,"value":460},{"type":393,"tag":427,"props":2101,"children":2102},{"class":429,"line":148},[2103,2107,2111,2115],{"type":393,"tag":427,"props":2104,"children":2105},{"style":504},[2106],{"type":398,"value":811},{"type":393,"tag":427,"props":2108,"children":2109},{"style":439},[2110],{"type":398,"value":816},{"type":393,"tag":427,"props":2112,"children":2113},{"style":493},[2114],{"type":398,"value":821},{"type":393,"tag":427,"props":2116,"children":2117},{"style":439},[2118],{"type":398,"value":826},{"type":393,"tag":427,"props":2120,"children":2121},{"class":429,"line":159},[2122,2126],{"type":393,"tag":427,"props":2123,"children":2124},{"style":504},[2125],{"type":398,"value":811},{"type":393,"tag":427,"props":2127,"children":2128},{"style":439},[2129],{"type":398,"value":838},{"type":393,"tag":427,"props":2131,"children":2132},{"class":429,"line":168},[2133,2137],{"type":393,"tag":427,"props":2134,"children":2135},{"style":504},[2136],{"type":398,"value":811},{"type":393,"tag":427,"props":2138,"children":2139},{"style":439},[2140],{"type":398,"value":850},{"type":393,"tag":427,"props":2142,"children":2143},{"class":429,"line":177},[2144,2148,2152,2156],{"type":393,"tag":427,"props":2145,"children":2146},{"style":504},[2147],{"type":398,"value":811},{"type":393,"tag":427,"props":2149,"children":2150},{"style":439},[2151],{"type":398,"value":816},{"type":393,"tag":427,"props":2153,"children":2154},{"style":493},[2155],{"type":398,"value":866},{"type":393,"tag":427,"props":2157,"children":2158},{"style":439},[2159],{"type":398,"value":826},{"type":393,"tag":427,"props":2161,"children":2162},{"class":429,"line":186},[2163,2167],{"type":393,"tag":427,"props":2164,"children":2165},{"style":504},[2166],{"type":398,"value":811},{"type":393,"tag":427,"props":2168,"children":2169},{"style":439},[2170],{"type":398,"value":882},{"type":393,"tag":427,"props":2172,"children":2173},{"class":429,"line":197},[2174,2178],{"type":393,"tag":427,"props":2175,"children":2176},{"style":504},[2177],{"type":398,"value":811},{"type":393,"tag":427,"props":2179,"children":2180},{"style":439},[2181],{"type":398,"value":850},{"type":393,"tag":427,"props":2183,"children":2184},{"class":429,"line":206},[2185],{"type":393,"tag":427,"props":2186,"children":2187},{"emptyLinePlaceholder":12},[2188],{"type":398,"value":460},{"type":393,"tag":427,"props":2190,"children":2191},{"class":429,"line":215},[2192],{"type":393,"tag":427,"props":2193,"children":2194},{"style":466},[2195],{"type":398,"value":2196},"# Left join - all customers, even those without orders\n",{"type":393,"tag":427,"props":2198,"children":2199},{"class":429,"line":224},[2200,2205,2209,2214,2218,2222,2226,2230,2234,2238,2243],{"type":393,"tag":427,"props":2201,"children":2202},{"style":439},[2203],{"type":398,"value":2204},"left_result ",{"type":393,"tag":427,"props":2206,"children":2207},{"style":433},[2208],{"type":398,"value":482},{"type":393,"tag":427,"props":2210,"children":2211},{"style":439},[2212],{"type":398,"value":2213}," customers.merge(orders, ",{"type":393,"tag":427,"props":2215,"children":2216},{"style":928},[2217],{"type":398,"value":931},{"type":393,"tag":427,"props":2219,"children":2220},{"style":433},[2221],{"type":398,"value":482},{"type":393,"tag":427,"props":2223,"children":2224},{"style":493},[2225],{"type":398,"value":940},{"type":393,"tag":427,"props":2227,"children":2228},{"style":439},[2229],{"type":398,"value":512},{"type":393,"tag":427,"props":2231,"children":2232},{"style":928},[2233],{"type":398,"value":1779},{"type":393,"tag":427,"props":2235,"children":2236},{"style":433},[2237],{"type":398,"value":482},{"type":393,"tag":427,"props":2239,"children":2240},{"style":493},[2241],{"type":398,"value":2242},"'left'",{"type":393,"tag":427,"props":2244,"children":2245},{"style":439},[2246],{"type":398,"value":826},{"type":393,"tag":427,"props":2248,"children":2249},{"class":429,"line":233},[2250,2254,2258,2263],{"type":393,"tag":427,"props":2251,"children":2252},{"style":504},[2253],{"type":398,"value":811},{"type":393,"tag":427,"props":2255,"children":2256},{"style":439},[2257],{"type":398,"value":816},{"type":393,"tag":427,"props":2259,"children":2260},{"style":493},[2261],{"type":398,"value":2262},"\"Left join - all customers:\"",{"type":393,"tag":427,"props":2264,"children":2265},{"style":439},[2266],{"type":398,"value":826},{"type":393,"tag":427,"props":2268,"children":2269},{"class":429,"line":244},[2270,2274],{"type":393,"tag":427,"props":2271,"children":2272},{"style":504},[2273],{"type":398,"value":811},{"type":393,"tag":427,"props":2275,"children":2276},{"style":439},[2277],{"type":398,"value":2278},"(left_result)\n",{"type":393,"tag":1249,"props":2280,"children":2282},{"id":2281},"outer-join-example",[2283],{"type":398,"value":2284},"Outer Join Example",{"type":393,"tag":412,"props":2286,"children":2287},{},[2288],{"type":393,"tag":416,"props":2289,"children":2291},{"className":418,"code":2290,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Q1 sales\nq1_sales = pd.DataFrame({\n    'product': ['Laptop', 'Mouse', 'Keyboard'],\n    'q1_sales': [10, 25, 15]\n})\n\n# Q2 sales (some different products)\nq2_sales = pd.DataFrame({\n    'product': ['Laptop', 'Monitor', 'Tablet'],\n    'q2_sales': [12, 8, 5]\n})\n\nprint(\"Q1 sales:\")\nprint(q1_sales)\nprint()\nprint(\"Q2 sales:\")\nprint(q2_sales)\nprint()\n\n# Outer join - all products from both quarters\nouter_result = q1_sales.merge(q2_sales, on='product', how='outer')\nprint(\"Outer join - all products:\")\nprint(outer_result)\n",[2292],{"type":393,"tag":423,"props":2293,"children":2294},{"__ignoreMap":6},[2295,2314,2321,2329,2345,2381,2420,2427,2434,2442,2458,2494,2532,2539,2546,2566,2578,2589,2609,2621,2632,2639,2647,2698,2718],{"type":393,"tag":427,"props":2296,"children":2297},{"class":429,"line":11},[2298,2302,2306,2310],{"type":393,"tag":427,"props":2299,"children":2300},{"style":433},[2301],{"type":398,"value":436},{"type":393,"tag":427,"props":2303,"children":2304},{"style":439},[2305],{"type":398,"value":442},{"type":393,"tag":427,"props":2307,"children":2308},{"style":433},[2309],{"type":398,"value":447},{"type":393,"tag":427,"props":2311,"children":2312},{"style":439},[2313],{"type":398,"value":452},{"type":393,"tag":427,"props":2315,"children":2316},{"class":429,"line":27},[2317],{"type":393,"tag":427,"props":2318,"children":2319},{"emptyLinePlaceholder":12},[2320],{"type":398,"value":460},{"type":393,"tag":427,"props":2322,"children":2323},{"class":429,"line":36},[2324],{"type":393,"tag":427,"props":2325,"children":2326},{"style":466},[2327],{"type":398,"value":2328},"# Q1 sales\n",{"type":393,"tag":427,"props":2330,"children":2331},{"class":429,"line":45},[2332,2337,2341],{"type":393,"tag":427,"props":2333,"children":2334},{"style":439},[2335],{"type":398,"value":2336},"q1_sales ",{"type":393,"tag":427,"props":2338,"children":2339},{"style":433},[2340],{"type":398,"value":482},{"type":393,"tag":427,"props":2342,"children":2343},{"style":439},[2344],{"type":398,"value":487},{"type":393,"tag":427,"props":2346,"children":2347},{"class":429,"line":54},[2348,2353,2357,2361,2365,2369,2373,2377],{"type":393,"tag":427,"props":2349,"children":2350},{"style":493},[2351],{"type":398,"value":2352},"    'product'",{"type":393,"tag":427,"props":2354,"children":2355},{"style":439},[2356],{"type":398,"value":501},{"type":393,"tag":427,"props":2358,"children":2359},{"style":493},[2360],{"type":398,"value":1374},{"type":393,"tag":427,"props":2362,"children":2363},{"style":439},[2364],{"type":398,"value":512},{"type":393,"tag":427,"props":2366,"children":2367},{"style":493},[2368],{"type":398,"value":1383},{"type":393,"tag":427,"props":2370,"children":2371},{"style":439},[2372],{"type":398,"value":512},{"type":393,"tag":427,"props":2374,"children":2375},{"style":493},[2376],{"type":398,"value":1392},{"type":393,"tag":427,"props":2378,"children":2379},{"style":439},[2380],{"type":398,"value":540},{"type":393,"tag":427,"props":2382,"children":2383},{"class":429,"line":63},[2384,2389,2393,2398,2402,2407,2411,2416],{"type":393,"tag":427,"props":2385,"children":2386},{"style":493},[2387],{"type":398,"value":2388},"    'q1_sales'",{"type":393,"tag":427,"props":2390,"children":2391},{"style":439},[2392],{"type":398,"value":501},{"type":393,"tag":427,"props":2394,"children":2395},{"style":504},[2396],{"type":398,"value":2397},"10",{"type":393,"tag":427,"props":2399,"children":2400},{"style":439},[2401],{"type":398,"value":512},{"type":393,"tag":427,"props":2403,"children":2404},{"style":504},[2405],{"type":398,"value":2406},"25",{"type":393,"tag":427,"props":2408,"children":2409},{"style":439},[2410],{"type":398,"value":512},{"type":393,"tag":427,"props":2412,"children":2413},{"style":504},[2414],{"type":398,"value":2415},"15",{"type":393,"tag":427,"props":2417,"children":2418},{"style":439},[2419],{"type":398,"value":637},{"type":393,"tag":427,"props":2421,"children":2422},{"class":429,"line":72},[2423],{"type":393,"tag":427,"props":2424,"children":2425},{"style":439},[2426],{"type":398,"value":645},{"type":393,"tag":427,"props":2428,"children":2429},{"class":429,"line":83},[2430],{"type":393,"tag":427,"props":2431,"children":2432},{"emptyLinePlaceholder":12},[2433],{"type":398,"value":460},{"type":393,"tag":427,"props":2435,"children":2436},{"class":429,"line":92},[2437],{"type":393,"tag":427,"props":2438,"children":2439},{"style":466},[2440],{"type":398,"value":2441},"# Q2 sales (some different products)\n",{"type":393,"tag":427,"props":2443,"children":2444},{"class":429,"line":101},[2445,2450,2454],{"type":393,"tag":427,"props":2446,"children":2447},{"style":439},[2448],{"type":398,"value":2449},"q2_sales ",{"type":393,"tag":427,"props":2451,"children":2452},{"style":433},[2453],{"type":398,"value":482},{"type":393,"tag":427,"props":2455,"children":2456},{"style":439},[2457],{"type":398,"value":487},{"type":393,"tag":427,"props":2459,"children":2460},{"class":429,"line":110},[2461,2465,2469,2473,2477,2481,2485,2490],{"type":393,"tag":427,"props":2462,"children":2463},{"style":493},[2464],{"type":398,"value":2352},{"type":393,"tag":427,"props":2466,"children":2467},{"style":439},[2468],{"type":398,"value":501},{"type":393,"tag":427,"props":2470,"children":2471},{"style":493},[2472],{"type":398,"value":1374},{"type":393,"tag":427,"props":2474,"children":2475},{"style":439},[2476],{"type":398,"value":512},{"type":393,"tag":427,"props":2478,"children":2479},{"style":493},[2480],{"type":398,"value":1401},{"type":393,"tag":427,"props":2482,"children":2483},{"style":439},[2484],{"type":398,"value":512},{"type":393,"tag":427,"props":2486,"children":2487},{"style":493},[2488],{"type":398,"value":2489},"'Tablet'",{"type":393,"tag":427,"props":2491,"children":2492},{"style":439},[2493],{"type":398,"value":540},{"type":393,"tag":427,"props":2495,"children":2496},{"class":429,"line":121},[2497,2502,2506,2511,2515,2520,2524,2528],{"type":393,"tag":427,"props":2498,"children":2499},{"style":493},[2500],{"type":398,"value":2501},"    'q2_sales'",{"type":393,"tag":427,"props":2503,"children":2504},{"style":439},[2505],{"type":398,"value":501},{"type":393,"tag":427,"props":2507,"children":2508},{"style":504},[2509],{"type":398,"value":2510},"12",{"type":393,"tag":427,"props":2512,"children":2513},{"style":439},[2514],{"type":398,"value":512},{"type":393,"tag":427,"props":2516,"children":2517},{"style":504},[2518],{"type":398,"value":2519},"8",{"type":393,"tag":427,"props":2521,"children":2522},{"style":439},[2523],{"type":398,"value":512},{"type":393,"tag":427,"props":2525,"children":2526},{"style":504},[2527],{"type":398,"value":1557},{"type":393,"tag":427,"props":2529,"children":2530},{"style":439},[2531],{"type":398,"value":637},{"type":393,"tag":427,"props":2533,"children":2534},{"class":429,"line":130},[2535],{"type":393,"tag":427,"props":2536,"children":2537},{"style":439},[2538],{"type":398,"value":645},{"type":393,"tag":427,"props":2540,"children":2541},{"class":429,"line":139},[2542],{"type":393,"tag":427,"props":2543,"children":2544},{"emptyLinePlaceholder":12},[2545],{"type":398,"value":460},{"type":393,"tag":427,"props":2547,"children":2548},{"class":429,"line":148},[2549,2553,2557,2562],{"type":393,"tag":427,"props":2550,"children":2551},{"style":504},[2552],{"type":398,"value":811},{"type":393,"tag":427,"props":2554,"children":2555},{"style":439},[2556],{"type":398,"value":816},{"type":393,"tag":427,"props":2558,"children":2559},{"style":493},[2560],{"type":398,"value":2561},"\"Q1 sales:\"",{"type":393,"tag":427,"props":2563,"children":2564},{"style":439},[2565],{"type":398,"value":826},{"type":393,"tag":427,"props":2567,"children":2568},{"class":429,"line":159},[2569,2573],{"type":393,"tag":427,"props":2570,"children":2571},{"style":504},[2572],{"type":398,"value":811},{"type":393,"tag":427,"props":2574,"children":2575},{"style":439},[2576],{"type":398,"value":2577},"(q1_sales)\n",{"type":393,"tag":427,"props":2579,"children":2580},{"class":429,"line":168},[2581,2585],{"type":393,"tag":427,"props":2582,"children":2583},{"style":504},[2584],{"type":398,"value":811},{"type":393,"tag":427,"props":2586,"children":2587},{"style":439},[2588],{"type":398,"value":850},{"type":393,"tag":427,"props":2590,"children":2591},{"class":429,"line":177},[2592,2596,2600,2605],{"type":393,"tag":427,"props":2593,"children":2594},{"style":504},[2595],{"type":398,"value":811},{"type":393,"tag":427,"props":2597,"children":2598},{"style":439},[2599],{"type":398,"value":816},{"type":393,"tag":427,"props":2601,"children":2602},{"style":493},[2603],{"type":398,"value":2604},"\"Q2 sales:\"",{"type":393,"tag":427,"props":2606,"children":2607},{"style":439},[2608],{"type":398,"value":826},{"type":393,"tag":427,"props":2610,"children":2611},{"class":429,"line":186},[2612,2616],{"type":393,"tag":427,"props":2613,"children":2614},{"style":504},[2615],{"type":398,"value":811},{"type":393,"tag":427,"props":2617,"children":2618},{"style":439},[2619],{"type":398,"value":2620},"(q2_sales)\n",{"type":393,"tag":427,"props":2622,"children":2623},{"class":429,"line":197},[2624,2628],{"type":393,"tag":427,"props":2625,"children":2626},{"style":504},[2627],{"type":398,"value":811},{"type":393,"tag":427,"props":2629,"children":2630},{"style":439},[2631],{"type":398,"value":850},{"type":393,"tag":427,"props":2633,"children":2634},{"class":429,"line":206},[2635],{"type":393,"tag":427,"props":2636,"children":2637},{"emptyLinePlaceholder":12},[2638],{"type":398,"value":460},{"type":393,"tag":427,"props":2640,"children":2641},{"class":429,"line":215},[2642],{"type":393,"tag":427,"props":2643,"children":2644},{"style":466},[2645],{"type":398,"value":2646},"# Outer join - all products from both quarters\n",{"type":393,"tag":427,"props":2648,"children":2649},{"class":429,"line":224},[2650,2655,2659,2664,2668,2672,2677,2681,2685,2689,2694],{"type":393,"tag":427,"props":2651,"children":2652},{"style":439},[2653],{"type":398,"value":2654},"outer_result ",{"type":393,"tag":427,"props":2656,"children":2657},{"style":433},[2658],{"type":398,"value":482},{"type":393,"tag":427,"props":2660,"children":2661},{"style":439},[2662],{"type":398,"value":2663}," q1_sales.merge(q2_sales, ",{"type":393,"tag":427,"props":2665,"children":2666},{"style":928},[2667],{"type":398,"value":931},{"type":393,"tag":427,"props":2669,"children":2670},{"style":433},[2671],{"type":398,"value":482},{"type":393,"tag":427,"props":2673,"children":2674},{"style":493},[2675],{"type":398,"value":2676},"'product'",{"type":393,"tag":427,"props":2678,"children":2679},{"style":439},[2680],{"type":398,"value":512},{"type":393,"tag":427,"props":2682,"children":2683},{"style":928},[2684],{"type":398,"value":1779},{"type":393,"tag":427,"props":2686,"children":2687},{"style":433},[2688],{"type":398,"value":482},{"type":393,"tag":427,"props":2690,"children":2691},{"style":493},[2692],{"type":398,"value":2693},"'outer'",{"type":393,"tag":427,"props":2695,"children":2696},{"style":439},[2697],{"type":398,"value":826},{"type":393,"tag":427,"props":2699,"children":2700},{"class":429,"line":233},[2701,2705,2709,2714],{"type":393,"tag":427,"props":2702,"children":2703},{"style":504},[2704],{"type":398,"value":811},{"type":393,"tag":427,"props":2706,"children":2707},{"style":439},[2708],{"type":398,"value":816},{"type":393,"tag":427,"props":2710,"children":2711},{"style":493},[2712],{"type":398,"value":2713},"\"Outer join - all products:\"",{"type":393,"tag":427,"props":2715,"children":2716},{"style":439},[2717],{"type":398,"value":826},{"type":393,"tag":427,"props":2719,"children":2720},{"class":429,"line":244},[2721,2725],{"type":393,"tag":427,"props":2722,"children":2723},{"style":504},[2724],{"type":398,"value":811},{"type":393,"tag":427,"props":2726,"children":2727},{"style":439},[2728],{"type":398,"value":2729},"(outer_result)\n",{"type":393,"tag":978,"props":2731,"children":2733},{"id":2732},"️-different-column-names",[2734],{"type":398,"value":2735},"🏷️ Different Column Names",{"type":393,"tag":401,"props":2737,"children":2738},{},[2739],{"type":398,"value":2740},"When join keys have different names in each DataFrame:",{"type":393,"tag":412,"props":2742,"children":2743},{},[2744],{"type":393,"tag":416,"props":2745,"children":2747},{"className":418,"code":2746,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Employee table\nemployees = pd.DataFrame({\n    'emp_id': [1, 2, 3],\n    'name': ['Alice', 'Bob', 'Charlie'],\n    'department': ['Sales', 'IT', 'HR']\n})\n\n# Salary table (uses different column name)\nsalaries = pd.DataFrame({\n    'employee_id': [1, 2, 3],\n    'salary': [50000, 75000, 60000],\n    'bonus': [5000, 8000, 6000]\n})\n\nprint(\"Employees:\")\nprint(employees)\nprint()\nprint(\"Salaries:\")\nprint(salaries)\nprint()\n\n# Merge with different column names\nemp_salary = employees.merge(salaries, \n                           left_on='emp_id', \n                           right_on='employee_id')\nprint(\"Employee salaries:\")\nprint(emp_salary)\n",[2748],{"type":393,"tag":423,"props":2749,"children":2750},{"__ignoreMap":6},[2751,2770,2777,2785,2801,2837,2872,2911,2918,2925,2933,2949,2985,3024,3063,3070,3077,3097,3109,3120,3140,3152,3163,3170,3178,3195,3217,3238,3258],{"type":393,"tag":427,"props":2752,"children":2753},{"class":429,"line":11},[2754,2758,2762,2766],{"type":393,"tag":427,"props":2755,"children":2756},{"style":433},[2757],{"type":398,"value":436},{"type":393,"tag":427,"props":2759,"children":2760},{"style":439},[2761],{"type":398,"value":442},{"type":393,"tag":427,"props":2763,"children":2764},{"style":433},[2765],{"type":398,"value":447},{"type":393,"tag":427,"props":2767,"children":2768},{"style":439},[2769],{"type":398,"value":452},{"type":393,"tag":427,"props":2771,"children":2772},{"class":429,"line":27},[2773],{"type":393,"tag":427,"props":2774,"children":2775},{"emptyLinePlaceholder":12},[2776],{"type":398,"value":460},{"type":393,"tag":427,"props":2778,"children":2779},{"class":429,"line":36},[2780],{"type":393,"tag":427,"props":2781,"children":2782},{"style":466},[2783],{"type":398,"value":2784},"# Employee table\n",{"type":393,"tag":427,"props":2786,"children":2787},{"class":429,"line":45},[2788,2793,2797],{"type":393,"tag":427,"props":2789,"children":2790},{"style":439},[2791],{"type":398,"value":2792},"employees ",{"type":393,"tag":427,"props":2794,"children":2795},{"style":433},[2796],{"type":398,"value":482},{"type":393,"tag":427,"props":2798,"children":2799},{"style":439},[2800],{"type":398,"value":487},{"type":393,"tag":427,"props":2802,"children":2803},{"class":429,"line":54},[2804,2809,2813,2817,2821,2825,2829,2833],{"type":393,"tag":427,"props":2805,"children":2806},{"style":493},[2807],{"type":398,"value":2808},"    'emp_id'",{"type":393,"tag":427,"props":2810,"children":2811},{"style":439},[2812],{"type":398,"value":501},{"type":393,"tag":427,"props":2814,"children":2815},{"style":504},[2816],{"type":398,"value":507},{"type":393,"tag":427,"props":2818,"children":2819},{"style":439},[2820],{"type":398,"value":512},{"type":393,"tag":427,"props":2822,"children":2823},{"style":504},[2824],{"type":398,"value":517},{"type":393,"tag":427,"props":2826,"children":2827},{"style":439},[2828],{"type":398,"value":512},{"type":393,"tag":427,"props":2830,"children":2831},{"style":504},[2832],{"type":398,"value":526},{"type":393,"tag":427,"props":2834,"children":2835},{"style":439},[2836],{"type":398,"value":540},{"type":393,"tag":427,"props":2838,"children":2839},{"class":429,"line":63},[2840,2844,2848,2852,2856,2860,2864,2868],{"type":393,"tag":427,"props":2841,"children":2842},{"style":493},[2843],{"type":398,"value":548},{"type":393,"tag":427,"props":2845,"children":2846},{"style":439},[2847],{"type":398,"value":501},{"type":393,"tag":427,"props":2849,"children":2850},{"style":493},[2851],{"type":398,"value":557},{"type":393,"tag":427,"props":2853,"children":2854},{"style":439},[2855],{"type":398,"value":512},{"type":393,"tag":427,"props":2857,"children":2858},{"style":493},[2859],{"type":398,"value":566},{"type":393,"tag":427,"props":2861,"children":2862},{"style":439},[2863],{"type":398,"value":512},{"type":393,"tag":427,"props":2865,"children":2866},{"style":493},[2867],{"type":398,"value":575},{"type":393,"tag":427,"props":2869,"children":2870},{"style":439},[2871],{"type":398,"value":540},{"type":393,"tag":427,"props":2873,"children":2874},{"class":429,"line":72},[2875,2880,2884,2889,2893,2898,2902,2907],{"type":393,"tag":427,"props":2876,"children":2877},{"style":493},[2878],{"type":398,"value":2879},"    'department'",{"type":393,"tag":427,"props":2881,"children":2882},{"style":439},[2883],{"type":398,"value":501},{"type":393,"tag":427,"props":2885,"children":2886},{"style":493},[2887],{"type":398,"value":2888},"'Sales'",{"type":393,"tag":427,"props":2890,"children":2891},{"style":439},[2892],{"type":398,"value":512},{"type":393,"tag":427,"props":2894,"children":2895},{"style":493},[2896],{"type":398,"value":2897},"'IT'",{"type":393,"tag":427,"props":2899,"children":2900},{"style":439},[2901],{"type":398,"value":512},{"type":393,"tag":427,"props":2903,"children":2904},{"style":493},[2905],{"type":398,"value":2906},"'HR'",{"type":393,"tag":427,"props":2908,"children":2909},{"style":439},[2910],{"type":398,"value":637},{"type":393,"tag":427,"props":2912,"children":2913},{"class":429,"line":83},[2914],{"type":393,"tag":427,"props":2915,"children":2916},{"style":439},[2917],{"type":398,"value":645},{"type":393,"tag":427,"props":2919,"children":2920},{"class":429,"line":92},[2921],{"type":393,"tag":427,"props":2922,"children":2923},{"emptyLinePlaceholder":12},[2924],{"type":398,"value":460},{"type":393,"tag":427,"props":2926,"children":2927},{"class":429,"line":101},[2928],{"type":393,"tag":427,"props":2929,"children":2930},{"style":466},[2931],{"type":398,"value":2932},"# Salary table (uses different column name)\n",{"type":393,"tag":427,"props":2934,"children":2935},{"class":429,"line":110},[2936,2941,2945],{"type":393,"tag":427,"props":2937,"children":2938},{"style":439},[2939],{"type":398,"value":2940},"salaries ",{"type":393,"tag":427,"props":2942,"children":2943},{"style":433},[2944],{"type":398,"value":482},{"type":393,"tag":427,"props":2946,"children":2947},{"style":439},[2948],{"type":398,"value":487},{"type":393,"tag":427,"props":2950,"children":2951},{"class":429,"line":121},[2952,2957,2961,2965,2969,2973,2977,2981],{"type":393,"tag":427,"props":2953,"children":2954},{"style":493},[2955],{"type":398,"value":2956},"    'employee_id'",{"type":393,"tag":427,"props":2958,"children":2959},{"style":439},[2960],{"type":398,"value":501},{"type":393,"tag":427,"props":2962,"children":2963},{"style":504},[2964],{"type":398,"value":507},{"type":393,"tag":427,"props":2966,"children":2967},{"style":439},[2968],{"type":398,"value":512},{"type":393,"tag":427,"props":2970,"children":2971},{"style":504},[2972],{"type":398,"value":517},{"type":393,"tag":427,"props":2974,"children":2975},{"style":439},[2976],{"type":398,"value":512},{"type":393,"tag":427,"props":2978,"children":2979},{"style":504},[2980],{"type":398,"value":526},{"type":393,"tag":427,"props":2982,"children":2983},{"style":439},[2984],{"type":398,"value":540},{"type":393,"tag":427,"props":2986,"children":2987},{"class":429,"line":130},[2988,2993,2997,3002,3006,3011,3015,3020],{"type":393,"tag":427,"props":2989,"children":2990},{"style":493},[2991],{"type":398,"value":2992},"    'salary'",{"type":393,"tag":427,"props":2994,"children":2995},{"style":439},[2996],{"type":398,"value":501},{"type":393,"tag":427,"props":2998,"children":2999},{"style":504},[3000],{"type":398,"value":3001},"50000",{"type":393,"tag":427,"props":3003,"children":3004},{"style":439},[3005],{"type":398,"value":512},{"type":393,"tag":427,"props":3007,"children":3008},{"style":504},[3009],{"type":398,"value":3010},"75000",{"type":393,"tag":427,"props":3012,"children":3013},{"style":439},[3014],{"type":398,"value":512},{"type":393,"tag":427,"props":3016,"children":3017},{"style":504},[3018],{"type":398,"value":3019},"60000",{"type":393,"tag":427,"props":3021,"children":3022},{"style":439},[3023],{"type":398,"value":540},{"type":393,"tag":427,"props":3025,"children":3026},{"class":429,"line":139},[3027,3032,3036,3041,3045,3050,3054,3059],{"type":393,"tag":427,"props":3028,"children":3029},{"style":493},[3030],{"type":398,"value":3031},"    'bonus'",{"type":393,"tag":427,"props":3033,"children":3034},{"style":439},[3035],{"type":398,"value":501},{"type":393,"tag":427,"props":3037,"children":3038},{"style":504},[3039],{"type":398,"value":3040},"5000",{"type":393,"tag":427,"props":3042,"children":3043},{"style":439},[3044],{"type":398,"value":512},{"type":393,"tag":427,"props":3046,"children":3047},{"style":504},[3048],{"type":398,"value":3049},"8000",{"type":393,"tag":427,"props":3051,"children":3052},{"style":439},[3053],{"type":398,"value":512},{"type":393,"tag":427,"props":3055,"children":3056},{"style":504},[3057],{"type":398,"value":3058},"6000",{"type":393,"tag":427,"props":3060,"children":3061},{"style":439},[3062],{"type":398,"value":637},{"type":393,"tag":427,"props":3064,"children":3065},{"class":429,"line":148},[3066],{"type":393,"tag":427,"props":3067,"children":3068},{"style":439},[3069],{"type":398,"value":645},{"type":393,"tag":427,"props":3071,"children":3072},{"class":429,"line":159},[3073],{"type":393,"tag":427,"props":3074,"children":3075},{"emptyLinePlaceholder":12},[3076],{"type":398,"value":460},{"type":393,"tag":427,"props":3078,"children":3079},{"class":429,"line":168},[3080,3084,3088,3093],{"type":393,"tag":427,"props":3081,"children":3082},{"style":504},[3083],{"type":398,"value":811},{"type":393,"tag":427,"props":3085,"children":3086},{"style":439},[3087],{"type":398,"value":816},{"type":393,"tag":427,"props":3089,"children":3090},{"style":493},[3091],{"type":398,"value":3092},"\"Employees:\"",{"type":393,"tag":427,"props":3094,"children":3095},{"style":439},[3096],{"type":398,"value":826},{"type":393,"tag":427,"props":3098,"children":3099},{"class":429,"line":177},[3100,3104],{"type":393,"tag":427,"props":3101,"children":3102},{"style":504},[3103],{"type":398,"value":811},{"type":393,"tag":427,"props":3105,"children":3106},{"style":439},[3107],{"type":398,"value":3108},"(employees)\n",{"type":393,"tag":427,"props":3110,"children":3111},{"class":429,"line":186},[3112,3116],{"type":393,"tag":427,"props":3113,"children":3114},{"style":504},[3115],{"type":398,"value":811},{"type":393,"tag":427,"props":3117,"children":3118},{"style":439},[3119],{"type":398,"value":850},{"type":393,"tag":427,"props":3121,"children":3122},{"class":429,"line":197},[3123,3127,3131,3136],{"type":393,"tag":427,"props":3124,"children":3125},{"style":504},[3126],{"type":398,"value":811},{"type":393,"tag":427,"props":3128,"children":3129},{"style":439},[3130],{"type":398,"value":816},{"type":393,"tag":427,"props":3132,"children":3133},{"style":493},[3134],{"type":398,"value":3135},"\"Salaries:\"",{"type":393,"tag":427,"props":3137,"children":3138},{"style":439},[3139],{"type":398,"value":826},{"type":393,"tag":427,"props":3141,"children":3142},{"class":429,"line":206},[3143,3147],{"type":393,"tag":427,"props":3144,"children":3145},{"style":504},[3146],{"type":398,"value":811},{"type":393,"tag":427,"props":3148,"children":3149},{"style":439},[3150],{"type":398,"value":3151},"(salaries)\n",{"type":393,"tag":427,"props":3153,"children":3154},{"class":429,"line":215},[3155,3159],{"type":393,"tag":427,"props":3156,"children":3157},{"style":504},[3158],{"type":398,"value":811},{"type":393,"tag":427,"props":3160,"children":3161},{"style":439},[3162],{"type":398,"value":850},{"type":393,"tag":427,"props":3164,"children":3165},{"class":429,"line":224},[3166],{"type":393,"tag":427,"props":3167,"children":3168},{"emptyLinePlaceholder":12},[3169],{"type":398,"value":460},{"type":393,"tag":427,"props":3171,"children":3172},{"class":429,"line":233},[3173],{"type":393,"tag":427,"props":3174,"children":3175},{"style":466},[3176],{"type":398,"value":3177},"# Merge with different column names\n",{"type":393,"tag":427,"props":3179,"children":3180},{"class":429,"line":244},[3181,3186,3190],{"type":393,"tag":427,"props":3182,"children":3183},{"style":439},[3184],{"type":398,"value":3185},"emp_salary ",{"type":393,"tag":427,"props":3187,"children":3188},{"style":433},[3189],{"type":398,"value":482},{"type":393,"tag":427,"props":3191,"children":3192},{"style":439},[3193],{"type":398,"value":3194}," employees.merge(salaries, \n",{"type":393,"tag":427,"props":3196,"children":3197},{"class":429,"line":253},[3198,3203,3207,3212],{"type":393,"tag":427,"props":3199,"children":3200},{"style":928},[3201],{"type":398,"value":3202},"                           left_on",{"type":393,"tag":427,"props":3204,"children":3205},{"style":433},[3206],{"type":398,"value":482},{"type":393,"tag":427,"props":3208,"children":3209},{"style":493},[3210],{"type":398,"value":3211},"'emp_id'",{"type":393,"tag":427,"props":3213,"children":3214},{"style":439},[3215],{"type":398,"value":3216},", \n",{"type":393,"tag":427,"props":3218,"children":3219},{"class":429,"line":262},[3220,3225,3229,3234],{"type":393,"tag":427,"props":3221,"children":3222},{"style":928},[3223],{"type":398,"value":3224},"                           right_on",{"type":393,"tag":427,"props":3226,"children":3227},{"style":433},[3228],{"type":398,"value":482},{"type":393,"tag":427,"props":3230,"children":3231},{"style":493},[3232],{"type":398,"value":3233},"'employee_id'",{"type":393,"tag":427,"props":3235,"children":3236},{"style":439},[3237],{"type":398,"value":826},{"type":393,"tag":427,"props":3239,"children":3240},{"class":429,"line":271},[3241,3245,3249,3254],{"type":393,"tag":427,"props":3242,"children":3243},{"style":504},[3244],{"type":398,"value":811},{"type":393,"tag":427,"props":3246,"children":3247},{"style":439},[3248],{"type":398,"value":816},{"type":393,"tag":427,"props":3250,"children":3251},{"style":493},[3252],{"type":398,"value":3253},"\"Employee salaries:\"",{"type":393,"tag":427,"props":3255,"children":3256},{"style":439},[3257],{"type":398,"value":826},{"type":393,"tag":427,"props":3259,"children":3260},{"class":429,"line":281},[3261,3265],{"type":393,"tag":427,"props":3262,"children":3263},{"style":504},[3264],{"type":398,"value":811},{"type":393,"tag":427,"props":3266,"children":3267},{"style":439},[3268],{"type":398,"value":3269},"(emp_salary)\n",{"type":393,"tag":978,"props":3271,"children":3273},{"id":3272},"multiple-key-columns",[3274],{"type":398,"value":3275},"📊 Multiple Key Columns",{"type":393,"tag":401,"props":3277,"children":3278},{},[3279],{"type":398,"value":3280},"Sometimes you need to match on multiple columns:",{"type":393,"tag":412,"props":3282,"children":3283},{},[3284],{"type":393,"tag":416,"props":3285,"children":3287},{"className":418,"code":3286,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Sales targets\ntargets = pd.DataFrame({\n    'region': ['North', 'South', 'North', 'South'],\n    'quarter': ['Q1', 'Q1', 'Q2', 'Q2'],\n    'target': [100000, 90000, 110000, 95000]\n})\n\n# Actual sales\nactuals = pd.DataFrame({\n    'region': ['North', 'South', 'North', 'South'],\n    'quarter': ['Q1', 'Q1', 'Q2', 'Q2'],\n    'actual': [105000, 88000, 115000, 98000]\n})\n\nprint(\"Targets:\")\nprint(targets)\nprint()\nprint(\"Actuals:\")\nprint(actuals)\nprint()\n\n# Merge on multiple columns\nperformance = targets.merge(actuals, on=['region', 'quarter'])\nprint(\"Performance vs targets:\")\nprint(performance)\nprint()\n\n# Calculate performance percentage\nperformance['achievement'] = (performance['actual'] / performance['target'] * 100).round(1)\nprint(\"With achievement percentage:\")\nprint(performance)\n",[3288],{"type":393,"tag":423,"props":3289,"children":3290},{"__ignoreMap":6},[3291,3310,3317,3325,3341,3387,3433,3481,3488,3495,3503,3519,3562,3605,3653,3660,3667,3687,3699,3710,3730,3742,3753,3760,3768,3817,3837,3849,3860,3867,3875,3953,3973],{"type":393,"tag":427,"props":3292,"children":3293},{"class":429,"line":11},[3294,3298,3302,3306],{"type":393,"tag":427,"props":3295,"children":3296},{"style":433},[3297],{"type":398,"value":436},{"type":393,"tag":427,"props":3299,"children":3300},{"style":439},[3301],{"type":398,"value":442},{"type":393,"tag":427,"props":3303,"children":3304},{"style":433},[3305],{"type":398,"value":447},{"type":393,"tag":427,"props":3307,"children":3308},{"style":439},[3309],{"type":398,"value":452},{"type":393,"tag":427,"props":3311,"children":3312},{"class":429,"line":27},[3313],{"type":393,"tag":427,"props":3314,"children":3315},{"emptyLinePlaceholder":12},[3316],{"type":398,"value":460},{"type":393,"tag":427,"props":3318,"children":3319},{"class":429,"line":36},[3320],{"type":393,"tag":427,"props":3321,"children":3322},{"style":466},[3323],{"type":398,"value":3324},"# Sales targets\n",{"type":393,"tag":427,"props":3326,"children":3327},{"class":429,"line":45},[3328,3333,3337],{"type":393,"tag":427,"props":3329,"children":3330},{"style":439},[3331],{"type":398,"value":3332},"targets ",{"type":393,"tag":427,"props":3334,"children":3335},{"style":433},[3336],{"type":398,"value":482},{"type":393,"tag":427,"props":3338,"children":3339},{"style":439},[3340],{"type":398,"value":487},{"type":393,"tag":427,"props":3342,"children":3343},{"class":429,"line":54},[3344,3349,3353,3358,3362,3367,3371,3375,3379,3383],{"type":393,"tag":427,"props":3345,"children":3346},{"style":493},[3347],{"type":398,"value":3348},"    'region'",{"type":393,"tag":427,"props":3350,"children":3351},{"style":439},[3352],{"type":398,"value":501},{"type":393,"tag":427,"props":3354,"children":3355},{"style":493},[3356],{"type":398,"value":3357},"'North'",{"type":393,"tag":427,"props":3359,"children":3360},{"style":439},[3361],{"type":398,"value":512},{"type":393,"tag":427,"props":3363,"children":3364},{"style":493},[3365],{"type":398,"value":3366},"'South'",{"type":393,"tag":427,"props":3368,"children":3369},{"style":439},[3370],{"type":398,"value":512},{"type":393,"tag":427,"props":3372,"children":3373},{"style":493},[3374],{"type":398,"value":3357},{"type":393,"tag":427,"props":3376,"children":3377},{"style":439},[3378],{"type":398,"value":512},{"type":393,"tag":427,"props":3380,"children":3381},{"style":493},[3382],{"type":398,"value":3366},{"type":393,"tag":427,"props":3384,"children":3385},{"style":439},[3386],{"type":398,"value":540},{"type":393,"tag":427,"props":3388,"children":3389},{"class":429,"line":63},[3390,3395,3399,3404,3408,3412,3416,3421,3425,3429],{"type":393,"tag":427,"props":3391,"children":3392},{"style":493},[3393],{"type":398,"value":3394},"    'quarter'",{"type":393,"tag":427,"props":3396,"children":3397},{"style":439},[3398],{"type":398,"value":501},{"type":393,"tag":427,"props":3400,"children":3401},{"style":493},[3402],{"type":398,"value":3403},"'Q1'",{"type":393,"tag":427,"props":3405,"children":3406},{"style":439},[3407],{"type":398,"value":512},{"type":393,"tag":427,"props":3409,"children":3410},{"style":493},[3411],{"type":398,"value":3403},{"type":393,"tag":427,"props":3413,"children":3414},{"style":439},[3415],{"type":398,"value":512},{"type":393,"tag":427,"props":3417,"children":3418},{"style":493},[3419],{"type":398,"value":3420},"'Q2'",{"type":393,"tag":427,"props":3422,"children":3423},{"style":439},[3424],{"type":398,"value":512},{"type":393,"tag":427,"props":3426,"children":3427},{"style":493},[3428],{"type":398,"value":3420},{"type":393,"tag":427,"props":3430,"children":3431},{"style":439},[3432],{"type":398,"value":540},{"type":393,"tag":427,"props":3434,"children":3435},{"class":429,"line":72},[3436,3441,3445,3450,3454,3459,3463,3468,3472,3477],{"type":393,"tag":427,"props":3437,"children":3438},{"style":493},[3439],{"type":398,"value":3440},"    'target'",{"type":393,"tag":427,"props":3442,"children":3443},{"style":439},[3444],{"type":398,"value":501},{"type":393,"tag":427,"props":3446,"children":3447},{"style":504},[3448],{"type":398,"value":3449},"100000",{"type":393,"tag":427,"props":3451,"children":3452},{"style":439},[3453],{"type":398,"value":512},{"type":393,"tag":427,"props":3455,"children":3456},{"style":504},[3457],{"type":398,"value":3458},"90000",{"type":393,"tag":427,"props":3460,"children":3461},{"style":439},[3462],{"type":398,"value":512},{"type":393,"tag":427,"props":3464,"children":3465},{"style":504},[3466],{"type":398,"value":3467},"110000",{"type":393,"tag":427,"props":3469,"children":3470},{"style":439},[3471],{"type":398,"value":512},{"type":393,"tag":427,"props":3473,"children":3474},{"style":504},[3475],{"type":398,"value":3476},"95000",{"type":393,"tag":427,"props":3478,"children":3479},{"style":439},[3480],{"type":398,"value":637},{"type":393,"tag":427,"props":3482,"children":3483},{"class":429,"line":83},[3484],{"type":393,"tag":427,"props":3485,"children":3486},{"style":439},[3487],{"type":398,"value":645},{"type":393,"tag":427,"props":3489,"children":3490},{"class":429,"line":92},[3491],{"type":393,"tag":427,"props":3492,"children":3493},{"emptyLinePlaceholder":12},[3494],{"type":398,"value":460},{"type":393,"tag":427,"props":3496,"children":3497},{"class":429,"line":101},[3498],{"type":393,"tag":427,"props":3499,"children":3500},{"style":466},[3501],{"type":398,"value":3502},"# Actual sales\n",{"type":393,"tag":427,"props":3504,"children":3505},{"class":429,"line":110},[3506,3511,3515],{"type":393,"tag":427,"props":3507,"children":3508},{"style":439},[3509],{"type":398,"value":3510},"actuals ",{"type":393,"tag":427,"props":3512,"children":3513},{"style":433},[3514],{"type":398,"value":482},{"type":393,"tag":427,"props":3516,"children":3517},{"style":439},[3518],{"type":398,"value":487},{"type":393,"tag":427,"props":3520,"children":3521},{"class":429,"line":121},[3522,3526,3530,3534,3538,3542,3546,3550,3554,3558],{"type":393,"tag":427,"props":3523,"children":3524},{"style":493},[3525],{"type":398,"value":3348},{"type":393,"tag":427,"props":3527,"children":3528},{"style":439},[3529],{"type":398,"value":501},{"type":393,"tag":427,"props":3531,"children":3532},{"style":493},[3533],{"type":398,"value":3357},{"type":393,"tag":427,"props":3535,"children":3536},{"style":439},[3537],{"type":398,"value":512},{"type":393,"tag":427,"props":3539,"children":3540},{"style":493},[3541],{"type":398,"value":3366},{"type":393,"tag":427,"props":3543,"children":3544},{"style":439},[3545],{"type":398,"value":512},{"type":393,"tag":427,"props":3547,"children":3548},{"style":493},[3549],{"type":398,"value":3357},{"type":393,"tag":427,"props":3551,"children":3552},{"style":439},[3553],{"type":398,"value":512},{"type":393,"tag":427,"props":3555,"children":3556},{"style":493},[3557],{"type":398,"value":3366},{"type":393,"tag":427,"props":3559,"children":3560},{"style":439},[3561],{"type":398,"value":540},{"type":393,"tag":427,"props":3563,"children":3564},{"class":429,"line":130},[3565,3569,3573,3577,3581,3585,3589,3593,3597,3601],{"type":393,"tag":427,"props":3566,"children":3567},{"style":493},[3568],{"type":398,"value":3394},{"type":393,"tag":427,"props":3570,"children":3571},{"style":439},[3572],{"type":398,"value":501},{"type":393,"tag":427,"props":3574,"children":3575},{"style":493},[3576],{"type":398,"value":3403},{"type":393,"tag":427,"props":3578,"children":3579},{"style":439},[3580],{"type":398,"value":512},{"type":393,"tag":427,"props":3582,"children":3583},{"style":493},[3584],{"type":398,"value":3403},{"type":393,"tag":427,"props":3586,"children":3587},{"style":439},[3588],{"type":398,"value":512},{"type":393,"tag":427,"props":3590,"children":3591},{"style":493},[3592],{"type":398,"value":3420},{"type":393,"tag":427,"props":3594,"children":3595},{"style":439},[3596],{"type":398,"value":512},{"type":393,"tag":427,"props":3598,"children":3599},{"style":493},[3600],{"type":398,"value":3420},{"type":393,"tag":427,"props":3602,"children":3603},{"style":439},[3604],{"type":398,"value":540},{"type":393,"tag":427,"props":3606,"children":3607},{"class":429,"line":139},[3608,3613,3617,3622,3626,3631,3635,3640,3644,3649],{"type":393,"tag":427,"props":3609,"children":3610},{"style":493},[3611],{"type":398,"value":3612},"    'actual'",{"type":393,"tag":427,"props":3614,"children":3615},{"style":439},[3616],{"type":398,"value":501},{"type":393,"tag":427,"props":3618,"children":3619},{"style":504},[3620],{"type":398,"value":3621},"105000",{"type":393,"tag":427,"props":3623,"children":3624},{"style":439},[3625],{"type":398,"value":512},{"type":393,"tag":427,"props":3627,"children":3628},{"style":504},[3629],{"type":398,"value":3630},"88000",{"type":393,"tag":427,"props":3632,"children":3633},{"style":439},[3634],{"type":398,"value":512},{"type":393,"tag":427,"props":3636,"children":3637},{"style":504},[3638],{"type":398,"value":3639},"115000",{"type":393,"tag":427,"props":3641,"children":3642},{"style":439},[3643],{"type":398,"value":512},{"type":393,"tag":427,"props":3645,"children":3646},{"style":504},[3647],{"type":398,"value":3648},"98000",{"type":393,"tag":427,"props":3650,"children":3651},{"style":439},[3652],{"type":398,"value":637},{"type":393,"tag":427,"props":3654,"children":3655},{"class":429,"line":148},[3656],{"type":393,"tag":427,"props":3657,"children":3658},{"style":439},[3659],{"type":398,"value":645},{"type":393,"tag":427,"props":3661,"children":3662},{"class":429,"line":159},[3663],{"type":393,"tag":427,"props":3664,"children":3665},{"emptyLinePlaceholder":12},[3666],{"type":398,"value":460},{"type":393,"tag":427,"props":3668,"children":3669},{"class":429,"line":168},[3670,3674,3678,3683],{"type":393,"tag":427,"props":3671,"children":3672},{"style":504},[3673],{"type":398,"value":811},{"type":393,"tag":427,"props":3675,"children":3676},{"style":439},[3677],{"type":398,"value":816},{"type":393,"tag":427,"props":3679,"children":3680},{"style":493},[3681],{"type":398,"value":3682},"\"Targets:\"",{"type":393,"tag":427,"props":3684,"children":3685},{"style":439},[3686],{"type":398,"value":826},{"type":393,"tag":427,"props":3688,"children":3689},{"class":429,"line":177},[3690,3694],{"type":393,"tag":427,"props":3691,"children":3692},{"style":504},[3693],{"type":398,"value":811},{"type":393,"tag":427,"props":3695,"children":3696},{"style":439},[3697],{"type":398,"value":3698},"(targets)\n",{"type":393,"tag":427,"props":3700,"children":3701},{"class":429,"line":186},[3702,3706],{"type":393,"tag":427,"props":3703,"children":3704},{"style":504},[3705],{"type":398,"value":811},{"type":393,"tag":427,"props":3707,"children":3708},{"style":439},[3709],{"type":398,"value":850},{"type":393,"tag":427,"props":3711,"children":3712},{"class":429,"line":197},[3713,3717,3721,3726],{"type":393,"tag":427,"props":3714,"children":3715},{"style":504},[3716],{"type":398,"value":811},{"type":393,"tag":427,"props":3718,"children":3719},{"style":439},[3720],{"type":398,"value":816},{"type":393,"tag":427,"props":3722,"children":3723},{"style":493},[3724],{"type":398,"value":3725},"\"Actuals:\"",{"type":393,"tag":427,"props":3727,"children":3728},{"style":439},[3729],{"type":398,"value":826},{"type":393,"tag":427,"props":3731,"children":3732},{"class":429,"line":206},[3733,3737],{"type":393,"tag":427,"props":3734,"children":3735},{"style":504},[3736],{"type":398,"value":811},{"type":393,"tag":427,"props":3738,"children":3739},{"style":439},[3740],{"type":398,"value":3741},"(actuals)\n",{"type":393,"tag":427,"props":3743,"children":3744},{"class":429,"line":215},[3745,3749],{"type":393,"tag":427,"props":3746,"children":3747},{"style":504},[3748],{"type":398,"value":811},{"type":393,"tag":427,"props":3750,"children":3751},{"style":439},[3752],{"type":398,"value":850},{"type":393,"tag":427,"props":3754,"children":3755},{"class":429,"line":224},[3756],{"type":393,"tag":427,"props":3757,"children":3758},{"emptyLinePlaceholder":12},[3759],{"type":398,"value":460},{"type":393,"tag":427,"props":3761,"children":3762},{"class":429,"line":233},[3763],{"type":393,"tag":427,"props":3764,"children":3765},{"style":466},[3766],{"type":398,"value":3767},"# Merge on multiple columns\n",{"type":393,"tag":427,"props":3769,"children":3770},{"class":429,"line":244},[3771,3776,3780,3785,3789,3793,3798,3803,3807,3812],{"type":393,"tag":427,"props":3772,"children":3773},{"style":439},[3774],{"type":398,"value":3775},"performance ",{"type":393,"tag":427,"props":3777,"children":3778},{"style":433},[3779],{"type":398,"value":482},{"type":393,"tag":427,"props":3781,"children":3782},{"style":439},[3783],{"type":398,"value":3784}," targets.merge(actuals, ",{"type":393,"tag":427,"props":3786,"children":3787},{"style":928},[3788],{"type":398,"value":931},{"type":393,"tag":427,"props":3790,"children":3791},{"style":433},[3792],{"type":398,"value":482},{"type":393,"tag":427,"props":3794,"children":3795},{"style":439},[3796],{"type":398,"value":3797},"[",{"type":393,"tag":427,"props":3799,"children":3800},{"style":493},[3801],{"type":398,"value":3802},"'region'",{"type":393,"tag":427,"props":3804,"children":3805},{"style":439},[3806],{"type":398,"value":512},{"type":393,"tag":427,"props":3808,"children":3809},{"style":493},[3810],{"type":398,"value":3811},"'quarter'",{"type":393,"tag":427,"props":3813,"children":3814},{"style":439},[3815],{"type":398,"value":3816},"])\n",{"type":393,"tag":427,"props":3818,"children":3819},{"class":429,"line":253},[3820,3824,3828,3833],{"type":393,"tag":427,"props":3821,"children":3822},{"style":504},[3823],{"type":398,"value":811},{"type":393,"tag":427,"props":3825,"children":3826},{"style":439},[3827],{"type":398,"value":816},{"type":393,"tag":427,"props":3829,"children":3830},{"style":493},[3831],{"type":398,"value":3832},"\"Performance vs targets:\"",{"type":393,"tag":427,"props":3834,"children":3835},{"style":439},[3836],{"type":398,"value":826},{"type":393,"tag":427,"props":3838,"children":3839},{"class":429,"line":262},[3840,3844],{"type":393,"tag":427,"props":3841,"children":3842},{"style":504},[3843],{"type":398,"value":811},{"type":393,"tag":427,"props":3845,"children":3846},{"style":439},[3847],{"type":398,"value":3848},"(performance)\n",{"type":393,"tag":427,"props":3850,"children":3851},{"class":429,"line":271},[3852,3856],{"type":393,"tag":427,"props":3853,"children":3854},{"style":504},[3855],{"type":398,"value":811},{"type":393,"tag":427,"props":3857,"children":3858},{"style":439},[3859],{"type":398,"value":850},{"type":393,"tag":427,"props":3861,"children":3862},{"class":429,"line":281},[3863],{"type":393,"tag":427,"props":3864,"children":3865},{"emptyLinePlaceholder":12},[3866],{"type":398,"value":460},{"type":393,"tag":427,"props":3868,"children":3869},{"class":429,"line":290},[3870],{"type":393,"tag":427,"props":3871,"children":3872},{"style":466},[3873],{"type":398,"value":3874},"# Calculate performance percentage\n",{"type":393,"tag":427,"props":3876,"children":3877},{"class":429,"line":299},[3878,3883,3888,3893,3897,3902,3907,3911,3916,3921,3926,3930,3935,3940,3945,3949],{"type":393,"tag":427,"props":3879,"children":3880},{"style":439},[3881],{"type":398,"value":3882},"performance[",{"type":393,"tag":427,"props":3884,"children":3885},{"style":493},[3886],{"type":398,"value":3887},"'achievement'",{"type":393,"tag":427,"props":3889,"children":3890},{"style":439},[3891],{"type":398,"value":3892},"] ",{"type":393,"tag":427,"props":3894,"children":3895},{"style":433},[3896],{"type":398,"value":482},{"type":393,"tag":427,"props":3898,"children":3899},{"style":439},[3900],{"type":398,"value":3901}," (performance[",{"type":393,"tag":427,"props":3903,"children":3904},{"style":493},[3905],{"type":398,"value":3906},"'actual'",{"type":393,"tag":427,"props":3908,"children":3909},{"style":439},[3910],{"type":398,"value":3892},{"type":393,"tag":427,"props":3912,"children":3913},{"style":433},[3914],{"type":398,"value":3915},"/",{"type":393,"tag":427,"props":3917,"children":3918},{"style":439},[3919],{"type":398,"value":3920}," performance[",{"type":393,"tag":427,"props":3922,"children":3923},{"style":493},[3924],{"type":398,"value":3925},"'target'",{"type":393,"tag":427,"props":3927,"children":3928},{"style":439},[3929],{"type":398,"value":3892},{"type":393,"tag":427,"props":3931,"children":3932},{"style":433},[3933],{"type":398,"value":3934},"*",{"type":393,"tag":427,"props":3936,"children":3937},{"style":504},[3938],{"type":398,"value":3939}," 100",{"type":393,"tag":427,"props":3941,"children":3942},{"style":439},[3943],{"type":398,"value":3944},").round(",{"type":393,"tag":427,"props":3946,"children":3947},{"style":504},[3948],{"type":398,"value":507},{"type":393,"tag":427,"props":3950,"children":3951},{"style":439},[3952],{"type":398,"value":826},{"type":393,"tag":427,"props":3954,"children":3955},{"class":429,"line":308},[3956,3960,3964,3969],{"type":393,"tag":427,"props":3957,"children":3958},{"style":504},[3959],{"type":398,"value":811},{"type":393,"tag":427,"props":3961,"children":3962},{"style":439},[3963],{"type":398,"value":816},{"type":393,"tag":427,"props":3965,"children":3966},{"style":493},[3967],{"type":398,"value":3968},"\"With achievement percentage:\"",{"type":393,"tag":427,"props":3970,"children":3971},{"style":439},[3972],{"type":398,"value":826},{"type":393,"tag":427,"props":3974,"children":3975},{"class":429,"line":318},[3976,3980],{"type":393,"tag":427,"props":3977,"children":3978},{"style":504},[3979],{"type":398,"value":811},{"type":393,"tag":427,"props":3981,"children":3982},{"style":439},[3983],{"type":398,"value":3848},{"type":393,"tag":978,"props":3985,"children":3987},{"id":3986},"handling-duplicate-column-names",[3988],{"type":398,"value":3989},"🔧 Handling Duplicate Column Names",{"type":393,"tag":401,"props":3991,"children":3992},{},[3993],{"type":398,"value":3994},"When both DataFrames have columns with the same name (other than join keys):",{"type":393,"tag":990,"props":3996,"children":4000},{"emoji":3997,"title":3998,"type":3999},"⚠️","Column Name Conflicts","warning",[4001,4009,4036,4044,4071,4079],{"type":393,"tag":401,"props":4002,"children":4003},{},[4004],{"type":393,"tag":1000,"props":4005,"children":4006},{},[4007],{"type":398,"value":4008},"Default Behavior:",{"type":393,"tag":1006,"props":4010,"children":4011},{},[4012,4031],{"type":393,"tag":1010,"props":4013,"children":4014},{},[4015,4017,4023,4025],{"type":398,"value":4016},"Pandas adds suffixes: ",{"type":393,"tag":423,"props":4018,"children":4020},{"className":4019},[],[4021],{"type":398,"value":4022},"_x",{"type":398,"value":4024}," and ",{"type":393,"tag":423,"props":4026,"children":4028},{"className":4027},[],[4029],{"type":398,"value":4030},"_y",{"type":393,"tag":1010,"props":4032,"children":4033},{},[4034],{"type":398,"value":4035},"Can be confusing and unclear",{"type":393,"tag":401,"props":4037,"children":4038},{},[4039],{"type":393,"tag":1000,"props":4040,"children":4041},{},[4042],{"type":398,"value":4043},"Better Approach:",{"type":393,"tag":1006,"props":4045,"children":4046},{},[4047,4060],{"type":393,"tag":1010,"props":4048,"children":4049},{},[4050,4052,4058],{"type":398,"value":4051},"Use ",{"type":393,"tag":423,"props":4053,"children":4055},{"className":4054},[],[4056],{"type":398,"value":4057},"suffixes",{"type":398,"value":4059}," parameter to choose meaningful names",{"type":393,"tag":1010,"props":4061,"children":4062},{},[4063,4065],{"type":398,"value":4064},"Example: ",{"type":393,"tag":423,"props":4066,"children":4068},{"className":4067},[],[4069],{"type":398,"value":4070},"suffixes=('_budget', '_actual')",{"type":393,"tag":401,"props":4072,"children":4073},{},[4074],{"type":393,"tag":1000,"props":4075,"children":4076},{},[4077],{"type":398,"value":4078},"Best Practice:",{"type":393,"tag":1006,"props":4080,"children":4081},{},[4082,4087,4092],{"type":393,"tag":1010,"props":4083,"children":4084},{},[4085],{"type":398,"value":4086},"Rename columns before merging when possible",{"type":393,"tag":1010,"props":4088,"children":4089},{},[4090],{"type":398,"value":4091},"Use descriptive suffixes",{"type":393,"tag":1010,"props":4093,"children":4094},{},[4095],{"type":398,"value":4096},"Document which suffix means what",{"type":393,"tag":412,"props":4098,"children":4099},{},[4100],{"type":393,"tag":416,"props":4101,"children":4103},{"className":418,"code":4102,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Budget data\nbudget = pd.DataFrame({\n    'department': ['Sales', 'IT', 'HR'],\n    'amount': [50000, 30000, 25000]\n})\n\n# Actual spending\nactual = pd.DataFrame({\n    'department': ['Sales', 'IT', 'HR'],\n    'amount': [52000, 28000, 26000]\n})\n\nprint(\"Budget:\")\nprint(budget)\nprint()\nprint(\"Actual:\")\nprint(actual)\nprint()\n\n# Merge with custom suffixes\nbudget_vs_actual = budget.merge(actual, \n                               on='department', \n                               suffixes=('_budget', '_actual'))\nprint(\"Budget vs actual spending:\")\nprint(budget_vs_actual)\nprint()\n\n# Calculate variance\nbudget_vs_actual['variance'] = budget_vs_actual['amount_actual'] - budget_vs_actual['amount_budget']\nprint(\"With variance:\")\nprint(budget_vs_actual)\n",[4104],{"type":393,"tag":423,"props":4105,"children":4106},{"__ignoreMap":6},[4107,4126,4133,4141,4157,4192,4229,4236,4243,4251,4267,4302,4340,4347,4354,4374,4386,4397,4417,4429,4440,4447,4455,4472,4493,4528,4548,4560,4571,4578,4586,4639,4659],{"type":393,"tag":427,"props":4108,"children":4109},{"class":429,"line":11},[4110,4114,4118,4122],{"type":393,"tag":427,"props":4111,"children":4112},{"style":433},[4113],{"type":398,"value":436},{"type":393,"tag":427,"props":4115,"children":4116},{"style":439},[4117],{"type":398,"value":442},{"type":393,"tag":427,"props":4119,"children":4120},{"style":433},[4121],{"type":398,"value":447},{"type":393,"tag":427,"props":4123,"children":4124},{"style":439},[4125],{"type":398,"value":452},{"type":393,"tag":427,"props":4127,"children":4128},{"class":429,"line":27},[4129],{"type":393,"tag":427,"props":4130,"children":4131},{"emptyLinePlaceholder":12},[4132],{"type":398,"value":460},{"type":393,"tag":427,"props":4134,"children":4135},{"class":429,"line":36},[4136],{"type":393,"tag":427,"props":4137,"children":4138},{"style":466},[4139],{"type":398,"value":4140},"# Budget data\n",{"type":393,"tag":427,"props":4142,"children":4143},{"class":429,"line":45},[4144,4149,4153],{"type":393,"tag":427,"props":4145,"children":4146},{"style":439},[4147],{"type":398,"value":4148},"budget ",{"type":393,"tag":427,"props":4150,"children":4151},{"style":433},[4152],{"type":398,"value":482},{"type":393,"tag":427,"props":4154,"children":4155},{"style":439},[4156],{"type":398,"value":487},{"type":393,"tag":427,"props":4158,"children":4159},{"class":429,"line":54},[4160,4164,4168,4172,4176,4180,4184,4188],{"type":393,"tag":427,"props":4161,"children":4162},{"style":493},[4163],{"type":398,"value":2879},{"type":393,"tag":427,"props":4165,"children":4166},{"style":439},[4167],{"type":398,"value":501},{"type":393,"tag":427,"props":4169,"children":4170},{"style":493},[4171],{"type":398,"value":2888},{"type":393,"tag":427,"props":4173,"children":4174},{"style":439},[4175],{"type":398,"value":512},{"type":393,"tag":427,"props":4177,"children":4178},{"style":493},[4179],{"type":398,"value":2897},{"type":393,"tag":427,"props":4181,"children":4182},{"style":439},[4183],{"type":398,"value":512},{"type":393,"tag":427,"props":4185,"children":4186},{"style":493},[4187],{"type":398,"value":2906},{"type":393,"tag":427,"props":4189,"children":4190},{"style":439},[4191],{"type":398,"value":540},{"type":393,"tag":427,"props":4193,"children":4194},{"class":429,"line":63},[4195,4199,4203,4207,4211,4216,4220,4225],{"type":393,"tag":427,"props":4196,"children":4197},{"style":493},[4198],{"type":398,"value":758},{"type":393,"tag":427,"props":4200,"children":4201},{"style":439},[4202],{"type":398,"value":501},{"type":393,"tag":427,"props":4204,"children":4205},{"style":504},[4206],{"type":398,"value":3001},{"type":393,"tag":427,"props":4208,"children":4209},{"style":439},[4210],{"type":398,"value":512},{"type":393,"tag":427,"props":4212,"children":4213},{"style":504},[4214],{"type":398,"value":4215},"30000",{"type":393,"tag":427,"props":4217,"children":4218},{"style":439},[4219],{"type":398,"value":512},{"type":393,"tag":427,"props":4221,"children":4222},{"style":504},[4223],{"type":398,"value":4224},"25000",{"type":393,"tag":427,"props":4226,"children":4227},{"style":439},[4228],{"type":398,"value":637},{"type":393,"tag":427,"props":4230,"children":4231},{"class":429,"line":72},[4232],{"type":393,"tag":427,"props":4233,"children":4234},{"style":439},[4235],{"type":398,"value":645},{"type":393,"tag":427,"props":4237,"children":4238},{"class":429,"line":83},[4239],{"type":393,"tag":427,"props":4240,"children":4241},{"emptyLinePlaceholder":12},[4242],{"type":398,"value":460},{"type":393,"tag":427,"props":4244,"children":4245},{"class":429,"line":92},[4246],{"type":393,"tag":427,"props":4247,"children":4248},{"style":466},[4249],{"type":398,"value":4250},"# Actual spending\n",{"type":393,"tag":427,"props":4252,"children":4253},{"class":429,"line":101},[4254,4259,4263],{"type":393,"tag":427,"props":4255,"children":4256},{"style":439},[4257],{"type":398,"value":4258},"actual ",{"type":393,"tag":427,"props":4260,"children":4261},{"style":433},[4262],{"type":398,"value":482},{"type":393,"tag":427,"props":4264,"children":4265},{"style":439},[4266],{"type":398,"value":487},{"type":393,"tag":427,"props":4268,"children":4269},{"class":429,"line":110},[4270,4274,4278,4282,4286,4290,4294,4298],{"type":393,"tag":427,"props":4271,"children":4272},{"style":493},[4273],{"type":398,"value":2879},{"type":393,"tag":427,"props":4275,"children":4276},{"style":439},[4277],{"type":398,"value":501},{"type":393,"tag":427,"props":4279,"children":4280},{"style":493},[4281],{"type":398,"value":2888},{"type":393,"tag":427,"props":4283,"children":4284},{"style":439},[4285],{"type":398,"value":512},{"type":393,"tag":427,"props":4287,"children":4288},{"style":493},[4289],{"type":398,"value":2897},{"type":393,"tag":427,"props":4291,"children":4292},{"style":439},[4293],{"type":398,"value":512},{"type":393,"tag":427,"props":4295,"children":4296},{"style":493},[4297],{"type":398,"value":2906},{"type":393,"tag":427,"props":4299,"children":4300},{"style":439},[4301],{"type":398,"value":540},{"type":393,"tag":427,"props":4303,"children":4304},{"class":429,"line":121},[4305,4309,4313,4318,4322,4327,4331,4336],{"type":393,"tag":427,"props":4306,"children":4307},{"style":493},[4308],{"type":398,"value":758},{"type":393,"tag":427,"props":4310,"children":4311},{"style":439},[4312],{"type":398,"value":501},{"type":393,"tag":427,"props":4314,"children":4315},{"style":504},[4316],{"type":398,"value":4317},"52000",{"type":393,"tag":427,"props":4319,"children":4320},{"style":439},[4321],{"type":398,"value":512},{"type":393,"tag":427,"props":4323,"children":4324},{"style":504},[4325],{"type":398,"value":4326},"28000",{"type":393,"tag":427,"props":4328,"children":4329},{"style":439},[4330],{"type":398,"value":512},{"type":393,"tag":427,"props":4332,"children":4333},{"style":504},[4334],{"type":398,"value":4335},"26000",{"type":393,"tag":427,"props":4337,"children":4338},{"style":439},[4339],{"type":398,"value":637},{"type":393,"tag":427,"props":4341,"children":4342},{"class":429,"line":130},[4343],{"type":393,"tag":427,"props":4344,"children":4345},{"style":439},[4346],{"type":398,"value":645},{"type":393,"tag":427,"props":4348,"children":4349},{"class":429,"line":139},[4350],{"type":393,"tag":427,"props":4351,"children":4352},{"emptyLinePlaceholder":12},[4353],{"type":398,"value":460},{"type":393,"tag":427,"props":4355,"children":4356},{"class":429,"line":148},[4357,4361,4365,4370],{"type":393,"tag":427,"props":4358,"children":4359},{"style":504},[4360],{"type":398,"value":811},{"type":393,"tag":427,"props":4362,"children":4363},{"style":439},[4364],{"type":398,"value":816},{"type":393,"tag":427,"props":4366,"children":4367},{"style":493},[4368],{"type":398,"value":4369},"\"Budget:\"",{"type":393,"tag":427,"props":4371,"children":4372},{"style":439},[4373],{"type":398,"value":826},{"type":393,"tag":427,"props":4375,"children":4376},{"class":429,"line":159},[4377,4381],{"type":393,"tag":427,"props":4378,"children":4379},{"style":504},[4380],{"type":398,"value":811},{"type":393,"tag":427,"props":4382,"children":4383},{"style":439},[4384],{"type":398,"value":4385},"(budget)\n",{"type":393,"tag":427,"props":4387,"children":4388},{"class":429,"line":168},[4389,4393],{"type":393,"tag":427,"props":4390,"children":4391},{"style":504},[4392],{"type":398,"value":811},{"type":393,"tag":427,"props":4394,"children":4395},{"style":439},[4396],{"type":398,"value":850},{"type":393,"tag":427,"props":4398,"children":4399},{"class":429,"line":177},[4400,4404,4408,4413],{"type":393,"tag":427,"props":4401,"children":4402},{"style":504},[4403],{"type":398,"value":811},{"type":393,"tag":427,"props":4405,"children":4406},{"style":439},[4407],{"type":398,"value":816},{"type":393,"tag":427,"props":4409,"children":4410},{"style":493},[4411],{"type":398,"value":4412},"\"Actual:\"",{"type":393,"tag":427,"props":4414,"children":4415},{"style":439},[4416],{"type":398,"value":826},{"type":393,"tag":427,"props":4418,"children":4419},{"class":429,"line":186},[4420,4424],{"type":393,"tag":427,"props":4421,"children":4422},{"style":504},[4423],{"type":398,"value":811},{"type":393,"tag":427,"props":4425,"children":4426},{"style":439},[4427],{"type":398,"value":4428},"(actual)\n",{"type":393,"tag":427,"props":4430,"children":4431},{"class":429,"line":197},[4432,4436],{"type":393,"tag":427,"props":4433,"children":4434},{"style":504},[4435],{"type":398,"value":811},{"type":393,"tag":427,"props":4437,"children":4438},{"style":439},[4439],{"type":398,"value":850},{"type":393,"tag":427,"props":4441,"children":4442},{"class":429,"line":206},[4443],{"type":393,"tag":427,"props":4444,"children":4445},{"emptyLinePlaceholder":12},[4446],{"type":398,"value":460},{"type":393,"tag":427,"props":4448,"children":4449},{"class":429,"line":215},[4450],{"type":393,"tag":427,"props":4451,"children":4452},{"style":466},[4453],{"type":398,"value":4454},"# Merge with custom suffixes\n",{"type":393,"tag":427,"props":4456,"children":4457},{"class":429,"line":224},[4458,4463,4467],{"type":393,"tag":427,"props":4459,"children":4460},{"style":439},[4461],{"type":398,"value":4462},"budget_vs_actual ",{"type":393,"tag":427,"props":4464,"children":4465},{"style":433},[4466],{"type":398,"value":482},{"type":393,"tag":427,"props":4468,"children":4469},{"style":439},[4470],{"type":398,"value":4471}," budget.merge(actual, \n",{"type":393,"tag":427,"props":4473,"children":4474},{"class":429,"line":233},[4475,4480,4484,4489],{"type":393,"tag":427,"props":4476,"children":4477},{"style":928},[4478],{"type":398,"value":4479},"                               on",{"type":393,"tag":427,"props":4481,"children":4482},{"style":433},[4483],{"type":398,"value":482},{"type":393,"tag":427,"props":4485,"children":4486},{"style":493},[4487],{"type":398,"value":4488},"'department'",{"type":393,"tag":427,"props":4490,"children":4491},{"style":439},[4492],{"type":398,"value":3216},{"type":393,"tag":427,"props":4494,"children":4495},{"class":429,"line":244},[4496,4501,4505,4509,4514,4518,4523],{"type":393,"tag":427,"props":4497,"children":4498},{"style":928},[4499],{"type":398,"value":4500},"                               suffixes",{"type":393,"tag":427,"props":4502,"children":4503},{"style":433},[4504],{"type":398,"value":482},{"type":393,"tag":427,"props":4506,"children":4507},{"style":439},[4508],{"type":398,"value":816},{"type":393,"tag":427,"props":4510,"children":4511},{"style":493},[4512],{"type":398,"value":4513},"'_budget'",{"type":393,"tag":427,"props":4515,"children":4516},{"style":439},[4517],{"type":398,"value":512},{"type":393,"tag":427,"props":4519,"children":4520},{"style":493},[4521],{"type":398,"value":4522},"'_actual'",{"type":393,"tag":427,"props":4524,"children":4525},{"style":439},[4526],{"type":398,"value":4527},"))\n",{"type":393,"tag":427,"props":4529,"children":4530},{"class":429,"line":253},[4531,4535,4539,4544],{"type":393,"tag":427,"props":4532,"children":4533},{"style":504},[4534],{"type":398,"value":811},{"type":393,"tag":427,"props":4536,"children":4537},{"style":439},[4538],{"type":398,"value":816},{"type":393,"tag":427,"props":4540,"children":4541},{"style":493},[4542],{"type":398,"value":4543},"\"Budget vs actual spending:\"",{"type":393,"tag":427,"props":4545,"children":4546},{"style":439},[4547],{"type":398,"value":826},{"type":393,"tag":427,"props":4549,"children":4550},{"class":429,"line":262},[4551,4555],{"type":393,"tag":427,"props":4552,"children":4553},{"style":504},[4554],{"type":398,"value":811},{"type":393,"tag":427,"props":4556,"children":4557},{"style":439},[4558],{"type":398,"value":4559},"(budget_vs_actual)\n",{"type":393,"tag":427,"props":4561,"children":4562},{"class":429,"line":271},[4563,4567],{"type":393,"tag":427,"props":4564,"children":4565},{"style":504},[4566],{"type":398,"value":811},{"type":393,"tag":427,"props":4568,"children":4569},{"style":439},[4570],{"type":398,"value":850},{"type":393,"tag":427,"props":4572,"children":4573},{"class":429,"line":281},[4574],{"type":393,"tag":427,"props":4575,"children":4576},{"emptyLinePlaceholder":12},[4577],{"type":398,"value":460},{"type":393,"tag":427,"props":4579,"children":4580},{"class":429,"line":290},[4581],{"type":393,"tag":427,"props":4582,"children":4583},{"style":466},[4584],{"type":398,"value":4585},"# Calculate variance\n",{"type":393,"tag":427,"props":4587,"children":4588},{"class":429,"line":299},[4589,4594,4599,4603,4607,4612,4617,4621,4626,4630,4635],{"type":393,"tag":427,"props":4590,"children":4591},{"style":439},[4592],{"type":398,"value":4593},"budget_vs_actual[",{"type":393,"tag":427,"props":4595,"children":4596},{"style":493},[4597],{"type":398,"value":4598},"'variance'",{"type":393,"tag":427,"props":4600,"children":4601},{"style":439},[4602],{"type":398,"value":3892},{"type":393,"tag":427,"props":4604,"children":4605},{"style":433},[4606],{"type":398,"value":482},{"type":393,"tag":427,"props":4608,"children":4609},{"style":439},[4610],{"type":398,"value":4611}," budget_vs_actual[",{"type":393,"tag":427,"props":4613,"children":4614},{"style":493},[4615],{"type":398,"value":4616},"'amount_actual'",{"type":393,"tag":427,"props":4618,"children":4619},{"style":439},[4620],{"type":398,"value":3892},{"type":393,"tag":427,"props":4622,"children":4623},{"style":433},[4624],{"type":398,"value":4625},"-",{"type":393,"tag":427,"props":4627,"children":4628},{"style":439},[4629],{"type":398,"value":4611},{"type":393,"tag":427,"props":4631,"children":4632},{"style":493},[4633],{"type":398,"value":4634},"'amount_budget'",{"type":393,"tag":427,"props":4636,"children":4637},{"style":439},[4638],{"type":398,"value":637},{"type":393,"tag":427,"props":4640,"children":4641},{"class":429,"line":308},[4642,4646,4650,4655],{"type":393,"tag":427,"props":4643,"children":4644},{"style":504},[4645],{"type":398,"value":811},{"type":393,"tag":427,"props":4647,"children":4648},{"style":439},[4649],{"type":398,"value":816},{"type":393,"tag":427,"props":4651,"children":4652},{"style":493},[4653],{"type":398,"value":4654},"\"With variance:\"",{"type":393,"tag":427,"props":4656,"children":4657},{"style":439},[4658],{"type":398,"value":826},{"type":393,"tag":427,"props":4660,"children":4661},{"class":429,"line":318},[4662,4666],{"type":393,"tag":427,"props":4663,"children":4664},{"style":504},[4665],{"type":398,"value":811},{"type":393,"tag":427,"props":4667,"children":4668},{"style":439},[4669],{"type":398,"value":4559},{"type":393,"tag":978,"props":4671,"children":4673},{"id":4672},"real-world-example-customer-analysis",[4674],{"type":398,"value":4675},"📈 Real-World Example: Customer Analysis",{"type":393,"tag":401,"props":4677,"children":4678},{},[4679],{"type":398,"value":4680},"Let's combine multiple data sources for comprehensive customer analysis:",{"type":393,"tag":412,"props":4682,"children":4683},{},[4684],{"type":393,"tag":416,"props":4685,"children":4687},{"className":418,"code":4686,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Customer demographics\ndemographics = pd.DataFrame({\n    'customer_id': [1, 2, 3, 4, 5],\n    'age_group': ['25-34', '35-44', '18-24', '45-54', '25-34'],\n    'region': ['North', 'South', 'East', 'West', 'North']\n})\n\n# Purchase history\npurchases = pd.DataFrame({\n    'customer_id': [1, 1, 2, 3, 4],\n    'purchase_amount': [250, 150, 300, 75, 500],\n    'product_category': ['Electronics', 'Books', 'Clothing', 'Books', 'Electronics']\n})\n\n# Customer service interactions\nservice = pd.DataFrame({\n    'customer_id': [1, 2, 4],\n    'satisfaction_score': [4.5, 3.8, 4.9],\n    'support_tickets': [1, 3, 0]\n})\n\nprint(\"Demographics:\")\nprint(demographics)\nprint()\nprint(\"Purchases:\")\nprint(purchases)\nprint()\nprint(\"Service interactions:\")\nprint(service)\nprint()\n\n# Step 1: Merge purchases with demographics\npurchase_demo = purchases.merge(demographics, on='customer_id', how='left')\nprint(\"Purchases with demographics:\")\nprint(purchase_demo)\nprint()\n\n# Step 2: Add service data (left join to keep all purchase records)\ncomplete_analysis = purchase_demo.merge(service, on='customer_id', how='left')\nprint(\"Complete customer analysis:\")\nprint(complete_analysis)\nprint()\n\n# Quick analysis: Average purchase by region\nregional_avg = complete_analysis.groupby('region')['purchase_amount'].mean()\nprint(\"Average purchase amount by region:\")\nprint(regional_avg.round(2))\n",[4688],{"type":393,"tag":423,"props":4689,"children":4690},{"__ignoreMap":6},[4691,4710,4717,4725,4741,4792,4848,4901,4908,4915,4923,4939,4990,5044,5098,5105,5112,5120,5136,5171,5210,5247,5254,5261,5281,5293,5304,5324,5336,5347,5367,5379,5390,5397,5405,5454,5474,5486,5497,5504,5512,5562,5583,5596,5608,5616,5625,5662,5683],{"type":393,"tag":427,"props":4692,"children":4693},{"class":429,"line":11},[4694,4698,4702,4706],{"type":393,"tag":427,"props":4695,"children":4696},{"style":433},[4697],{"type":398,"value":436},{"type":393,"tag":427,"props":4699,"children":4700},{"style":439},[4701],{"type":398,"value":442},{"type":393,"tag":427,"props":4703,"children":4704},{"style":433},[4705],{"type":398,"value":447},{"type":393,"tag":427,"props":4707,"children":4708},{"style":439},[4709],{"type":398,"value":452},{"type":393,"tag":427,"props":4711,"children":4712},{"class":429,"line":27},[4713],{"type":393,"tag":427,"props":4714,"children":4715},{"emptyLinePlaceholder":12},[4716],{"type":398,"value":460},{"type":393,"tag":427,"props":4718,"children":4719},{"class":429,"line":36},[4720],{"type":393,"tag":427,"props":4721,"children":4722},{"style":466},[4723],{"type":398,"value":4724},"# Customer demographics\n",{"type":393,"tag":427,"props":4726,"children":4727},{"class":429,"line":45},[4728,4733,4737],{"type":393,"tag":427,"props":4729,"children":4730},{"style":439},[4731],{"type":398,"value":4732},"demographics ",{"type":393,"tag":427,"props":4734,"children":4735},{"style":433},[4736],{"type":398,"value":482},{"type":393,"tag":427,"props":4738,"children":4739},{"style":439},[4740],{"type":398,"value":487},{"type":393,"tag":427,"props":4742,"children":4743},{"class":429,"line":54},[4744,4748,4752,4756,4760,4764,4768,4772,4776,4780,4784,4788],{"type":393,"tag":427,"props":4745,"children":4746},{"style":493},[4747],{"type":398,"value":496},{"type":393,"tag":427,"props":4749,"children":4750},{"style":439},[4751],{"type":398,"value":501},{"type":393,"tag":427,"props":4753,"children":4754},{"style":504},[4755],{"type":398,"value":507},{"type":393,"tag":427,"props":4757,"children":4758},{"style":439},[4759],{"type":398,"value":512},{"type":393,"tag":427,"props":4761,"children":4762},{"style":504},[4763],{"type":398,"value":517},{"type":393,"tag":427,"props":4765,"children":4766},{"style":439},[4767],{"type":398,"value":512},{"type":393,"tag":427,"props":4769,"children":4770},{"style":504},[4771],{"type":398,"value":526},{"type":393,"tag":427,"props":4773,"children":4774},{"style":439},[4775],{"type":398,"value":512},{"type":393,"tag":427,"props":4777,"children":4778},{"style":504},[4779],{"type":398,"value":535},{"type":393,"tag":427,"props":4781,"children":4782},{"style":439},[4783],{"type":398,"value":512},{"type":393,"tag":427,"props":4785,"children":4786},{"style":504},[4787],{"type":398,"value":1557},{"type":393,"tag":427,"props":4789,"children":4790},{"style":439},[4791],{"type":398,"value":540},{"type":393,"tag":427,"props":4793,"children":4794},{"class":429,"line":63},[4795,4800,4804,4809,4813,4818,4822,4827,4831,4836,4840,4844],{"type":393,"tag":427,"props":4796,"children":4797},{"style":493},[4798],{"type":398,"value":4799},"    'age_group'",{"type":393,"tag":427,"props":4801,"children":4802},{"style":439},[4803],{"type":398,"value":501},{"type":393,"tag":427,"props":4805,"children":4806},{"style":493},[4807],{"type":398,"value":4808},"'25-34'",{"type":393,"tag":427,"props":4810,"children":4811},{"style":439},[4812],{"type":398,"value":512},{"type":393,"tag":427,"props":4814,"children":4815},{"style":493},[4816],{"type":398,"value":4817},"'35-44'",{"type":393,"tag":427,"props":4819,"children":4820},{"style":439},[4821],{"type":398,"value":512},{"type":393,"tag":427,"props":4823,"children":4824},{"style":493},[4825],{"type":398,"value":4826},"'18-24'",{"type":393,"tag":427,"props":4828,"children":4829},{"style":439},[4830],{"type":398,"value":512},{"type":393,"tag":427,"props":4832,"children":4833},{"style":493},[4834],{"type":398,"value":4835},"'45-54'",{"type":393,"tag":427,"props":4837,"children":4838},{"style":439},[4839],{"type":398,"value":512},{"type":393,"tag":427,"props":4841,"children":4842},{"style":493},[4843],{"type":398,"value":4808},{"type":393,"tag":427,"props":4845,"children":4846},{"style":439},[4847],{"type":398,"value":540},{"type":393,"tag":427,"props":4849,"children":4850},{"class":429,"line":72},[4851,4855,4859,4863,4867,4871,4875,4880,4884,4889,4893,4897],{"type":393,"tag":427,"props":4852,"children":4853},{"style":493},[4854],{"type":398,"value":3348},{"type":393,"tag":427,"props":4856,"children":4857},{"style":439},[4858],{"type":398,"value":501},{"type":393,"tag":427,"props":4860,"children":4861},{"style":493},[4862],{"type":398,"value":3357},{"type":393,"tag":427,"props":4864,"children":4865},{"style":439},[4866],{"type":398,"value":512},{"type":393,"tag":427,"props":4868,"children":4869},{"style":493},[4870],{"type":398,"value":3366},{"type":393,"tag":427,"props":4872,"children":4873},{"style":439},[4874],{"type":398,"value":512},{"type":393,"tag":427,"props":4876,"children":4877},{"style":493},[4878],{"type":398,"value":4879},"'East'",{"type":393,"tag":427,"props":4881,"children":4882},{"style":439},[4883],{"type":398,"value":512},{"type":393,"tag":427,"props":4885,"children":4886},{"style":493},[4887],{"type":398,"value":4888},"'West'",{"type":393,"tag":427,"props":4890,"children":4891},{"style":439},[4892],{"type":398,"value":512},{"type":393,"tag":427,"props":4894,"children":4895},{"style":493},[4896],{"type":398,"value":3357},{"type":393,"tag":427,"props":4898,"children":4899},{"style":439},[4900],{"type":398,"value":637},{"type":393,"tag":427,"props":4902,"children":4903},{"class":429,"line":83},[4904],{"type":393,"tag":427,"props":4905,"children":4906},{"style":439},[4907],{"type":398,"value":645},{"type":393,"tag":427,"props":4909,"children":4910},{"class":429,"line":92},[4911],{"type":393,"tag":427,"props":4912,"children":4913},{"emptyLinePlaceholder":12},[4914],{"type":398,"value":460},{"type":393,"tag":427,"props":4916,"children":4917},{"class":429,"line":101},[4918],{"type":393,"tag":427,"props":4919,"children":4920},{"style":466},[4921],{"type":398,"value":4922},"# Purchase history\n",{"type":393,"tag":427,"props":4924,"children":4925},{"class":429,"line":110},[4926,4931,4935],{"type":393,"tag":427,"props":4927,"children":4928},{"style":439},[4929],{"type":398,"value":4930},"purchases ",{"type":393,"tag":427,"props":4932,"children":4933},{"style":433},[4934],{"type":398,"value":482},{"type":393,"tag":427,"props":4936,"children":4937},{"style":439},[4938],{"type":398,"value":487},{"type":393,"tag":427,"props":4940,"children":4941},{"class":429,"line":121},[4942,4946,4950,4954,4958,4962,4966,4970,4974,4978,4982,4986],{"type":393,"tag":427,"props":4943,"children":4944},{"style":493},[4945],{"type":398,"value":496},{"type":393,"tag":427,"props":4947,"children":4948},{"style":439},[4949],{"type":398,"value":501},{"type":393,"tag":427,"props":4951,"children":4952},{"style":504},[4953],{"type":398,"value":507},{"type":393,"tag":427,"props":4955,"children":4956},{"style":439},[4957],{"type":398,"value":512},{"type":393,"tag":427,"props":4959,"children":4960},{"style":504},[4961],{"type":398,"value":507},{"type":393,"tag":427,"props":4963,"children":4964},{"style":439},[4965],{"type":398,"value":512},{"type":393,"tag":427,"props":4967,"children":4968},{"style":504},[4969],{"type":398,"value":517},{"type":393,"tag":427,"props":4971,"children":4972},{"style":439},[4973],{"type":398,"value":512},{"type":393,"tag":427,"props":4975,"children":4976},{"style":504},[4977],{"type":398,"value":526},{"type":393,"tag":427,"props":4979,"children":4980},{"style":439},[4981],{"type":398,"value":512},{"type":393,"tag":427,"props":4983,"children":4984},{"style":504},[4985],{"type":398,"value":535},{"type":393,"tag":427,"props":4987,"children":4988},{"style":439},[4989],{"type":398,"value":540},{"type":393,"tag":427,"props":4991,"children":4992},{"class":429,"line":130},[4993,4998,5002,5006,5010,5014,5018,5022,5026,5031,5035,5040],{"type":393,"tag":427,"props":4994,"children":4995},{"style":493},[4996],{"type":398,"value":4997},"    'purchase_amount'",{"type":393,"tag":427,"props":4999,"children":5000},{"style":439},[5001],{"type":398,"value":501},{"type":393,"tag":427,"props":5003,"children":5004},{"style":504},[5005],{"type":398,"value":767},{"type":393,"tag":427,"props":5007,"children":5008},{"style":439},[5009],{"type":398,"value":512},{"type":393,"tag":427,"props":5011,"children":5012},{"style":504},[5013],{"type":398,"value":776},{"type":393,"tag":427,"props":5015,"children":5016},{"style":439},[5017],{"type":398,"value":512},{"type":393,"tag":427,"props":5019,"children":5020},{"style":504},[5021],{"type":398,"value":785},{"type":393,"tag":427,"props":5023,"children":5024},{"style":439},[5025],{"type":398,"value":512},{"type":393,"tag":427,"props":5027,"children":5028},{"style":504},[5029],{"type":398,"value":5030},"75",{"type":393,"tag":427,"props":5032,"children":5033},{"style":439},[5034],{"type":398,"value":512},{"type":393,"tag":427,"props":5036,"children":5037},{"style":504},[5038],{"type":398,"value":5039},"500",{"type":393,"tag":427,"props":5041,"children":5042},{"style":439},[5043],{"type":398,"value":540},{"type":393,"tag":427,"props":5045,"children":5046},{"class":429,"line":139},[5047,5052,5056,5060,5064,5069,5073,5078,5082,5086,5090,5094],{"type":393,"tag":427,"props":5048,"children":5049},{"style":493},[5050],{"type":398,"value":5051},"    'product_category'",{"type":393,"tag":427,"props":5053,"children":5054},{"style":439},[5055],{"type":398,"value":501},{"type":393,"tag":427,"props":5057,"children":5058},{"style":493},[5059],{"type":398,"value":1422},{"type":393,"tag":427,"props":5061,"children":5062},{"style":439},[5063],{"type":398,"value":512},{"type":393,"tag":427,"props":5065,"children":5066},{"style":493},[5067],{"type":398,"value":5068},"'Books'",{"type":393,"tag":427,"props":5070,"children":5071},{"style":439},[5072],{"type":398,"value":512},{"type":393,"tag":427,"props":5074,"children":5075},{"style":493},[5076],{"type":398,"value":5077},"'Clothing'",{"type":393,"tag":427,"props":5079,"children":5080},{"style":439},[5081],{"type":398,"value":512},{"type":393,"tag":427,"props":5083,"children":5084},{"style":493},[5085],{"type":398,"value":5068},{"type":393,"tag":427,"props":5087,"children":5088},{"style":439},[5089],{"type":398,"value":512},{"type":393,"tag":427,"props":5091,"children":5092},{"style":493},[5093],{"type":398,"value":1422},{"type":393,"tag":427,"props":5095,"children":5096},{"style":439},[5097],{"type":398,"value":637},{"type":393,"tag":427,"props":5099,"children":5100},{"class":429,"line":148},[5101],{"type":393,"tag":427,"props":5102,"children":5103},{"style":439},[5104],{"type":398,"value":645},{"type":393,"tag":427,"props":5106,"children":5107},{"class":429,"line":159},[5108],{"type":393,"tag":427,"props":5109,"children":5110},{"emptyLinePlaceholder":12},[5111],{"type":398,"value":460},{"type":393,"tag":427,"props":5113,"children":5114},{"class":429,"line":168},[5115],{"type":393,"tag":427,"props":5116,"children":5117},{"style":466},[5118],{"type":398,"value":5119},"# Customer service interactions\n",{"type":393,"tag":427,"props":5121,"children":5122},{"class":429,"line":177},[5123,5128,5132],{"type":393,"tag":427,"props":5124,"children":5125},{"style":439},[5126],{"type":398,"value":5127},"service ",{"type":393,"tag":427,"props":5129,"children":5130},{"style":433},[5131],{"type":398,"value":482},{"type":393,"tag":427,"props":5133,"children":5134},{"style":439},[5135],{"type":398,"value":487},{"type":393,"tag":427,"props":5137,"children":5138},{"class":429,"line":186},[5139,5143,5147,5151,5155,5159,5163,5167],{"type":393,"tag":427,"props":5140,"children":5141},{"style":493},[5142],{"type":398,"value":496},{"type":393,"tag":427,"props":5144,"children":5145},{"style":439},[5146],{"type":398,"value":501},{"type":393,"tag":427,"props":5148,"children":5149},{"style":504},[5150],{"type":398,"value":507},{"type":393,"tag":427,"props":5152,"children":5153},{"style":439},[5154],{"type":398,"value":512},{"type":393,"tag":427,"props":5156,"children":5157},{"style":504},[5158],{"type":398,"value":517},{"type":393,"tag":427,"props":5160,"children":5161},{"style":439},[5162],{"type":398,"value":512},{"type":393,"tag":427,"props":5164,"children":5165},{"style":504},[5166],{"type":398,"value":535},{"type":393,"tag":427,"props":5168,"children":5169},{"style":439},[5170],{"type":398,"value":540},{"type":393,"tag":427,"props":5172,"children":5173},{"class":429,"line":197},[5174,5179,5183,5188,5192,5197,5201,5206],{"type":393,"tag":427,"props":5175,"children":5176},{"style":493},[5177],{"type":398,"value":5178},"    'satisfaction_score'",{"type":393,"tag":427,"props":5180,"children":5181},{"style":439},[5182],{"type":398,"value":501},{"type":393,"tag":427,"props":5184,"children":5185},{"style":504},[5186],{"type":398,"value":5187},"4.5",{"type":393,"tag":427,"props":5189,"children":5190},{"style":439},[5191],{"type":398,"value":512},{"type":393,"tag":427,"props":5193,"children":5194},{"style":504},[5195],{"type":398,"value":5196},"3.8",{"type":393,"tag":427,"props":5198,"children":5199},{"style":439},[5200],{"type":398,"value":512},{"type":393,"tag":427,"props":5202,"children":5203},{"style":504},[5204],{"type":398,"value":5205},"4.9",{"type":393,"tag":427,"props":5207,"children":5208},{"style":439},[5209],{"type":398,"value":540},{"type":393,"tag":427,"props":5211,"children":5212},{"class":429,"line":206},[5213,5218,5222,5226,5230,5234,5238,5243],{"type":393,"tag":427,"props":5214,"children":5215},{"style":493},[5216],{"type":398,"value":5217},"    'support_tickets'",{"type":393,"tag":427,"props":5219,"children":5220},{"style":439},[5221],{"type":398,"value":501},{"type":393,"tag":427,"props":5223,"children":5224},{"style":504},[5225],{"type":398,"value":507},{"type":393,"tag":427,"props":5227,"children":5228},{"style":439},[5229],{"type":398,"value":512},{"type":393,"tag":427,"props":5231,"children":5232},{"style":504},[5233],{"type":398,"value":526},{"type":393,"tag":427,"props":5235,"children":5236},{"style":439},[5237],{"type":398,"value":512},{"type":393,"tag":427,"props":5239,"children":5240},{"style":504},[5241],{"type":398,"value":5242},"0",{"type":393,"tag":427,"props":5244,"children":5245},{"style":439},[5246],{"type":398,"value":637},{"type":393,"tag":427,"props":5248,"children":5249},{"class":429,"line":215},[5250],{"type":393,"tag":427,"props":5251,"children":5252},{"style":439},[5253],{"type":398,"value":645},{"type":393,"tag":427,"props":5255,"children":5256},{"class":429,"line":224},[5257],{"type":393,"tag":427,"props":5258,"children":5259},{"emptyLinePlaceholder":12},[5260],{"type":398,"value":460},{"type":393,"tag":427,"props":5262,"children":5263},{"class":429,"line":233},[5264,5268,5272,5277],{"type":393,"tag":427,"props":5265,"children":5266},{"style":504},[5267],{"type":398,"value":811},{"type":393,"tag":427,"props":5269,"children":5270},{"style":439},[5271],{"type":398,"value":816},{"type":393,"tag":427,"props":5273,"children":5274},{"style":493},[5275],{"type":398,"value":5276},"\"Demographics:\"",{"type":393,"tag":427,"props":5278,"children":5279},{"style":439},[5280],{"type":398,"value":826},{"type":393,"tag":427,"props":5282,"children":5283},{"class":429,"line":244},[5284,5288],{"type":393,"tag":427,"props":5285,"children":5286},{"style":504},[5287],{"type":398,"value":811},{"type":393,"tag":427,"props":5289,"children":5290},{"style":439},[5291],{"type":398,"value":5292},"(demographics)\n",{"type":393,"tag":427,"props":5294,"children":5295},{"class":429,"line":253},[5296,5300],{"type":393,"tag":427,"props":5297,"children":5298},{"style":504},[5299],{"type":398,"value":811},{"type":393,"tag":427,"props":5301,"children":5302},{"style":439},[5303],{"type":398,"value":850},{"type":393,"tag":427,"props":5305,"children":5306},{"class":429,"line":262},[5307,5311,5315,5320],{"type":393,"tag":427,"props":5308,"children":5309},{"style":504},[5310],{"type":398,"value":811},{"type":393,"tag":427,"props":5312,"children":5313},{"style":439},[5314],{"type":398,"value":816},{"type":393,"tag":427,"props":5316,"children":5317},{"style":493},[5318],{"type":398,"value":5319},"\"Purchases:\"",{"type":393,"tag":427,"props":5321,"children":5322},{"style":439},[5323],{"type":398,"value":826},{"type":393,"tag":427,"props":5325,"children":5326},{"class":429,"line":271},[5327,5331],{"type":393,"tag":427,"props":5328,"children":5329},{"style":504},[5330],{"type":398,"value":811},{"type":393,"tag":427,"props":5332,"children":5333},{"style":439},[5334],{"type":398,"value":5335},"(purchases)\n",{"type":393,"tag":427,"props":5337,"children":5338},{"class":429,"line":281},[5339,5343],{"type":393,"tag":427,"props":5340,"children":5341},{"style":504},[5342],{"type":398,"value":811},{"type":393,"tag":427,"props":5344,"children":5345},{"style":439},[5346],{"type":398,"value":850},{"type":393,"tag":427,"props":5348,"children":5349},{"class":429,"line":290},[5350,5354,5358,5363],{"type":393,"tag":427,"props":5351,"children":5352},{"style":504},[5353],{"type":398,"value":811},{"type":393,"tag":427,"props":5355,"children":5356},{"style":439},[5357],{"type":398,"value":816},{"type":393,"tag":427,"props":5359,"children":5360},{"style":493},[5361],{"type":398,"value":5362},"\"Service interactions:\"",{"type":393,"tag":427,"props":5364,"children":5365},{"style":439},[5366],{"type":398,"value":826},{"type":393,"tag":427,"props":5368,"children":5369},{"class":429,"line":299},[5370,5374],{"type":393,"tag":427,"props":5371,"children":5372},{"style":504},[5373],{"type":398,"value":811},{"type":393,"tag":427,"props":5375,"children":5376},{"style":439},[5377],{"type":398,"value":5378},"(service)\n",{"type":393,"tag":427,"props":5380,"children":5381},{"class":429,"line":308},[5382,5386],{"type":393,"tag":427,"props":5383,"children":5384},{"style":504},[5385],{"type":398,"value":811},{"type":393,"tag":427,"props":5387,"children":5388},{"style":439},[5389],{"type":398,"value":850},{"type":393,"tag":427,"props":5391,"children":5392},{"class":429,"line":318},[5393],{"type":393,"tag":427,"props":5394,"children":5395},{"emptyLinePlaceholder":12},[5396],{"type":398,"value":460},{"type":393,"tag":427,"props":5398,"children":5399},{"class":429,"line":327},[5400],{"type":393,"tag":427,"props":5401,"children":5402},{"style":466},[5403],{"type":398,"value":5404},"# Step 1: Merge purchases with demographics\n",{"type":393,"tag":427,"props":5406,"children":5407},{"class":429,"line":336},[5408,5413,5417,5422,5426,5430,5434,5438,5442,5446,5450],{"type":393,"tag":427,"props":5409,"children":5410},{"style":439},[5411],{"type":398,"value":5412},"purchase_demo ",{"type":393,"tag":427,"props":5414,"children":5415},{"style":433},[5416],{"type":398,"value":482},{"type":393,"tag":427,"props":5418,"children":5419},{"style":439},[5420],{"type":398,"value":5421}," purchases.merge(demographics, ",{"type":393,"tag":427,"props":5423,"children":5424},{"style":928},[5425],{"type":398,"value":931},{"type":393,"tag":427,"props":5427,"children":5428},{"style":433},[5429],{"type":398,"value":482},{"type":393,"tag":427,"props":5431,"children":5432},{"style":493},[5433],{"type":398,"value":940},{"type":393,"tag":427,"props":5435,"children":5436},{"style":439},[5437],{"type":398,"value":512},{"type":393,"tag":427,"props":5439,"children":5440},{"style":928},[5441],{"type":398,"value":1779},{"type":393,"tag":427,"props":5443,"children":5444},{"style":433},[5445],{"type":398,"value":482},{"type":393,"tag":427,"props":5447,"children":5448},{"style":493},[5449],{"type":398,"value":2242},{"type":393,"tag":427,"props":5451,"children":5452},{"style":439},[5453],{"type":398,"value":826},{"type":393,"tag":427,"props":5455,"children":5456},{"class":429,"line":346},[5457,5461,5465,5470],{"type":393,"tag":427,"props":5458,"children":5459},{"style":504},[5460],{"type":398,"value":811},{"type":393,"tag":427,"props":5462,"children":5463},{"style":439},[5464],{"type":398,"value":816},{"type":393,"tag":427,"props":5466,"children":5467},{"style":493},[5468],{"type":398,"value":5469},"\"Purchases with demographics:\"",{"type":393,"tag":427,"props":5471,"children":5472},{"style":439},[5473],{"type":398,"value":826},{"type":393,"tag":427,"props":5475,"children":5476},{"class":429,"line":355},[5477,5481],{"type":393,"tag":427,"props":5478,"children":5479},{"style":504},[5480],{"type":398,"value":811},{"type":393,"tag":427,"props":5482,"children":5483},{"style":439},[5484],{"type":398,"value":5485},"(purchase_demo)\n",{"type":393,"tag":427,"props":5487,"children":5488},{"class":429,"line":364},[5489,5493],{"type":393,"tag":427,"props":5490,"children":5491},{"style":504},[5492],{"type":398,"value":811},{"type":393,"tag":427,"props":5494,"children":5495},{"style":439},[5496],{"type":398,"value":850},{"type":393,"tag":427,"props":5498,"children":5499},{"class":429,"line":374},[5500],{"type":393,"tag":427,"props":5501,"children":5502},{"emptyLinePlaceholder":12},[5503],{"type":398,"value":460},{"type":393,"tag":427,"props":5505,"children":5506},{"class":429,"line":383},[5507],{"type":393,"tag":427,"props":5508,"children":5509},{"style":466},[5510],{"type":398,"value":5511},"# Step 2: Add service data (left join to keep all purchase records)\n",{"type":393,"tag":427,"props":5513,"children":5515},{"class":429,"line":5514},41,[5516,5521,5525,5530,5534,5538,5542,5546,5550,5554,5558],{"type":393,"tag":427,"props":5517,"children":5518},{"style":439},[5519],{"type":398,"value":5520},"complete_analysis ",{"type":393,"tag":427,"props":5522,"children":5523},{"style":433},[5524],{"type":398,"value":482},{"type":393,"tag":427,"props":5526,"children":5527},{"style":439},[5528],{"type":398,"value":5529}," purchase_demo.merge(service, ",{"type":393,"tag":427,"props":5531,"children":5532},{"style":928},[5533],{"type":398,"value":931},{"type":393,"tag":427,"props":5535,"children":5536},{"style":433},[5537],{"type":398,"value":482},{"type":393,"tag":427,"props":5539,"children":5540},{"style":493},[5541],{"type":398,"value":940},{"type":393,"tag":427,"props":5543,"children":5544},{"style":439},[5545],{"type":398,"value":512},{"type":393,"tag":427,"props":5547,"children":5548},{"style":928},[5549],{"type":398,"value":1779},{"type":393,"tag":427,"props":5551,"children":5552},{"style":433},[5553],{"type":398,"value":482},{"type":393,"tag":427,"props":5555,"children":5556},{"style":493},[5557],{"type":398,"value":2242},{"type":393,"tag":427,"props":5559,"children":5560},{"style":439},[5561],{"type":398,"value":826},{"type":393,"tag":427,"props":5563,"children":5565},{"class":429,"line":5564},42,[5566,5570,5574,5579],{"type":393,"tag":427,"props":5567,"children":5568},{"style":504},[5569],{"type":398,"value":811},{"type":393,"tag":427,"props":5571,"children":5572},{"style":439},[5573],{"type":398,"value":816},{"type":393,"tag":427,"props":5575,"children":5576},{"style":493},[5577],{"type":398,"value":5578},"\"Complete customer analysis:\"",{"type":393,"tag":427,"props":5580,"children":5581},{"style":439},[5582],{"type":398,"value":826},{"type":393,"tag":427,"props":5584,"children":5586},{"class":429,"line":5585},43,[5587,5591],{"type":393,"tag":427,"props":5588,"children":5589},{"style":504},[5590],{"type":398,"value":811},{"type":393,"tag":427,"props":5592,"children":5593},{"style":439},[5594],{"type":398,"value":5595},"(complete_analysis)\n",{"type":393,"tag":427,"props":5597,"children":5599},{"class":429,"line":5598},44,[5600,5604],{"type":393,"tag":427,"props":5601,"children":5602},{"style":504},[5603],{"type":398,"value":811},{"type":393,"tag":427,"props":5605,"children":5606},{"style":439},[5607],{"type":398,"value":850},{"type":393,"tag":427,"props":5609,"children":5611},{"class":429,"line":5610},45,[5612],{"type":393,"tag":427,"props":5613,"children":5614},{"emptyLinePlaceholder":12},[5615],{"type":398,"value":460},{"type":393,"tag":427,"props":5617,"children":5619},{"class":429,"line":5618},46,[5620],{"type":393,"tag":427,"props":5621,"children":5622},{"style":466},[5623],{"type":398,"value":5624},"# Quick analysis: Average purchase by region\n",{"type":393,"tag":427,"props":5626,"children":5628},{"class":429,"line":5627},47,[5629,5634,5638,5643,5647,5652,5657],{"type":393,"tag":427,"props":5630,"children":5631},{"style":439},[5632],{"type":398,"value":5633},"regional_avg ",{"type":393,"tag":427,"props":5635,"children":5636},{"style":433},[5637],{"type":398,"value":482},{"type":393,"tag":427,"props":5639,"children":5640},{"style":439},[5641],{"type":398,"value":5642}," complete_analysis.groupby(",{"type":393,"tag":427,"props":5644,"children":5645},{"style":493},[5646],{"type":398,"value":3802},{"type":393,"tag":427,"props":5648,"children":5649},{"style":439},[5650],{"type":398,"value":5651},")[",{"type":393,"tag":427,"props":5653,"children":5654},{"style":493},[5655],{"type":398,"value":5656},"'purchase_amount'",{"type":393,"tag":427,"props":5658,"children":5659},{"style":439},[5660],{"type":398,"value":5661},"].mean()\n",{"type":393,"tag":427,"props":5663,"children":5665},{"class":429,"line":5664},48,[5666,5670,5674,5679],{"type":393,"tag":427,"props":5667,"children":5668},{"style":504},[5669],{"type":398,"value":811},{"type":393,"tag":427,"props":5671,"children":5672},{"style":439},[5673],{"type":398,"value":816},{"type":393,"tag":427,"props":5675,"children":5676},{"style":493},[5677],{"type":398,"value":5678},"\"Average purchase amount by region:\"",{"type":393,"tag":427,"props":5680,"children":5681},{"style":439},[5682],{"type":398,"value":826},{"type":393,"tag":427,"props":5684,"children":5686},{"class":429,"line":5685},49,[5687,5691,5696,5700],{"type":393,"tag":427,"props":5688,"children":5689},{"style":504},[5690],{"type":398,"value":811},{"type":393,"tag":427,"props":5692,"children":5693},{"style":439},[5694],{"type":398,"value":5695},"(regional_avg.round(",{"type":393,"tag":427,"props":5697,"children":5698},{"style":504},[5699],{"type":398,"value":517},{"type":393,"tag":427,"props":5701,"children":5702},{"style":439},[5703],{"type":398,"value":4527},{"type":393,"tag":978,"props":5705,"children":5707},{"id":5706},"merge-validation",[5708],{"type":398,"value":5709},"🎯 Merge Validation",{"type":393,"tag":401,"props":5711,"children":5712},{},[5713],{"type":398,"value":5714},"You can validate your merge to catch common issues:",{"type":393,"tag":990,"props":5716,"children":5719},{"emoji":5717,"title":5718,"type":994},"✅","Merge Validation",[5720,5728,5775,5783],{"type":393,"tag":401,"props":5721,"children":5722},{},[5723],{"type":393,"tag":1000,"props":5724,"children":5725},{},[5726],{"type":398,"value":5727},"Validation Options:",{"type":393,"tag":1006,"props":5729,"children":5730},{},[5731,5742,5753,5764],{"type":393,"tag":1010,"props":5732,"children":5733},{},[5734,5740],{"type":393,"tag":423,"props":5735,"children":5737},{"className":5736},[],[5738],{"type":398,"value":5739},"validate='one_to_one'",{"type":398,"value":5741}," - Each key appears once in both DataFrames",{"type":393,"tag":1010,"props":5743,"children":5744},{},[5745,5751],{"type":393,"tag":423,"props":5746,"children":5748},{"className":5747},[],[5749],{"type":398,"value":5750},"validate='one_to_many'",{"type":398,"value":5752}," - Left keys unique, right keys can repeat",{"type":393,"tag":1010,"props":5754,"children":5755},{},[5756,5762],{"type":393,"tag":423,"props":5757,"children":5759},{"className":5758},[],[5760],{"type":398,"value":5761},"validate='many_to_one'",{"type":398,"value":5763}," - Right keys unique, left keys can repeat",{"type":393,"tag":1010,"props":5765,"children":5766},{},[5767,5773],{"type":393,"tag":423,"props":5768,"children":5770},{"className":5769},[],[5771],{"type":398,"value":5772},"validate='many_to_many'",{"type":398,"value":5774}," - Keys can repeat in both (default)",{"type":393,"tag":401,"props":5776,"children":5777},{},[5778],{"type":393,"tag":1000,"props":5779,"children":5780},{},[5781],{"type":398,"value":5782},"Benefits:",{"type":393,"tag":1006,"props":5784,"children":5785},{},[5786,5791,5796,5801],{"type":393,"tag":1010,"props":5787,"children":5788},{},[5789],{"type":398,"value":5790},"Catches unexpected data relationships",{"type":393,"tag":1010,"props":5792,"children":5793},{},[5794],{"type":398,"value":5795},"Helps identify data quality issues",{"type":393,"tag":1010,"props":5797,"children":5798},{},[5799],{"type":398,"value":5800},"Makes merge intent explicit",{"type":393,"tag":1010,"props":5802,"children":5803},{},[5804],{"type":398,"value":5805},"Prevents silent errors",{"type":393,"tag":412,"props":5807,"children":5808},{},[5809],{"type":393,"tag":416,"props":5810,"children":5812},{"className":418,"code":5811,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Customer master data (should be unique)\ncustomers = pd.DataFrame({\n    'customer_id': [1, 2, 3],\n    'name': ['Alice', 'Bob', 'Charlie']\n})\n\n# Orders (one customer can have multiple orders)\norders = pd.DataFrame({\n    'customer_id': [1, 1, 2, 3],\n    'order_amount': [100, 150, 200, 75]\n})\n\nprint(\"Customers (unique):\")\nprint(customers)\nprint()\nprint(\"Orders (multiple per customer):\")\nprint(orders)\nprint()\n\n# Validate one-to-many relationship\ntry:\n    validated_merge = customers.merge(orders, \n                                    on='customer_id', \n                                    validate='one_to_many')\n    print(\"Merge validation passed!\")\n    print(validated_merge)\nexcept Exception as e:\n    print(f\"Validation failed: {e}\")\n",[5813],{"type":393,"tag":423,"props":5814,"children":5815},{"__ignoreMap":6},[5816,5835,5842,5850,5865,5900,5935,5942,5949,5957,5972,6015,6058,6065,6072,6092,6103,6114,6134,6145,6156,6163,6171,6184,6201,6221,6242,6263,6275,6298],{"type":393,"tag":427,"props":5817,"children":5818},{"class":429,"line":11},[5819,5823,5827,5831],{"type":393,"tag":427,"props":5820,"children":5821},{"style":433},[5822],{"type":398,"value":436},{"type":393,"tag":427,"props":5824,"children":5825},{"style":439},[5826],{"type":398,"value":442},{"type":393,"tag":427,"props":5828,"children":5829},{"style":433},[5830],{"type":398,"value":447},{"type":393,"tag":427,"props":5832,"children":5833},{"style":439},[5834],{"type":398,"value":452},{"type":393,"tag":427,"props":5836,"children":5837},{"class":429,"line":27},[5838],{"type":393,"tag":427,"props":5839,"children":5840},{"emptyLinePlaceholder":12},[5841],{"type":398,"value":460},{"type":393,"tag":427,"props":5843,"children":5844},{"class":429,"line":36},[5845],{"type":393,"tag":427,"props":5846,"children":5847},{"style":466},[5848],{"type":398,"value":5849},"# Customer master data (should be unique)\n",{"type":393,"tag":427,"props":5851,"children":5852},{"class":429,"line":45},[5853,5857,5861],{"type":393,"tag":427,"props":5854,"children":5855},{"style":439},[5856],{"type":398,"value":477},{"type":393,"tag":427,"props":5858,"children":5859},{"style":433},[5860],{"type":398,"value":482},{"type":393,"tag":427,"props":5862,"children":5863},{"style":439},[5864],{"type":398,"value":487},{"type":393,"tag":427,"props":5866,"children":5867},{"class":429,"line":54},[5868,5872,5876,5880,5884,5888,5892,5896],{"type":393,"tag":427,"props":5869,"children":5870},{"style":493},[5871],{"type":398,"value":496},{"type":393,"tag":427,"props":5873,"children":5874},{"style":439},[5875],{"type":398,"value":501},{"type":393,"tag":427,"props":5877,"children":5878},{"style":504},[5879],{"type":398,"value":507},{"type":393,"tag":427,"props":5881,"children":5882},{"style":439},[5883],{"type":398,"value":512},{"type":393,"tag":427,"props":5885,"children":5886},{"style":504},[5887],{"type":398,"value":517},{"type":393,"tag":427,"props":5889,"children":5890},{"style":439},[5891],{"type":398,"value":512},{"type":393,"tag":427,"props":5893,"children":5894},{"style":504},[5895],{"type":398,"value":526},{"type":393,"tag":427,"props":5897,"children":5898},{"style":439},[5899],{"type":398,"value":540},{"type":393,"tag":427,"props":5901,"children":5902},{"class":429,"line":63},[5903,5907,5911,5915,5919,5923,5927,5931],{"type":393,"tag":427,"props":5904,"children":5905},{"style":493},[5906],{"type":398,"value":548},{"type":393,"tag":427,"props":5908,"children":5909},{"style":439},[5910],{"type":398,"value":501},{"type":393,"tag":427,"props":5912,"children":5913},{"style":493},[5914],{"type":398,"value":557},{"type":393,"tag":427,"props":5916,"children":5917},{"style":439},[5918],{"type":398,"value":512},{"type":393,"tag":427,"props":5920,"children":5921},{"style":493},[5922],{"type":398,"value":566},{"type":393,"tag":427,"props":5924,"children":5925},{"style":439},[5926],{"type":398,"value":512},{"type":393,"tag":427,"props":5928,"children":5929},{"style":493},[5930],{"type":398,"value":575},{"type":393,"tag":427,"props":5932,"children":5933},{"style":439},[5934],{"type":398,"value":637},{"type":393,"tag":427,"props":5936,"children":5937},{"class":429,"line":72},[5938],{"type":393,"tag":427,"props":5939,"children":5940},{"style":439},[5941],{"type":398,"value":645},{"type":393,"tag":427,"props":5943,"children":5944},{"class":429,"line":83},[5945],{"type":393,"tag":427,"props":5946,"children":5947},{"emptyLinePlaceholder":12},[5948],{"type":398,"value":460},{"type":393,"tag":427,"props":5950,"children":5951},{"class":429,"line":92},[5952],{"type":393,"tag":427,"props":5953,"children":5954},{"style":466},[5955],{"type":398,"value":5956},"# Orders (one customer can have multiple orders)\n",{"type":393,"tag":427,"props":5958,"children":5959},{"class":429,"line":101},[5960,5964,5968],{"type":393,"tag":427,"props":5961,"children":5962},{"style":439},[5963],{"type":398,"value":668},{"type":393,"tag":427,"props":5965,"children":5966},{"style":433},[5967],{"type":398,"value":482},{"type":393,"tag":427,"props":5969,"children":5970},{"style":439},[5971],{"type":398,"value":487},{"type":393,"tag":427,"props":5973,"children":5974},{"class":429,"line":110},[5975,5979,5983,5987,5991,5995,5999,6003,6007,6011],{"type":393,"tag":427,"props":5976,"children":5977},{"style":493},[5978],{"type":398,"value":496},{"type":393,"tag":427,"props":5980,"children":5981},{"style":439},[5982],{"type":398,"value":501},{"type":393,"tag":427,"props":5984,"children":5985},{"style":504},[5986],{"type":398,"value":507},{"type":393,"tag":427,"props":5988,"children":5989},{"style":439},[5990],{"type":398,"value":512},{"type":393,"tag":427,"props":5992,"children":5993},{"style":504},[5994],{"type":398,"value":507},{"type":393,"tag":427,"props":5996,"children":5997},{"style":439},[5998],{"type":398,"value":512},{"type":393,"tag":427,"props":6000,"children":6001},{"style":504},[6002],{"type":398,"value":517},{"type":393,"tag":427,"props":6004,"children":6005},{"style":439},[6006],{"type":398,"value":512},{"type":393,"tag":427,"props":6008,"children":6009},{"style":504},[6010],{"type":398,"value":526},{"type":393,"tag":427,"props":6012,"children":6013},{"style":439},[6014],{"type":398,"value":540},{"type":393,"tag":427,"props":6016,"children":6017},{"class":429,"line":121},[6018,6022,6026,6030,6034,6038,6042,6046,6050,6054],{"type":393,"tag":427,"props":6019,"children":6020},{"style":493},[6021],{"type":398,"value":2055},{"type":393,"tag":427,"props":6023,"children":6024},{"style":439},[6025],{"type":398,"value":501},{"type":393,"tag":427,"props":6027,"children":6028},{"style":504},[6029],{"type":398,"value":2064},{"type":393,"tag":427,"props":6031,"children":6032},{"style":439},[6033],{"type":398,"value":512},{"type":393,"tag":427,"props":6035,"children":6036},{"style":504},[6037],{"type":398,"value":776},{"type":393,"tag":427,"props":6039,"children":6040},{"style":439},[6041],{"type":398,"value":512},{"type":393,"tag":427,"props":6043,"children":6044},{"style":504},[6045],{"type":398,"value":2081},{"type":393,"tag":427,"props":6047,"children":6048},{"style":439},[6049],{"type":398,"value":512},{"type":393,"tag":427,"props":6051,"children":6052},{"style":504},[6053],{"type":398,"value":5030},{"type":393,"tag":427,"props":6055,"children":6056},{"style":439},[6057],{"type":398,"value":637},{"type":393,"tag":427,"props":6059,"children":6060},{"class":429,"line":130},[6061],{"type":393,"tag":427,"props":6062,"children":6063},{"style":439},[6064],{"type":398,"value":645},{"type":393,"tag":427,"props":6066,"children":6067},{"class":429,"line":139},[6068],{"type":393,"tag":427,"props":6069,"children":6070},{"emptyLinePlaceholder":12},[6071],{"type":398,"value":460},{"type":393,"tag":427,"props":6073,"children":6074},{"class":429,"line":148},[6075,6079,6083,6088],{"type":393,"tag":427,"props":6076,"children":6077},{"style":504},[6078],{"type":398,"value":811},{"type":393,"tag":427,"props":6080,"children":6081},{"style":439},[6082],{"type":398,"value":816},{"type":393,"tag":427,"props":6084,"children":6085},{"style":493},[6086],{"type":398,"value":6087},"\"Customers (unique):\"",{"type":393,"tag":427,"props":6089,"children":6090},{"style":439},[6091],{"type":398,"value":826},{"type":393,"tag":427,"props":6093,"children":6094},{"class":429,"line":159},[6095,6099],{"type":393,"tag":427,"props":6096,"children":6097},{"style":504},[6098],{"type":398,"value":811},{"type":393,"tag":427,"props":6100,"children":6101},{"style":439},[6102],{"type":398,"value":838},{"type":393,"tag":427,"props":6104,"children":6105},{"class":429,"line":168},[6106,6110],{"type":393,"tag":427,"props":6107,"children":6108},{"style":504},[6109],{"type":398,"value":811},{"type":393,"tag":427,"props":6111,"children":6112},{"style":439},[6113],{"type":398,"value":850},{"type":393,"tag":427,"props":6115,"children":6116},{"class":429,"line":177},[6117,6121,6125,6130],{"type":393,"tag":427,"props":6118,"children":6119},{"style":504},[6120],{"type":398,"value":811},{"type":393,"tag":427,"props":6122,"children":6123},{"style":439},[6124],{"type":398,"value":816},{"type":393,"tag":427,"props":6126,"children":6127},{"style":493},[6128],{"type":398,"value":6129},"\"Orders (multiple per customer):\"",{"type":393,"tag":427,"props":6131,"children":6132},{"style":439},[6133],{"type":398,"value":826},{"type":393,"tag":427,"props":6135,"children":6136},{"class":429,"line":186},[6137,6141],{"type":393,"tag":427,"props":6138,"children":6139},{"style":504},[6140],{"type":398,"value":811},{"type":393,"tag":427,"props":6142,"children":6143},{"style":439},[6144],{"type":398,"value":882},{"type":393,"tag":427,"props":6146,"children":6147},{"class":429,"line":197},[6148,6152],{"type":393,"tag":427,"props":6149,"children":6150},{"style":504},[6151],{"type":398,"value":811},{"type":393,"tag":427,"props":6153,"children":6154},{"style":439},[6155],{"type":398,"value":850},{"type":393,"tag":427,"props":6157,"children":6158},{"class":429,"line":206},[6159],{"type":393,"tag":427,"props":6160,"children":6161},{"emptyLinePlaceholder":12},[6162],{"type":398,"value":460},{"type":393,"tag":427,"props":6164,"children":6165},{"class":429,"line":215},[6166],{"type":393,"tag":427,"props":6167,"children":6168},{"style":466},[6169],{"type":398,"value":6170},"# Validate one-to-many relationship\n",{"type":393,"tag":427,"props":6172,"children":6173},{"class":429,"line":224},[6174,6179],{"type":393,"tag":427,"props":6175,"children":6176},{"style":433},[6177],{"type":398,"value":6178},"try",{"type":393,"tag":427,"props":6180,"children":6181},{"style":439},[6182],{"type":398,"value":6183},":\n",{"type":393,"tag":427,"props":6185,"children":6186},{"class":429,"line":233},[6187,6192,6196],{"type":393,"tag":427,"props":6188,"children":6189},{"style":439},[6190],{"type":398,"value":6191},"    validated_merge ",{"type":393,"tag":427,"props":6193,"children":6194},{"style":433},[6195],{"type":398,"value":482},{"type":393,"tag":427,"props":6197,"children":6198},{"style":439},[6199],{"type":398,"value":6200}," customers.merge(orders, \n",{"type":393,"tag":427,"props":6202,"children":6203},{"class":429,"line":244},[6204,6209,6213,6217],{"type":393,"tag":427,"props":6205,"children":6206},{"style":928},[6207],{"type":398,"value":6208},"                                    on",{"type":393,"tag":427,"props":6210,"children":6211},{"style":433},[6212],{"type":398,"value":482},{"type":393,"tag":427,"props":6214,"children":6215},{"style":493},[6216],{"type":398,"value":940},{"type":393,"tag":427,"props":6218,"children":6219},{"style":439},[6220],{"type":398,"value":3216},{"type":393,"tag":427,"props":6222,"children":6223},{"class":429,"line":253},[6224,6229,6233,6238],{"type":393,"tag":427,"props":6225,"children":6226},{"style":928},[6227],{"type":398,"value":6228},"                                    validate",{"type":393,"tag":427,"props":6230,"children":6231},{"style":433},[6232],{"type":398,"value":482},{"type":393,"tag":427,"props":6234,"children":6235},{"style":493},[6236],{"type":398,"value":6237},"'one_to_many'",{"type":393,"tag":427,"props":6239,"children":6240},{"style":439},[6241],{"type":398,"value":826},{"type":393,"tag":427,"props":6243,"children":6244},{"class":429,"line":262},[6245,6250,6254,6259],{"type":393,"tag":427,"props":6246,"children":6247},{"style":504},[6248],{"type":398,"value":6249},"    print",{"type":393,"tag":427,"props":6251,"children":6252},{"style":439},[6253],{"type":398,"value":816},{"type":393,"tag":427,"props":6255,"children":6256},{"style":493},[6257],{"type":398,"value":6258},"\"Merge validation passed!\"",{"type":393,"tag":427,"props":6260,"children":6261},{"style":439},[6262],{"type":398,"value":826},{"type":393,"tag":427,"props":6264,"children":6265},{"class":429,"line":271},[6266,6270],{"type":393,"tag":427,"props":6267,"children":6268},{"style":504},[6269],{"type":398,"value":6249},{"type":393,"tag":427,"props":6271,"children":6272},{"style":439},[6273],{"type":398,"value":6274},"(validated_merge)\n",{"type":393,"tag":427,"props":6276,"children":6277},{"class":429,"line":281},[6278,6283,6288,6293],{"type":393,"tag":427,"props":6279,"children":6280},{"style":433},[6281],{"type":398,"value":6282},"except",{"type":393,"tag":427,"props":6284,"children":6285},{"style":504},[6286],{"type":398,"value":6287}," Exception",{"type":393,"tag":427,"props":6289,"children":6290},{"style":433},[6291],{"type":398,"value":6292}," as",{"type":393,"tag":427,"props":6294,"children":6295},{"style":439},[6296],{"type":398,"value":6297}," e:\n",{"type":393,"tag":427,"props":6299,"children":6300},{"class":429,"line":290},[6301,6305,6309,6314,6319,6324,6329,6334,6339],{"type":393,"tag":427,"props":6302,"children":6303},{"style":504},[6304],{"type":398,"value":6249},{"type":393,"tag":427,"props":6306,"children":6307},{"style":439},[6308],{"type":398,"value":816},{"type":393,"tag":427,"props":6310,"children":6311},{"style":433},[6312],{"type":398,"value":6313},"f",{"type":393,"tag":427,"props":6315,"children":6316},{"style":493},[6317],{"type":398,"value":6318},"\"Validation failed: ",{"type":393,"tag":427,"props":6320,"children":6321},{"style":504},[6322],{"type":398,"value":6323},"{",{"type":393,"tag":427,"props":6325,"children":6326},{"style":439},[6327],{"type":398,"value":6328},"e",{"type":393,"tag":427,"props":6330,"children":6331},{"style":504},[6332],{"type":398,"value":6333},"}",{"type":393,"tag":427,"props":6335,"children":6336},{"style":493},[6337],{"type":398,"value":6338},"\"",{"type":393,"tag":427,"props":6340,"children":6341},{"style":439},[6342],{"type":398,"value":826},{"type":393,"tag":978,"props":6344,"children":6346},{"id":6345},"key-takeaways",[6347],{"type":398,"value":6348},"🎯 Key Takeaways",{"type":393,"tag":990,"props":6350,"children":6353},{"emoji":6351,"title":6352,"type":1115},"📚","Merge Operations Summary",[6354,6361,6397,6405,6448,6456,6479,6487,6510],{"type":393,"tag":401,"props":6355,"children":6356},{},[6357],{"type":393,"tag":1000,"props":6358,"children":6359},{},[6360],{"type":398,"value":1047},{"type":393,"tag":1006,"props":6362,"children":6363},{},[6364,6375,6386],{"type":393,"tag":1010,"props":6365,"children":6366},{},[6367,6373],{"type":393,"tag":423,"props":6368,"children":6370},{"className":6369},[],[6371],{"type":398,"value":6372},"df1.merge(df2, on='key')",{"type":398,"value":6374}," - Simple merge",{"type":393,"tag":1010,"props":6376,"children":6377},{},[6378,6384],{"type":393,"tag":423,"props":6379,"children":6381},{"className":6380},[],[6382],{"type":398,"value":6383},"df1.merge(df2, left_on='col1', right_on='col2')",{"type":398,"value":6385}," - Different key names",{"type":393,"tag":1010,"props":6387,"children":6388},{},[6389,6395],{"type":393,"tag":423,"props":6390,"children":6392},{"className":6391},[],[6393],{"type":398,"value":6394},"df1.merge(df2, on=['key1', 'key2'])",{"type":398,"value":6396}," - Multiple keys",{"type":393,"tag":401,"props":6398,"children":6399},{},[6400],{"type":393,"tag":1000,"props":6401,"children":6402},{},[6403],{"type":398,"value":6404},"Join Types:",{"type":393,"tag":1006,"props":6406,"children":6407},{},[6408,6418,6428,6438],{"type":393,"tag":1010,"props":6409,"children":6410},{},[6411,6416],{"type":393,"tag":423,"props":6412,"children":6414},{"className":6413},[],[6415],{"type":398,"value":1130},{"type":398,"value":6417}," - Only matching records (default)",{"type":393,"tag":1010,"props":6419,"children":6420},{},[6421,6426],{"type":393,"tag":423,"props":6422,"children":6424},{"className":6423},[],[6425],{"type":398,"value":1164},{"type":398,"value":6427}," - All left records + matches",{"type":393,"tag":1010,"props":6429,"children":6430},{},[6431,6436],{"type":393,"tag":423,"props":6432,"children":6434},{"className":6433},[],[6435],{"type":398,"value":1197},{"type":398,"value":6437}," - All right records + matches",{"type":393,"tag":1010,"props":6439,"children":6440},{},[6441,6446],{"type":393,"tag":423,"props":6442,"children":6444},{"className":6443},[],[6445],{"type":398,"value":1229},{"type":398,"value":6447}," - All records from both",{"type":393,"tag":401,"props":6449,"children":6450},{},[6451],{"type":393,"tag":1000,"props":6452,"children":6453},{},[6454],{"type":398,"value":6455},"Best Practices:",{"type":393,"tag":1006,"props":6457,"children":6458},{},[6459,6464,6469,6474],{"type":393,"tag":1010,"props":6460,"children":6461},{},[6462],{"type":398,"value":6463},"Choose appropriate join type for your use case",{"type":393,"tag":1010,"props":6465,"children":6466},{},[6467],{"type":398,"value":6468},"Handle column name conflicts with suffixes",{"type":393,"tag":1010,"props":6470,"children":6471},{},[6472],{"type":398,"value":6473},"Validate merge relationships when possible",{"type":393,"tag":1010,"props":6475,"children":6476},{},[6477],{"type":398,"value":6478},"Check result size and missing values",{"type":393,"tag":401,"props":6480,"children":6481},{},[6482],{"type":393,"tag":1000,"props":6483,"children":6484},{},[6485],{"type":398,"value":6486},"Common Patterns:",{"type":393,"tag":1006,"props":6488,"children":6489},{},[6490,6495,6500,6505],{"type":393,"tag":1010,"props":6491,"children":6492},{},[6493],{"type":398,"value":6494},"Master data + transactions (one-to-many)",{"type":393,"tag":1010,"props":6496,"children":6497},{},[6498],{"type":398,"value":6499},"Lookup tables (many-to-one)",{"type":393,"tag":1010,"props":6501,"children":6502},{},[6503],{"type":398,"value":6504},"Time series alignment (outer joins)",{"type":393,"tag":1010,"props":6506,"children":6507},{},[6508],{"type":398,"value":6509},"Data quality checks (validation)",{"type":393,"tag":401,"props":6511,"children":6512},{},[6513,6518],{"type":393,"tag":1000,"props":6514,"children":6515},{},[6516],{"type":398,"value":6517},"Remember:",{"type":398,"value":6519}," Merging connects related data for comprehensive analysis!",{"type":393,"tag":978,"props":6521,"children":6523},{"id":6522},"whats-next",[6524],{"type":398,"value":6525},"🚀 What's Next?",{"type":393,"tag":401,"props":6527,"children":6528},{},[6529],{"type":398,"value":6530},"Excellent! You now know how to combine data using both concatenation and merging. Next, let's explore working with dates and times - essential skills for time-based analysis.",{"type":393,"tag":401,"props":6532,"children":6533},{},[6534,6539,6541],{"type":393,"tag":1000,"props":6535,"children":6536},{},[6537],{"type":398,"value":6538},"Continue to",{"type":398,"value":6540},": ",{"type":393,"tag":6542,"props":6543,"children":6544},"a",{"href":332},[6545],{"type":398,"value":333},{"type":393,"tag":401,"props":6547,"children":6548},{},[6549],{"type":398,"value":6550},"Keep merging! 🔗📊",{"type":393,"tag":6552,"props":6553,"children":6554},"style",{},[6555],{"type":398,"value":6556},"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":6558},[6559,6560,6565,6566,6567,6568,6569,6570,6571],{"id":980,"depth":27,"text":983},{"id":1102,"depth":27,"text":1105,"children":6561},[6562,6563,6564],{"id":1251,"depth":36,"text":1254},{"id":1827,"depth":36,"text":1830},{"id":2281,"depth":36,"text":2284},{"id":2732,"depth":27,"text":2735},{"id":3272,"depth":27,"text":3275},{"id":3986,"depth":27,"text":3989},{"id":4672,"depth":27,"text":4675},{"id":5706,"depth":27,"text":5709},{"id":6345,"depth":27,"text":6348},{"id":6522,"depth":27,"text":6525},1782373726826]