[{"data":1,"prerenderedAt":5241},["ShallowReactive",2],{"tutorials-pandas":3,"category-items-pandas":387,"content-/pandas/applying-functions":388},[4,21,31,40,49,58,67,78,87,96,105,116,125,134,143,154,163,172,181,192,201,210,219,228,239,248,257,266,276,285,294,303,313,322,331,341,350,359,369,378],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":6,"title":8,"description":9,"slug":10,"order":11,"isParent":12,"icon":13,"_type":14,"_id":15,"_source":16,"_file":17,"_stem":18,"_extension":19,"children":20,"expanded":12},"/pandas","",false,"Getting Started","Learn the basics of Pandas, Python's powerful data analysis library for working with spreadsheet-like data","getting-started",1,true,"pi pi-play","markdown","content:pandas:1.index.md","content","pandas/1.index.md","pandas/1.index","md",[21,31,40,49,58],{"_path":22,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":14,"_id":28,"_source":16,"_file":29,"_stem":30,"_extension":19},"/pandas/what-is-pandas","pandas","What is Pandas","Understand what Pandas is, why it's essential for data analysis, and how it makes working with data simple and powerful","what-is-pandas",2,"content:pandas:2.what-is-pandas.md","pandas/2.what-is-pandas.md","pandas/2.what-is-pandas",{"_path":32,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":14,"_id":37,"_source":16,"_file":38,"_stem":39,"_extension":19},"/pandas/installing-pandas","Installing Pandas","Learn how to install Pandas on your computer and verify it's working properly","installing-pandas",3,"content:pandas:3.installing-pandas.md","pandas/3.installing-pandas.md","pandas/3.installing-pandas",{"_path":41,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":14,"_id":46,"_source":16,"_file":47,"_stem":48,"_extension":19},"/pandas/your-first-dataframe","Your First DataFrame","Create your first Pandas DataFrame and learn the basics of working with tabular data","your-first-dataframe",4,"content:pandas:4.your-first-dataframe.md","pandas/4.your-first-dataframe.md","pandas/4.your-first-dataframe",{"_path":50,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":14,"_id":55,"_source":16,"_file":56,"_stem":57,"_extension":19},"/pandas/series-vs-dataframe","Series vs DataFrame","Understand the difference between Pandas Series and DataFrames, and learn when to use each one","series-vs-dataframe",5,"content:pandas:5.series-vs-dataframe.md","pandas/5.series-vs-dataframe.md","pandas/5.series-vs-dataframe",{"_path":59,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":14,"_id":64,"_source":16,"_file":65,"_stem":66,"_extension":19},"/pandas/basic-dataframe-info","Basic DataFrame Info","Learn how to explore and get basic information about your DataFrames to understand your data","basic-dataframe-info",6,"content:pandas:6.basic-dataframe-info.md","pandas/6.basic-dataframe-info.md","pandas/6.basic-dataframe-info",{"_path":68,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":69,"description":70,"slug":71,"order":72,"isParent":12,"icon":73,"_type":14,"_id":74,"_source":16,"_file":75,"_stem":76,"_extension":19,"children":77,"expanded":12},"/pandas/loading-data","Loading Data","Learn how to load data from various sources into Pandas DataFrames","loading-data",7,"pi pi-download","content:pandas:7.loading-data.md","pandas/7.loading-data.md","pandas/7.loading-data",[78,87,96],{"_path":79,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":80,"description":81,"slug":82,"parentId":68,"order":83,"_type":14,"_id":84,"_source":16,"_file":85,"_stem":86,"_extension":19},"/pandas/reading-files","Reading Files (CSV, Excel, JSON)","Learn how to load data from CSV, Excel, and JSON files into Pandas DataFrames","reading-files",8,"content:pandas:8.reading-files.md","pandas/8.reading-files.md","pandas/8.reading-files",{"_path":88,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":89,"description":90,"slug":91,"parentId":68,"order":92,"_type":14,"_id":93,"_source":16,"_file":94,"_stem":95,"_extension":19},"/pandas/loading-from-databases","Loading from Databases","Learn how to connect to databases and load data directly into Pandas DataFrames","loading-from-databases",9,"content:pandas:9.loading-from-databases.md","pandas/9.loading-from-databases.md","pandas/9.loading-from-databases",{"_path":97,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":98,"description":99,"slug":100,"parentId":68,"order":101,"_type":14,"_id":102,"_source":16,"_file":103,"_stem":104,"_extension":19},"/pandas/handling-file-errors","Handling File Errors","Learn how to handle common errors when loading data files and how to troubleshoot loading problems","handling-file-errors",10,"content:pandas:10.handling-file-errors.md","pandas/10.handling-file-errors.md","pandas/10.handling-file-errors",{"_path":106,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":107,"description":108,"slug":109,"order":110,"isParent":12,"icon":111,"_type":14,"_id":112,"_source":16,"_file":113,"_stem":114,"_extension":19,"children":115,"expanded":12},"/pandas/data-exploration","Data Exploration","Learn how to explore and understand your data using Pandas methods and techniques","data-exploration",11,"pi pi-search","content:pandas:11.data-exploration.md","pandas/11.data-exploration.md","pandas/11.data-exploration",[116,125,134],{"_path":117,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":118,"description":119,"slug":120,"parentId":106,"order":121,"_type":14,"_id":122,"_source":16,"_file":123,"_stem":124,"_extension":19},"/pandas/viewing-your-data","Viewing Your Data","Learn different ways to look at and sample your DataFrame data for exploration and understanding","viewing-your-data",12,"content:pandas:12.viewing-your-data.md","pandas/12.viewing-your-data.md","pandas/12.viewing-your-data",{"_path":126,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":127,"description":128,"slug":129,"parentId":106,"order":130,"_type":14,"_id":131,"_source":16,"_file":132,"_stem":133,"_extension":19},"/pandas/data-shape-and-statistics","Data Shape and Statistics","Learn how to understand your DataFrame's size, structure, and get basic statistical summaries","data-shape-and-statistics",13,"content:pandas:13.data-shape-and-statistics.md","pandas/13.data-shape-and-statistics.md","pandas/13.data-shape-and-statistics",{"_path":135,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":136,"description":137,"slug":138,"parentId":106,"order":139,"_type":14,"_id":140,"_source":16,"_file":141,"_stem":142,"_extension":19},"/pandas/column-information-and-data-types","Column Information and Data Types","Learn how to explore individual columns and understand different data types in your DataFrames","column-information-and-data-types",14,"content:pandas:14.column-information-and-data-types.md","pandas/14.column-information-and-data-types.md","pandas/14.column-information-and-data-types",{"_path":144,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":145,"description":146,"slug":147,"order":148,"isParent":12,"icon":149,"_type":14,"_id":150,"_source":16,"_file":151,"_stem":152,"_extension":19,"children":153,"expanded":12},"/pandas/selecting-data","Selecting Data","Learn how to select specific columns, rows, and subsets of data from your DataFrames","selecting-data",15,"pi pi-filter","content:pandas:15.selecting-data.md","pandas/15.selecting-data.md","pandas/15.selecting-data",[154,163,172],{"_path":155,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":156,"description":157,"slug":158,"parentId":144,"order":159,"_type":14,"_id":160,"_source":16,"_file":161,"_stem":162,"_extension":19},"/pandas/selecting-columns-and-rows","Selecting Columns and Rows","Learn how to select specific columns and rows from your DataFrames using basic selection techniques","selecting-columns-and-rows",16,"content:pandas:16.selecting-columns-and-rows.md","pandas/16.selecting-columns-and-rows.md","pandas/16.selecting-columns-and-rows",{"_path":164,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":165,"description":166,"slug":167,"parentId":144,"order":168,"_type":14,"_id":169,"_source":16,"_file":170,"_stem":171,"_extension":19},"/pandas/using-loc-and-iloc","Using loc and iloc","Master precise data selection with label-based (loc) and position-based (iloc) indexing in pandas","using-loc-and-iloc",17,"content:pandas:17.using-loc-and-iloc.md","pandas/17.using-loc-and-iloc.md","pandas/17.using-loc-and-iloc",{"_path":173,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":174,"description":175,"slug":176,"parentId":144,"order":177,"_type":14,"_id":178,"_source":16,"_file":179,"_stem":180,"_extension":19},"/pandas/boolean-and-conditional-selection","Boolean and Conditional Selection","Learn to filter DataFrames using conditions, boolean logic, and multiple criteria for precise data selection","boolean-and-conditional-selection",18,"content:pandas:18.boolean-and-conditional-selection.md","pandas/18.boolean-and-conditional-selection.md","pandas/18.boolean-and-conditional-selection",{"_path":182,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":183,"description":184,"slug":185,"order":186,"isParent":12,"icon":187,"_type":14,"_id":188,"_source":16,"_file":189,"_stem":190,"_extension":19,"children":191,"expanded":12},"/pandas/data-cleaning","Data Cleaning","Learn essential data cleaning techniques to prepare messy data for analysis","data-cleaning",19,"pi pi-wrench","content:pandas:19.data-cleaning.md","pandas/19.data-cleaning.md","pandas/19.data-cleaning",[192,201,210,219],{"_path":193,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":194,"description":195,"slug":196,"parentId":182,"order":197,"_type":14,"_id":198,"_source":16,"_file":199,"_stem":200,"_extension":19},"/pandas/handling-missing-data","Handling Missing Data","Learn to identify, fill, and remove missing values in your DataFrames effectively","handling-missing-data",20,"content:pandas:20.handling-missing-data.md","pandas/20.handling-missing-data.md","pandas/20.handling-missing-data",{"_path":202,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":203,"description":204,"slug":205,"parentId":182,"order":206,"_type":14,"_id":207,"_source":16,"_file":208,"_stem":209,"_extension":19},"/pandas/removing-duplicates","Removing Duplicates","Learn to find and eliminate duplicate rows from your DataFrames to ensure data quality","removing-duplicates",21,"content:pandas:21.removing-duplicates.md","pandas/21.removing-duplicates.md","pandas/21.removing-duplicates",{"_path":211,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":212,"description":213,"slug":214,"parentId":182,"order":215,"_type":14,"_id":216,"_source":16,"_file":217,"_stem":218,"_extension":19},"/pandas/data-type-conversion","Data Type Conversion","Learn to convert data to the right types for proper analysis and calculations","data-type-conversion",22,"content:pandas:22.data-type-conversion.md","pandas/22.data-type-conversion.md","pandas/22.data-type-conversion",{"_path":220,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":221,"description":222,"slug":223,"parentId":182,"order":224,"_type":14,"_id":225,"_source":16,"_file":226,"_stem":227,"_extension":19},"/pandas/string-cleaning-operations","String Cleaning Operations","Learn to clean and standardize text data for consistent analysis using pandas string methods","string-cleaning-operations",23,"content:pandas:23.string-cleaning-operations.md","pandas/23.string-cleaning-operations.md","pandas/23.string-cleaning-operations",{"_path":229,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":230,"description":231,"slug":232,"order":233,"isParent":12,"icon":234,"_type":14,"_id":235,"_source":16,"_file":236,"_stem":237,"_extension":19,"children":238,"expanded":12},"/pandas/data-transformation","Data Transformation","Learn how to modify, add, and transform data in your DataFrames for analysis","data-transformation",24,"pi pi-folder","content:pandas:24.data-transformation.md","pandas/24.data-transformation.md","pandas/24.data-transformation",[239,248,257],{"_path":240,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":241,"description":242,"slug":243,"parentId":229,"order":244,"_type":14,"_id":245,"_source":16,"_file":246,"_stem":247,"_extension":19},"/pandas/adding-and-modifying-columns","Adding and Modifying Columns","Learn how to create new columns and update existing ones with calculations and conditional logic","adding-and-modifying-columns",25,"content:pandas:25.adding-and-modifying-columns.md","pandas/25.adding-and-modifying-columns.md","pandas/25.adding-and-modifying-columns",{"_path":249,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":250,"description":251,"slug":252,"parentId":229,"order":253,"_type":14,"_id":254,"_source":16,"_file":255,"_stem":256,"_extension":19},"/pandas/applying-functions","Applying Functions","Use built-in and custom functions to transform your data efficiently","applying-functions",26,"content:pandas:26.applying-functions.md","pandas/26.applying-functions.md","pandas/26.applying-functions",{"_path":258,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":259,"description":260,"slug":261,"parentId":229,"order":262,"_type":14,"_id":263,"_source":16,"_file":264,"_stem":265,"_extension":19},"/pandas/renaming-and-sorting-data","Renaming and Sorting Data","Organize your DataFrame with better column names and logical data ordering","renaming-and-sorting-data",27,"content:pandas:27.renaming-and-sorting-data.md","pandas/27.renaming-and-sorting-data.md","pandas/27.renaming-and-sorting-data",{"_path":267,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":268,"description":269,"slug":270,"order":271,"isParent":12,"icon":234,"_type":14,"_id":272,"_source":16,"_file":273,"_stem":274,"_extension":19,"children":275},"/pandas/grouping-and-aggregation","Grouping and Aggregation","Learn to group data and calculate summary statistics for powerful data analysis","grouping-and-aggregation",28,"content:pandas:28.grouping-and-aggregation.md","pandas/28.grouping-and-aggregation.md","pandas/28.grouping-and-aggregation",[276,285,294],{"_path":277,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":278,"description":279,"slug":280,"parentId":267,"order":281,"_type":14,"_id":282,"_source":16,"_file":283,"_stem":284,"_extension":19},"/pandas/groupby-operations","GroupBy Operations","Learn the fundamentals of splitting data into groups and basic aggregations","groupby-operations",29,"content:pandas:29.groupby-operations.md","pandas/29.groupby-operations.md","pandas/29.groupby-operations",{"_path":286,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":287,"description":288,"slug":289,"parentId":267,"order":290,"_type":14,"_id":291,"_source":16,"_file":292,"_stem":293,"_extension":19},"/pandas/aggregation-functions","Aggregation Functions","Explore different ways to summarize your grouped data with built-in and custom functions","aggregation-functions",30,"content:pandas:30.aggregation-functions.md","pandas/30.aggregation-functions.md","pandas/30.aggregation-functions",{"_path":295,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":296,"description":297,"slug":298,"parentId":267,"order":299,"_type":14,"_id":300,"_source":16,"_file":301,"_stem":302,"_extension":19},"/pandas/pivot-tables-and-cross-tabulation","Pivot Tables and Cross Tabulation","Create powerful summary tables and cross-tabulations for analysis","pivot-tables-and-cross-tabulation",31,"content:pandas:31.pivot-tables-and-cross-tabulation.md","pandas/31.pivot-tables-and-cross-tabulation.md","pandas/31.pivot-tables-and-cross-tabulation",{"_path":304,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":305,"description":306,"slug":307,"order":308,"isParent":12,"icon":234,"_type":14,"_id":309,"_source":16,"_file":310,"_stem":311,"_extension":19,"children":312},"/pandas/combining-data","Combining Data","Learn to combine data from multiple DataFrames for comprehensive analysis","combining-data",32,"content:pandas:32.combining-data.md","pandas/32.combining-data.md","pandas/32.combining-data",[313,322],{"_path":314,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":315,"description":316,"slug":317,"parentId":304,"order":318,"_type":14,"_id":319,"_source":16,"_file":320,"_stem":321,"_extension":19},"/pandas/concatenating-dataframes","Concatenating DataFrames","Learn to stack DataFrames vertically and horizontally for simple data combination","concatenating-dataframes",33,"content:pandas:33.concatenating-dataframes.md","pandas/33.concatenating-dataframes.md","pandas/33.concatenating-dataframes",{"_path":323,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":324,"description":325,"slug":326,"parentId":304,"order":327,"_type":14,"_id":328,"_source":16,"_file":329,"_stem":330,"_extension":19},"/pandas/merging-and-join-operations","Merging and Join Operations","Master different types of joins to combine related data from multiple sources","merging-and-join-operations",34,"content:pandas:34.merging-and-join-operations.md","pandas/34.merging-and-join-operations.md","pandas/34.merging-and-join-operations",{"_path":332,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":333,"description":334,"slug":335,"order":336,"isParent":12,"icon":234,"_type":14,"_id":337,"_source":16,"_file":338,"_stem":339,"_extension":19,"children":340},"/pandas/working-with-dates","Working with Dates","Master date and time operations for time-based analysis and reporting","working-with-dates",35,"content:pandas:35.working-with-dates.md","pandas/35.working-with-dates.md","pandas/35.working-with-dates",[341,350],{"_path":342,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":343,"description":344,"slug":345,"parentId":332,"order":346,"_type":14,"_id":347,"_source":16,"_file":348,"_stem":349,"_extension":19},"/pandas/datetime-operations","DateTime Operations","Learn to convert, manipulate, and extract information from dates and times","datetime-operations",36,"content:pandas:36.datetime-operations.md","pandas/36.datetime-operations.md","pandas/36.datetime-operations",{"_path":351,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":352,"description":353,"slug":354,"parentId":332,"order":355,"_type":14,"_id":356,"_source":16,"_file":357,"_stem":358,"_extension":19},"/pandas/time-series-and-resampling","Time Series and Resampling","Discover how to analyze data over time periods and aggregate by different time intervals","time-series-and-resampling",37,"content:pandas:37.time-series-and-resampling.md","pandas/37.time-series-and-resampling.md","pandas/37.time-series-and-resampling",{"_path":360,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":361,"description":362,"slug":363,"order":364,"isParent":12,"icon":234,"_type":14,"_id":365,"_source":16,"_file":366,"_stem":367,"_extension":19,"children":368},"/pandas/saving-your-work","Saving Your Work","Learn to export your analyzed data to different formats for sharing and reporting","saving-your-work",38,"content:pandas:38.saving-your-work.md","pandas/38.saving-your-work.md","pandas/38.saving-your-work",[369,378],{"_path":370,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":371,"description":372,"slug":373,"parentId":360,"order":374,"_type":14,"_id":375,"_source":16,"_file":376,"_stem":377,"_extension":19},"/pandas/exporting-data","Exporting Data (CSV, Excel, JSON)","Learn to save your DataFrames to common file formats for sharing and reporting","exporting-data",39,"content:pandas:39.exporting-data.md","pandas/39.exporting-data.md","pandas/39.exporting-data",{"_path":379,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":380,"description":381,"slug":382,"parentId":360,"order":383,"_type":14,"_id":384,"_source":16,"_file":385,"_stem":386,"_extension":19},"/pandas/database-export","Database Export","Discover how to save data back to databases for integration with other systems","database-export",40,"content:pandas:40.database-export.md","pandas/40.database-export.md","pandas/40.database-export",[248],{"_path":249,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":250,"description":251,"slug":252,"parentId":229,"order":253,"body":389,"_type":14,"_id":254,"_source":16,"_file":255,"_stem":256,"_extension":19},{"type":390,"children":391,"toc":5225},"root",[392,400,406,411,906,913,918,1060,1066,1071,1458,1465,1602,1608,1613,2079,2085,2090,2175,2181,2715,2721,2726,3527,3533,3538,4335,4341,4483,4489,4501,5009,5015,5189,5195,5200,5214,5219],{"type":393,"tag":394,"props":395,"children":396},"element","h1",{"id":252},[397],{"type":398,"value":399},"text","🔧 Applying Functions",{"type":393,"tag":401,"props":402,"children":403},"p",{},[404],{"type":398,"value":405},"Functions are incredibly powerful tools for transforming data! Instead of writing complex loops, you can apply functions to entire columns or DataFrames at once. This makes your code faster, cleaner, and more readable.",{"type":393,"tag":401,"props":407,"children":408},{},[409],{"type":398,"value":410},"Think of functions as specialized tools - each one designed for a specific job, and pandas helps you use them efficiently on your data.",{"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 data\ncustomers = pd.DataFrame({\n    'name': ['alice smith', 'BOB JONES', 'Charlie Brown'],\n    'email': ['ALICE@email.com', 'bob@EMAIL.COM', 'charlie@company.org'],\n    'age': [25, 30, 35]\n})\n\nprint(\"Original data:\")\nprint(customers)\nprint()\n\n# Apply functions to clean the data\ncustomers['name_clean'] = customers['name'].str.title()\ncustomers['email_clean'] = customers['email'].str.lower()\ncustomers['age_group'] = customers['age'].apply(lambda x: 'Young' if x \u003C 30 else 'Older')\n\nprint(\"After applying functions:\")\nprint(customers[['name_clean', 'email_clean', 'age_group']])\n","python",[422],{"type":393,"tag":423,"props":424,"children":425},"code",{"__ignoreMap":6},[426,453,461,470,488,531,570,611,619,626,649,661,673,680,688,725,759,842,849,869],{"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 data\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,507,512,517,521,526],{"type":393,"tag":427,"props":492,"children":494},{"style":493},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[495],{"type":398,"value":496},"    'name'",{"type":393,"tag":427,"props":498,"children":499},{"style":439},[500],{"type":398,"value":501},": [",{"type":393,"tag":427,"props":503,"children":504},{"style":493},[505],{"type":398,"value":506},"'alice smith'",{"type":393,"tag":427,"props":508,"children":509},{"style":439},[510],{"type":398,"value":511},", ",{"type":393,"tag":427,"props":513,"children":514},{"style":493},[515],{"type":398,"value":516},"'BOB JONES'",{"type":393,"tag":427,"props":518,"children":519},{"style":439},[520],{"type":398,"value":511},{"type":393,"tag":427,"props":522,"children":523},{"style":493},[524],{"type":398,"value":525},"'Charlie Brown'",{"type":393,"tag":427,"props":527,"children":528},{"style":439},[529],{"type":398,"value":530},"],\n",{"type":393,"tag":427,"props":532,"children":533},{"class":429,"line":63},[534,539,543,548,552,557,561,566],{"type":393,"tag":427,"props":535,"children":536},{"style":493},[537],{"type":398,"value":538},"    'email'",{"type":393,"tag":427,"props":540,"children":541},{"style":439},[542],{"type":398,"value":501},{"type":393,"tag":427,"props":544,"children":545},{"style":493},[546],{"type":398,"value":547},"'ALICE@email.com'",{"type":393,"tag":427,"props":549,"children":550},{"style":439},[551],{"type":398,"value":511},{"type":393,"tag":427,"props":553,"children":554},{"style":493},[555],{"type":398,"value":556},"'bob@EMAIL.COM'",{"type":393,"tag":427,"props":558,"children":559},{"style":439},[560],{"type":398,"value":511},{"type":393,"tag":427,"props":562,"children":563},{"style":493},[564],{"type":398,"value":565},"'charlie@company.org'",{"type":393,"tag":427,"props":567,"children":568},{"style":439},[569],{"type":398,"value":530},{"type":393,"tag":427,"props":571,"children":572},{"class":429,"line":72},[573,578,582,588,592,597,601,606],{"type":393,"tag":427,"props":574,"children":575},{"style":493},[576],{"type":398,"value":577},"    'age'",{"type":393,"tag":427,"props":579,"children":580},{"style":439},[581],{"type":398,"value":501},{"type":393,"tag":427,"props":583,"children":585},{"style":584},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[586],{"type":398,"value":587},"25",{"type":393,"tag":427,"props":589,"children":590},{"style":439},[591],{"type":398,"value":511},{"type":393,"tag":427,"props":593,"children":594},{"style":584},[595],{"type":398,"value":596},"30",{"type":393,"tag":427,"props":598,"children":599},{"style":439},[600],{"type":398,"value":511},{"type":393,"tag":427,"props":602,"children":603},{"style":584},[604],{"type":398,"value":605},"35",{"type":393,"tag":427,"props":607,"children":608},{"style":439},[609],{"type":398,"value":610},"]\n",{"type":393,"tag":427,"props":612,"children":613},{"class":429,"line":83},[614],{"type":393,"tag":427,"props":615,"children":616},{"style":439},[617],{"type":398,"value":618},"})\n",{"type":393,"tag":427,"props":620,"children":621},{"class":429,"line":92},[622],{"type":393,"tag":427,"props":623,"children":624},{"emptyLinePlaceholder":12},[625],{"type":398,"value":460},{"type":393,"tag":427,"props":627,"children":628},{"class":429,"line":101},[629,634,639,644],{"type":393,"tag":427,"props":630,"children":631},{"style":584},[632],{"type":398,"value":633},"print",{"type":393,"tag":427,"props":635,"children":636},{"style":439},[637],{"type":398,"value":638},"(",{"type":393,"tag":427,"props":640,"children":641},{"style":493},[642],{"type":398,"value":643},"\"Original data:\"",{"type":393,"tag":427,"props":645,"children":646},{"style":439},[647],{"type":398,"value":648},")\n",{"type":393,"tag":427,"props":650,"children":651},{"class":429,"line":110},[652,656],{"type":393,"tag":427,"props":653,"children":654},{"style":584},[655],{"type":398,"value":633},{"type":393,"tag":427,"props":657,"children":658},{"style":439},[659],{"type":398,"value":660},"(customers)\n",{"type":393,"tag":427,"props":662,"children":663},{"class":429,"line":121},[664,668],{"type":393,"tag":427,"props":665,"children":666},{"style":584},[667],{"type":398,"value":633},{"type":393,"tag":427,"props":669,"children":670},{"style":439},[671],{"type":398,"value":672},"()\n",{"type":393,"tag":427,"props":674,"children":675},{"class":429,"line":130},[676],{"type":393,"tag":427,"props":677,"children":678},{"emptyLinePlaceholder":12},[679],{"type":398,"value":460},{"type":393,"tag":427,"props":681,"children":682},{"class":429,"line":139},[683],{"type":393,"tag":427,"props":684,"children":685},{"style":466},[686],{"type":398,"value":687},"# Apply functions to clean the data\n",{"type":393,"tag":427,"props":689,"children":690},{"class":429,"line":148},[691,696,701,706,710,715,720],{"type":393,"tag":427,"props":692,"children":693},{"style":439},[694],{"type":398,"value":695},"customers[",{"type":393,"tag":427,"props":697,"children":698},{"style":493},[699],{"type":398,"value":700},"'name_clean'",{"type":393,"tag":427,"props":702,"children":703},{"style":439},[704],{"type":398,"value":705},"] ",{"type":393,"tag":427,"props":707,"children":708},{"style":433},[709],{"type":398,"value":482},{"type":393,"tag":427,"props":711,"children":712},{"style":439},[713],{"type":398,"value":714}," customers[",{"type":393,"tag":427,"props":716,"children":717},{"style":493},[718],{"type":398,"value":719},"'name'",{"type":393,"tag":427,"props":721,"children":722},{"style":439},[723],{"type":398,"value":724},"].str.title()\n",{"type":393,"tag":427,"props":726,"children":727},{"class":429,"line":159},[728,732,737,741,745,749,754],{"type":393,"tag":427,"props":729,"children":730},{"style":439},[731],{"type":398,"value":695},{"type":393,"tag":427,"props":733,"children":734},{"style":493},[735],{"type":398,"value":736},"'email_clean'",{"type":393,"tag":427,"props":738,"children":739},{"style":439},[740],{"type":398,"value":705},{"type":393,"tag":427,"props":742,"children":743},{"style":433},[744],{"type":398,"value":482},{"type":393,"tag":427,"props":746,"children":747},{"style":439},[748],{"type":398,"value":714},{"type":393,"tag":427,"props":750,"children":751},{"style":493},[752],{"type":398,"value":753},"'email'",{"type":393,"tag":427,"props":755,"children":756},{"style":439},[757],{"type":398,"value":758},"].str.lower()\n",{"type":393,"tag":427,"props":760,"children":761},{"class":429,"line":168},[762,766,771,775,779,783,788,793,798,803,808,813,818,823,828,833,838],{"type":393,"tag":427,"props":763,"children":764},{"style":439},[765],{"type":398,"value":695},{"type":393,"tag":427,"props":767,"children":768},{"style":493},[769],{"type":398,"value":770},"'age_group'",{"type":393,"tag":427,"props":772,"children":773},{"style":439},[774],{"type":398,"value":705},{"type":393,"tag":427,"props":776,"children":777},{"style":433},[778],{"type":398,"value":482},{"type":393,"tag":427,"props":780,"children":781},{"style":439},[782],{"type":398,"value":714},{"type":393,"tag":427,"props":784,"children":785},{"style":493},[786],{"type":398,"value":787},"'age'",{"type":393,"tag":427,"props":789,"children":790},{"style":439},[791],{"type":398,"value":792},"].apply(",{"type":393,"tag":427,"props":794,"children":795},{"style":433},[796],{"type":398,"value":797},"lambda",{"type":393,"tag":427,"props":799,"children":800},{"style":439},[801],{"type":398,"value":802}," x: ",{"type":393,"tag":427,"props":804,"children":805},{"style":493},[806],{"type":398,"value":807},"'Young'",{"type":393,"tag":427,"props":809,"children":810},{"style":433},[811],{"type":398,"value":812}," if",{"type":393,"tag":427,"props":814,"children":815},{"style":439},[816],{"type":398,"value":817}," x ",{"type":393,"tag":427,"props":819,"children":820},{"style":433},[821],{"type":398,"value":822},"\u003C",{"type":393,"tag":427,"props":824,"children":825},{"style":584},[826],{"type":398,"value":827}," 30",{"type":393,"tag":427,"props":829,"children":830},{"style":433},[831],{"type":398,"value":832}," else",{"type":393,"tag":427,"props":834,"children":835},{"style":493},[836],{"type":398,"value":837}," 'Older'",{"type":393,"tag":427,"props":839,"children":840},{"style":439},[841],{"type":398,"value":648},{"type":393,"tag":427,"props":843,"children":844},{"class":429,"line":177},[845],{"type":393,"tag":427,"props":846,"children":847},{"emptyLinePlaceholder":12},[848],{"type":398,"value":460},{"type":393,"tag":427,"props":850,"children":851},{"class":429,"line":186},[852,856,860,865],{"type":393,"tag":427,"props":853,"children":854},{"style":584},[855],{"type":398,"value":633},{"type":393,"tag":427,"props":857,"children":858},{"style":439},[859],{"type":398,"value":638},{"type":393,"tag":427,"props":861,"children":862},{"style":493},[863],{"type":398,"value":864},"\"After applying functions:\"",{"type":393,"tag":427,"props":866,"children":867},{"style":439},[868],{"type":398,"value":648},{"type":393,"tag":427,"props":870,"children":871},{"class":429,"line":197},[872,876,881,885,889,893,897,901],{"type":393,"tag":427,"props":873,"children":874},{"style":584},[875],{"type":398,"value":633},{"type":393,"tag":427,"props":877,"children":878},{"style":439},[879],{"type":398,"value":880},"(customers[[",{"type":393,"tag":427,"props":882,"children":883},{"style":493},[884],{"type":398,"value":700},{"type":393,"tag":427,"props":886,"children":887},{"style":439},[888],{"type":398,"value":511},{"type":393,"tag":427,"props":890,"children":891},{"style":493},[892],{"type":398,"value":736},{"type":393,"tag":427,"props":894,"children":895},{"style":439},[896],{"type":398,"value":511},{"type":393,"tag":427,"props":898,"children":899},{"style":493},[900],{"type":398,"value":770},{"type":393,"tag":427,"props":902,"children":903},{"style":439},[904],{"type":398,"value":905},"]])\n",{"type":393,"tag":907,"props":908,"children":910},"h2",{"id":909},"what-are-functions-in-pandas",[911],{"type":398,"value":912},"🎯 What Are Functions in Pandas?",{"type":393,"tag":401,"props":914,"children":915},{},[916],{"type":398,"value":917},"Functions are instructions that transform data. Pandas provides many built-in functions, and you can create your own custom ones.",{"type":393,"tag":919,"props":920,"children":924},"info-box",{"emoji":921,"title":922,"type":923},"🔧","Types of Functions in Pandas","info",[925,934,1000,1008,1034,1042],{"type":393,"tag":401,"props":926,"children":927},{},[928],{"type":393,"tag":929,"props":930,"children":931},"strong",{},[932],{"type":398,"value":933},"Built-in Functions:",{"type":393,"tag":935,"props":936,"children":937},"ul",{},[938,957,982],{"type":393,"tag":939,"props":940,"children":941},"li",{},[942,944,950,951],{"type":398,"value":943},"String methods: ",{"type":393,"tag":423,"props":945,"children":947},{"className":946},[],[948],{"type":398,"value":949},".str.upper()",{"type":398,"value":511},{"type":393,"tag":423,"props":952,"children":954},{"className":953},[],[955],{"type":398,"value":956},".str.replace()",{"type":393,"tag":939,"props":958,"children":959},{},[960,962,968,969,975,976],{"type":398,"value":961},"Math functions: ",{"type":393,"tag":423,"props":963,"children":965},{"className":964},[],[966],{"type":398,"value":967},".abs()",{"type":398,"value":511},{"type":393,"tag":423,"props":970,"children":972},{"className":971},[],[973],{"type":398,"value":974},".round()",{"type":398,"value":511},{"type":393,"tag":423,"props":977,"children":979},{"className":978},[],[980],{"type":398,"value":981},".sqrt()",{"type":393,"tag":939,"props":983,"children":984},{},[985,987,993,994],{"type":398,"value":986},"Date functions: ",{"type":393,"tag":423,"props":988,"children":990},{"className":989},[],[991],{"type":398,"value":992},".dt.year",{"type":398,"value":511},{"type":393,"tag":423,"props":995,"children":997},{"className":996},[],[998],{"type":398,"value":999},".dt.month",{"type":393,"tag":401,"props":1001,"children":1002},{},[1003],{"type":393,"tag":929,"props":1004,"children":1005},{},[1006],{"type":398,"value":1007},"Custom Functions:",{"type":393,"tag":935,"props":1009,"children":1010},{},[1011,1016,1021],{"type":393,"tag":939,"props":1012,"children":1013},{},[1014],{"type":398,"value":1015},"Lambda functions: Quick one-line functions",{"type":393,"tag":939,"props":1017,"children":1018},{},[1019],{"type":398,"value":1020},"Regular functions: More complex logic",{"type":393,"tag":939,"props":1022,"children":1023},{},[1024,1026,1032],{"type":398,"value":1025},"Applied with ",{"type":393,"tag":423,"props":1027,"children":1029},{"className":1028},[],[1030],{"type":398,"value":1031},".apply()",{"type":398,"value":1033}," method",{"type":393,"tag":401,"props":1035,"children":1036},{},[1037],{"type":393,"tag":929,"props":1038,"children":1039},{},[1040],{"type":398,"value":1041},"Why Use Functions:",{"type":393,"tag":935,"props":1043,"children":1044},{},[1045,1050,1055],{"type":393,"tag":939,"props":1046,"children":1047},{},[1048],{"type":398,"value":1049},"Transform entire columns at once",{"type":393,"tag":939,"props":1051,"children":1052},{},[1053],{"type":398,"value":1054},"Avoid writing loops",{"type":393,"tag":939,"props":1056,"children":1057},{},[1058],{"type":398,"value":1059},"Make code more readable and maintainable",{"type":393,"tag":907,"props":1061,"children":1063},{"id":1062},"string-functions",[1064],{"type":398,"value":1065},"📝 String Functions",{"type":393,"tag":401,"props":1067,"children":1068},{},[1069],{"type":398,"value":1070},"String functions help you clean and format text data:",{"type":393,"tag":412,"props":1072,"children":1073},{},[1074],{"type":393,"tag":416,"props":1075,"children":1077},{"className":418,"code":1076,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Messy text data\ndata = pd.DataFrame({\n    'product': ['  iPhone 14  ', 'SAMSUNG GALAXY', 'google pixel'],\n    'description': ['Latest Apple phone', 'Android smartphone', 'Google phone']\n})\n\nprint(\"Messy data:\")\nprint(data)\nprint()\n\n# Apply string functions\ndata['product_clean'] = data['product'].str.strip().str.title()\ndata['product_upper'] = data['product'].str.upper()\ndata['description_short'] = data['description'].str[:10] + '...'\n\nprint(\"Cleaned data:\")\nprint(data[['product_clean', 'description_short']])\n",[1078],{"type":393,"tag":423,"props":1079,"children":1080},{"__ignoreMap":6},[1081,1100,1107,1115,1131,1170,1209,1216,1223,1243,1255,1266,1273,1281,1317,1350,1403,1410,1430],{"type":393,"tag":427,"props":1082,"children":1083},{"class":429,"line":11},[1084,1088,1092,1096],{"type":393,"tag":427,"props":1085,"children":1086},{"style":433},[1087],{"type":398,"value":436},{"type":393,"tag":427,"props":1089,"children":1090},{"style":439},[1091],{"type":398,"value":442},{"type":393,"tag":427,"props":1093,"children":1094},{"style":433},[1095],{"type":398,"value":447},{"type":393,"tag":427,"props":1097,"children":1098},{"style":439},[1099],{"type":398,"value":452},{"type":393,"tag":427,"props":1101,"children":1102},{"class":429,"line":27},[1103],{"type":393,"tag":427,"props":1104,"children":1105},{"emptyLinePlaceholder":12},[1106],{"type":398,"value":460},{"type":393,"tag":427,"props":1108,"children":1109},{"class":429,"line":36},[1110],{"type":393,"tag":427,"props":1111,"children":1112},{"style":466},[1113],{"type":398,"value":1114},"# Messy text data\n",{"type":393,"tag":427,"props":1116,"children":1117},{"class":429,"line":45},[1118,1123,1127],{"type":393,"tag":427,"props":1119,"children":1120},{"style":439},[1121],{"type":398,"value":1122},"data ",{"type":393,"tag":427,"props":1124,"children":1125},{"style":433},[1126],{"type":398,"value":482},{"type":393,"tag":427,"props":1128,"children":1129},{"style":439},[1130],{"type":398,"value":487},{"type":393,"tag":427,"props":1132,"children":1133},{"class":429,"line":54},[1134,1139,1143,1148,1152,1157,1161,1166],{"type":393,"tag":427,"props":1135,"children":1136},{"style":493},[1137],{"type":398,"value":1138},"    'product'",{"type":393,"tag":427,"props":1140,"children":1141},{"style":439},[1142],{"type":398,"value":501},{"type":393,"tag":427,"props":1144,"children":1145},{"style":493},[1146],{"type":398,"value":1147},"'  iPhone 14  '",{"type":393,"tag":427,"props":1149,"children":1150},{"style":439},[1151],{"type":398,"value":511},{"type":393,"tag":427,"props":1153,"children":1154},{"style":493},[1155],{"type":398,"value":1156},"'SAMSUNG GALAXY'",{"type":393,"tag":427,"props":1158,"children":1159},{"style":439},[1160],{"type":398,"value":511},{"type":393,"tag":427,"props":1162,"children":1163},{"style":493},[1164],{"type":398,"value":1165},"'google pixel'",{"type":393,"tag":427,"props":1167,"children":1168},{"style":439},[1169],{"type":398,"value":530},{"type":393,"tag":427,"props":1171,"children":1172},{"class":429,"line":63},[1173,1178,1182,1187,1191,1196,1200,1205],{"type":393,"tag":427,"props":1174,"children":1175},{"style":493},[1176],{"type":398,"value":1177},"    'description'",{"type":393,"tag":427,"props":1179,"children":1180},{"style":439},[1181],{"type":398,"value":501},{"type":393,"tag":427,"props":1183,"children":1184},{"style":493},[1185],{"type":398,"value":1186},"'Latest Apple phone'",{"type":393,"tag":427,"props":1188,"children":1189},{"style":439},[1190],{"type":398,"value":511},{"type":393,"tag":427,"props":1192,"children":1193},{"style":493},[1194],{"type":398,"value":1195},"'Android smartphone'",{"type":393,"tag":427,"props":1197,"children":1198},{"style":439},[1199],{"type":398,"value":511},{"type":393,"tag":427,"props":1201,"children":1202},{"style":493},[1203],{"type":398,"value":1204},"'Google phone'",{"type":393,"tag":427,"props":1206,"children":1207},{"style":439},[1208],{"type":398,"value":610},{"type":393,"tag":427,"props":1210,"children":1211},{"class":429,"line":72},[1212],{"type":393,"tag":427,"props":1213,"children":1214},{"style":439},[1215],{"type":398,"value":618},{"type":393,"tag":427,"props":1217,"children":1218},{"class":429,"line":83},[1219],{"type":393,"tag":427,"props":1220,"children":1221},{"emptyLinePlaceholder":12},[1222],{"type":398,"value":460},{"type":393,"tag":427,"props":1224,"children":1225},{"class":429,"line":92},[1226,1230,1234,1239],{"type":393,"tag":427,"props":1227,"children":1228},{"style":584},[1229],{"type":398,"value":633},{"type":393,"tag":427,"props":1231,"children":1232},{"style":439},[1233],{"type":398,"value":638},{"type":393,"tag":427,"props":1235,"children":1236},{"style":493},[1237],{"type":398,"value":1238},"\"Messy data:\"",{"type":393,"tag":427,"props":1240,"children":1241},{"style":439},[1242],{"type":398,"value":648},{"type":393,"tag":427,"props":1244,"children":1245},{"class":429,"line":101},[1246,1250],{"type":393,"tag":427,"props":1247,"children":1248},{"style":584},[1249],{"type":398,"value":633},{"type":393,"tag":427,"props":1251,"children":1252},{"style":439},[1253],{"type":398,"value":1254},"(data)\n",{"type":393,"tag":427,"props":1256,"children":1257},{"class":429,"line":110},[1258,1262],{"type":393,"tag":427,"props":1259,"children":1260},{"style":584},[1261],{"type":398,"value":633},{"type":393,"tag":427,"props":1263,"children":1264},{"style":439},[1265],{"type":398,"value":672},{"type":393,"tag":427,"props":1267,"children":1268},{"class":429,"line":121},[1269],{"type":393,"tag":427,"props":1270,"children":1271},{"emptyLinePlaceholder":12},[1272],{"type":398,"value":460},{"type":393,"tag":427,"props":1274,"children":1275},{"class":429,"line":130},[1276],{"type":393,"tag":427,"props":1277,"children":1278},{"style":466},[1279],{"type":398,"value":1280},"# Apply string functions\n",{"type":393,"tag":427,"props":1282,"children":1283},{"class":429,"line":139},[1284,1289,1294,1298,1302,1307,1312],{"type":393,"tag":427,"props":1285,"children":1286},{"style":439},[1287],{"type":398,"value":1288},"data[",{"type":393,"tag":427,"props":1290,"children":1291},{"style":493},[1292],{"type":398,"value":1293},"'product_clean'",{"type":393,"tag":427,"props":1295,"children":1296},{"style":439},[1297],{"type":398,"value":705},{"type":393,"tag":427,"props":1299,"children":1300},{"style":433},[1301],{"type":398,"value":482},{"type":393,"tag":427,"props":1303,"children":1304},{"style":439},[1305],{"type":398,"value":1306}," data[",{"type":393,"tag":427,"props":1308,"children":1309},{"style":493},[1310],{"type":398,"value":1311},"'product'",{"type":393,"tag":427,"props":1313,"children":1314},{"style":439},[1315],{"type":398,"value":1316},"].str.strip().str.title()\n",{"type":393,"tag":427,"props":1318,"children":1319},{"class":429,"line":148},[1320,1324,1329,1333,1337,1341,1345],{"type":393,"tag":427,"props":1321,"children":1322},{"style":439},[1323],{"type":398,"value":1288},{"type":393,"tag":427,"props":1325,"children":1326},{"style":493},[1327],{"type":398,"value":1328},"'product_upper'",{"type":393,"tag":427,"props":1330,"children":1331},{"style":439},[1332],{"type":398,"value":705},{"type":393,"tag":427,"props":1334,"children":1335},{"style":433},[1336],{"type":398,"value":482},{"type":393,"tag":427,"props":1338,"children":1339},{"style":439},[1340],{"type":398,"value":1306},{"type":393,"tag":427,"props":1342,"children":1343},{"style":493},[1344],{"type":398,"value":1311},{"type":393,"tag":427,"props":1346,"children":1347},{"style":439},[1348],{"type":398,"value":1349},"].str.upper()\n",{"type":393,"tag":427,"props":1351,"children":1352},{"class":429,"line":159},[1353,1357,1362,1366,1370,1374,1379,1384,1389,1393,1398],{"type":393,"tag":427,"props":1354,"children":1355},{"style":439},[1356],{"type":398,"value":1288},{"type":393,"tag":427,"props":1358,"children":1359},{"style":493},[1360],{"type":398,"value":1361},"'description_short'",{"type":393,"tag":427,"props":1363,"children":1364},{"style":439},[1365],{"type":398,"value":705},{"type":393,"tag":427,"props":1367,"children":1368},{"style":433},[1369],{"type":398,"value":482},{"type":393,"tag":427,"props":1371,"children":1372},{"style":439},[1373],{"type":398,"value":1306},{"type":393,"tag":427,"props":1375,"children":1376},{"style":493},[1377],{"type":398,"value":1378},"'description'",{"type":393,"tag":427,"props":1380,"children":1381},{"style":439},[1382],{"type":398,"value":1383},"].str[:",{"type":393,"tag":427,"props":1385,"children":1386},{"style":584},[1387],{"type":398,"value":1388},"10",{"type":393,"tag":427,"props":1390,"children":1391},{"style":439},[1392],{"type":398,"value":705},{"type":393,"tag":427,"props":1394,"children":1395},{"style":433},[1396],{"type":398,"value":1397},"+",{"type":393,"tag":427,"props":1399,"children":1400},{"style":493},[1401],{"type":398,"value":1402}," '...'\n",{"type":393,"tag":427,"props":1404,"children":1405},{"class":429,"line":168},[1406],{"type":393,"tag":427,"props":1407,"children":1408},{"emptyLinePlaceholder":12},[1409],{"type":398,"value":460},{"type":393,"tag":427,"props":1411,"children":1412},{"class":429,"line":177},[1413,1417,1421,1426],{"type":393,"tag":427,"props":1414,"children":1415},{"style":584},[1416],{"type":398,"value":633},{"type":393,"tag":427,"props":1418,"children":1419},{"style":439},[1420],{"type":398,"value":638},{"type":393,"tag":427,"props":1422,"children":1423},{"style":493},[1424],{"type":398,"value":1425},"\"Cleaned data:\"",{"type":393,"tag":427,"props":1427,"children":1428},{"style":439},[1429],{"type":398,"value":648},{"type":393,"tag":427,"props":1431,"children":1432},{"class":429,"line":186},[1433,1437,1442,1446,1450,1454],{"type":393,"tag":427,"props":1434,"children":1435},{"style":584},[1436],{"type":398,"value":633},{"type":393,"tag":427,"props":1438,"children":1439},{"style":439},[1440],{"type":398,"value":1441},"(data[[",{"type":393,"tag":427,"props":1443,"children":1444},{"style":493},[1445],{"type":398,"value":1293},{"type":393,"tag":427,"props":1447,"children":1448},{"style":439},[1449],{"type":398,"value":511},{"type":393,"tag":427,"props":1451,"children":1452},{"style":493},[1453],{"type":398,"value":1361},{"type":393,"tag":427,"props":1455,"children":1456},{"style":439},[1457],{"type":398,"value":905},{"type":393,"tag":1459,"props":1460,"children":1462},"h3",{"id":1461},"common-string-operations",[1463],{"type":398,"value":1464},"Common String Operations",{"type":393,"tag":919,"props":1466,"children":1470},{"emoji":1467,"title":1468,"type":1469},"📝","Essential String Functions","success",[1471,1479,1514,1522,1558,1566],{"type":393,"tag":401,"props":1472,"children":1473},{},[1474],{"type":393,"tag":929,"props":1475,"children":1476},{},[1477],{"type":398,"value":1478},"Case Changes:",{"type":393,"tag":935,"props":1480,"children":1481},{},[1482,1492,1503],{"type":393,"tag":939,"props":1483,"children":1484},{},[1485,1490],{"type":393,"tag":423,"props":1486,"children":1488},{"className":1487},[],[1489],{"type":398,"value":949},{"type":398,"value":1491}," - Convert to UPPERCASE",{"type":393,"tag":939,"props":1493,"children":1494},{},[1495,1501],{"type":393,"tag":423,"props":1496,"children":1498},{"className":1497},[],[1499],{"type":398,"value":1500},".str.lower()",{"type":398,"value":1502}," - Convert to lowercase",{"type":393,"tag":939,"props":1504,"children":1505},{},[1506,1512],{"type":393,"tag":423,"props":1507,"children":1509},{"className":1508},[],[1510],{"type":398,"value":1511},".str.title()",{"type":398,"value":1513}," - Convert To Title Case",{"type":393,"tag":401,"props":1515,"children":1516},{},[1517],{"type":393,"tag":929,"props":1518,"children":1519},{},[1520],{"type":398,"value":1521},"Cleaning:",{"type":393,"tag":935,"props":1523,"children":1524},{},[1525,1536,1547],{"type":393,"tag":939,"props":1526,"children":1527},{},[1528,1534],{"type":393,"tag":423,"props":1529,"children":1531},{"className":1530},[],[1532],{"type":398,"value":1533},".str.strip()",{"type":398,"value":1535}," - Remove spaces from ends",{"type":393,"tag":939,"props":1537,"children":1538},{},[1539,1545],{"type":393,"tag":423,"props":1540,"children":1542},{"className":1541},[],[1543],{"type":398,"value":1544},".str.replace('old', 'new')",{"type":398,"value":1546}," - Replace text",{"type":393,"tag":939,"props":1548,"children":1549},{},[1550,1556],{"type":393,"tag":423,"props":1551,"children":1553},{"className":1552},[],[1554],{"type":398,"value":1555},".str.extract(r'pattern')",{"type":398,"value":1557}," - Extract patterns",{"type":393,"tag":401,"props":1559,"children":1560},{},[1561],{"type":393,"tag":929,"props":1562,"children":1563},{},[1564],{"type":398,"value":1565},"Information:",{"type":393,"tag":935,"props":1567,"children":1568},{},[1569,1580,1591],{"type":393,"tag":939,"props":1570,"children":1571},{},[1572,1578],{"type":393,"tag":423,"props":1573,"children":1575},{"className":1574},[],[1576],{"type":398,"value":1577},".str.len()",{"type":398,"value":1579}," - Length of text",{"type":393,"tag":939,"props":1581,"children":1582},{},[1583,1589],{"type":393,"tag":423,"props":1584,"children":1586},{"className":1585},[],[1587],{"type":398,"value":1588},".str.contains('text')",{"type":398,"value":1590}," - Check if contains text",{"type":393,"tag":939,"props":1592,"children":1593},{},[1594,1600],{"type":393,"tag":423,"props":1595,"children":1597},{"className":1596},[],[1598],{"type":398,"value":1599},".str.startswith('text')",{"type":398,"value":1601}," - Check start",{"type":393,"tag":907,"props":1603,"children":1605},{"id":1604},"mathematical-functions",[1606],{"type":398,"value":1607},"🔢 Mathematical Functions",{"type":393,"tag":401,"props":1609,"children":1610},{},[1611],{"type":398,"value":1612},"Apply math operations to numerical data:",{"type":393,"tag":412,"props":1614,"children":1615},{},[1616],{"type":393,"tag":416,"props":1617,"children":1619},{"className":418,"code":1618,"language":420,"meta":6,"style":6},"import pandas as pd\nimport numpy as np\n\n# Sales data with some negative values (returns)\nsales = pd.DataFrame({\n    'product': ['Laptop', 'Mouse', 'Keyboard'],\n    'revenue': [1250.75, -29.99, 85.50],  # negative = return\n    'tax_rate': [0.085, 0.085, 0.085]\n})\n\nprint(\"Sales data:\")\nprint(sales)\nprint()\n\n# Apply mathematical functions\nsales['revenue_abs'] = sales['revenue'].abs()  # Remove negative signs\nsales['revenue_rounded'] = sales['revenue'].round(0)  # Round to whole numbers\nsales['tax_amount'] = (sales['revenue'] * sales['tax_rate']).round(2)\n\nprint(\"With math functions:\")\nprint(sales)\n",[1620],{"type":393,"tag":423,"props":1621,"children":1622},{"__ignoreMap":6},[1623,1642,1663,1670,1678,1694,1732,1782,1819,1826,1833,1853,1865,1876,1883,1891,1932,1980,2041,2048,2068],{"type":393,"tag":427,"props":1624,"children":1625},{"class":429,"line":11},[1626,1630,1634,1638],{"type":393,"tag":427,"props":1627,"children":1628},{"style":433},[1629],{"type":398,"value":436},{"type":393,"tag":427,"props":1631,"children":1632},{"style":439},[1633],{"type":398,"value":442},{"type":393,"tag":427,"props":1635,"children":1636},{"style":433},[1637],{"type":398,"value":447},{"type":393,"tag":427,"props":1639,"children":1640},{"style":439},[1641],{"type":398,"value":452},{"type":393,"tag":427,"props":1643,"children":1644},{"class":429,"line":27},[1645,1649,1654,1658],{"type":393,"tag":427,"props":1646,"children":1647},{"style":433},[1648],{"type":398,"value":436},{"type":393,"tag":427,"props":1650,"children":1651},{"style":439},[1652],{"type":398,"value":1653}," numpy ",{"type":393,"tag":427,"props":1655,"children":1656},{"style":433},[1657],{"type":398,"value":447},{"type":393,"tag":427,"props":1659,"children":1660},{"style":439},[1661],{"type":398,"value":1662}," np\n",{"type":393,"tag":427,"props":1664,"children":1665},{"class":429,"line":36},[1666],{"type":393,"tag":427,"props":1667,"children":1668},{"emptyLinePlaceholder":12},[1669],{"type":398,"value":460},{"type":393,"tag":427,"props":1671,"children":1672},{"class":429,"line":45},[1673],{"type":393,"tag":427,"props":1674,"children":1675},{"style":466},[1676],{"type":398,"value":1677},"# Sales data with some negative values (returns)\n",{"type":393,"tag":427,"props":1679,"children":1680},{"class":429,"line":54},[1681,1686,1690],{"type":393,"tag":427,"props":1682,"children":1683},{"style":439},[1684],{"type":398,"value":1685},"sales ",{"type":393,"tag":427,"props":1687,"children":1688},{"style":433},[1689],{"type":398,"value":482},{"type":393,"tag":427,"props":1691,"children":1692},{"style":439},[1693],{"type":398,"value":487},{"type":393,"tag":427,"props":1695,"children":1696},{"class":429,"line":63},[1697,1701,1705,1710,1714,1719,1723,1728],{"type":393,"tag":427,"props":1698,"children":1699},{"style":493},[1700],{"type":398,"value":1138},{"type":393,"tag":427,"props":1702,"children":1703},{"style":439},[1704],{"type":398,"value":501},{"type":393,"tag":427,"props":1706,"children":1707},{"style":493},[1708],{"type":398,"value":1709},"'Laptop'",{"type":393,"tag":427,"props":1711,"children":1712},{"style":439},[1713],{"type":398,"value":511},{"type":393,"tag":427,"props":1715,"children":1716},{"style":493},[1717],{"type":398,"value":1718},"'Mouse'",{"type":393,"tag":427,"props":1720,"children":1721},{"style":439},[1722],{"type":398,"value":511},{"type":393,"tag":427,"props":1724,"children":1725},{"style":493},[1726],{"type":398,"value":1727},"'Keyboard'",{"type":393,"tag":427,"props":1729,"children":1730},{"style":439},[1731],{"type":398,"value":530},{"type":393,"tag":427,"props":1733,"children":1734},{"class":429,"line":72},[1735,1740,1744,1749,1753,1758,1763,1767,1772,1777],{"type":393,"tag":427,"props":1736,"children":1737},{"style":493},[1738],{"type":398,"value":1739},"    'revenue'",{"type":393,"tag":427,"props":1741,"children":1742},{"style":439},[1743],{"type":398,"value":501},{"type":393,"tag":427,"props":1745,"children":1746},{"style":584},[1747],{"type":398,"value":1748},"1250.75",{"type":393,"tag":427,"props":1750,"children":1751},{"style":439},[1752],{"type":398,"value":511},{"type":393,"tag":427,"props":1754,"children":1755},{"style":433},[1756],{"type":398,"value":1757},"-",{"type":393,"tag":427,"props":1759,"children":1760},{"style":584},[1761],{"type":398,"value":1762},"29.99",{"type":393,"tag":427,"props":1764,"children":1765},{"style":439},[1766],{"type":398,"value":511},{"type":393,"tag":427,"props":1768,"children":1769},{"style":584},[1770],{"type":398,"value":1771},"85.50",{"type":393,"tag":427,"props":1773,"children":1774},{"style":439},[1775],{"type":398,"value":1776},"],  ",{"type":393,"tag":427,"props":1778,"children":1779},{"style":466},[1780],{"type":398,"value":1781},"# negative = return\n",{"type":393,"tag":427,"props":1783,"children":1784},{"class":429,"line":83},[1785,1790,1794,1799,1803,1807,1811,1815],{"type":393,"tag":427,"props":1786,"children":1787},{"style":493},[1788],{"type":398,"value":1789},"    'tax_rate'",{"type":393,"tag":427,"props":1791,"children":1792},{"style":439},[1793],{"type":398,"value":501},{"type":393,"tag":427,"props":1795,"children":1796},{"style":584},[1797],{"type":398,"value":1798},"0.085",{"type":393,"tag":427,"props":1800,"children":1801},{"style":439},[1802],{"type":398,"value":511},{"type":393,"tag":427,"props":1804,"children":1805},{"style":584},[1806],{"type":398,"value":1798},{"type":393,"tag":427,"props":1808,"children":1809},{"style":439},[1810],{"type":398,"value":511},{"type":393,"tag":427,"props":1812,"children":1813},{"style":584},[1814],{"type":398,"value":1798},{"type":393,"tag":427,"props":1816,"children":1817},{"style":439},[1818],{"type":398,"value":610},{"type":393,"tag":427,"props":1820,"children":1821},{"class":429,"line":92},[1822],{"type":393,"tag":427,"props":1823,"children":1824},{"style":439},[1825],{"type":398,"value":618},{"type":393,"tag":427,"props":1827,"children":1828},{"class":429,"line":101},[1829],{"type":393,"tag":427,"props":1830,"children":1831},{"emptyLinePlaceholder":12},[1832],{"type":398,"value":460},{"type":393,"tag":427,"props":1834,"children":1835},{"class":429,"line":110},[1836,1840,1844,1849],{"type":393,"tag":427,"props":1837,"children":1838},{"style":584},[1839],{"type":398,"value":633},{"type":393,"tag":427,"props":1841,"children":1842},{"style":439},[1843],{"type":398,"value":638},{"type":393,"tag":427,"props":1845,"children":1846},{"style":493},[1847],{"type":398,"value":1848},"\"Sales data:\"",{"type":393,"tag":427,"props":1850,"children":1851},{"style":439},[1852],{"type":398,"value":648},{"type":393,"tag":427,"props":1854,"children":1855},{"class":429,"line":121},[1856,1860],{"type":393,"tag":427,"props":1857,"children":1858},{"style":584},[1859],{"type":398,"value":633},{"type":393,"tag":427,"props":1861,"children":1862},{"style":439},[1863],{"type":398,"value":1864},"(sales)\n",{"type":393,"tag":427,"props":1866,"children":1867},{"class":429,"line":130},[1868,1872],{"type":393,"tag":427,"props":1869,"children":1870},{"style":584},[1871],{"type":398,"value":633},{"type":393,"tag":427,"props":1873,"children":1874},{"style":439},[1875],{"type":398,"value":672},{"type":393,"tag":427,"props":1877,"children":1878},{"class":429,"line":139},[1879],{"type":393,"tag":427,"props":1880,"children":1881},{"emptyLinePlaceholder":12},[1882],{"type":398,"value":460},{"type":393,"tag":427,"props":1884,"children":1885},{"class":429,"line":148},[1886],{"type":393,"tag":427,"props":1887,"children":1888},{"style":466},[1889],{"type":398,"value":1890},"# Apply mathematical functions\n",{"type":393,"tag":427,"props":1892,"children":1893},{"class":429,"line":159},[1894,1899,1904,1908,1912,1917,1922,1927],{"type":393,"tag":427,"props":1895,"children":1896},{"style":439},[1897],{"type":398,"value":1898},"sales[",{"type":393,"tag":427,"props":1900,"children":1901},{"style":493},[1902],{"type":398,"value":1903},"'revenue_abs'",{"type":393,"tag":427,"props":1905,"children":1906},{"style":439},[1907],{"type":398,"value":705},{"type":393,"tag":427,"props":1909,"children":1910},{"style":433},[1911],{"type":398,"value":482},{"type":393,"tag":427,"props":1913,"children":1914},{"style":439},[1915],{"type":398,"value":1916}," sales[",{"type":393,"tag":427,"props":1918,"children":1919},{"style":493},[1920],{"type":398,"value":1921},"'revenue'",{"type":393,"tag":427,"props":1923,"children":1924},{"style":439},[1925],{"type":398,"value":1926},"].abs()  ",{"type":393,"tag":427,"props":1928,"children":1929},{"style":466},[1930],{"type":398,"value":1931},"# Remove negative signs\n",{"type":393,"tag":427,"props":1933,"children":1934},{"class":429,"line":168},[1935,1939,1944,1948,1952,1956,1960,1965,1970,1975],{"type":393,"tag":427,"props":1936,"children":1937},{"style":439},[1938],{"type":398,"value":1898},{"type":393,"tag":427,"props":1940,"children":1941},{"style":493},[1942],{"type":398,"value":1943},"'revenue_rounded'",{"type":393,"tag":427,"props":1945,"children":1946},{"style":439},[1947],{"type":398,"value":705},{"type":393,"tag":427,"props":1949,"children":1950},{"style":433},[1951],{"type":398,"value":482},{"type":393,"tag":427,"props":1953,"children":1954},{"style":439},[1955],{"type":398,"value":1916},{"type":393,"tag":427,"props":1957,"children":1958},{"style":493},[1959],{"type":398,"value":1921},{"type":393,"tag":427,"props":1961,"children":1962},{"style":439},[1963],{"type":398,"value":1964},"].round(",{"type":393,"tag":427,"props":1966,"children":1967},{"style":584},[1968],{"type":398,"value":1969},"0",{"type":393,"tag":427,"props":1971,"children":1972},{"style":439},[1973],{"type":398,"value":1974},")  ",{"type":393,"tag":427,"props":1976,"children":1977},{"style":466},[1978],{"type":398,"value":1979},"# Round to whole numbers\n",{"type":393,"tag":427,"props":1981,"children":1982},{"class":429,"line":177},[1983,1987,1992,1996,2000,2005,2009,2013,2018,2022,2027,2032,2037],{"type":393,"tag":427,"props":1984,"children":1985},{"style":439},[1986],{"type":398,"value":1898},{"type":393,"tag":427,"props":1988,"children":1989},{"style":493},[1990],{"type":398,"value":1991},"'tax_amount'",{"type":393,"tag":427,"props":1993,"children":1994},{"style":439},[1995],{"type":398,"value":705},{"type":393,"tag":427,"props":1997,"children":1998},{"style":433},[1999],{"type":398,"value":482},{"type":393,"tag":427,"props":2001,"children":2002},{"style":439},[2003],{"type":398,"value":2004}," (sales[",{"type":393,"tag":427,"props":2006,"children":2007},{"style":493},[2008],{"type":398,"value":1921},{"type":393,"tag":427,"props":2010,"children":2011},{"style":439},[2012],{"type":398,"value":705},{"type":393,"tag":427,"props":2014,"children":2015},{"style":433},[2016],{"type":398,"value":2017},"*",{"type":393,"tag":427,"props":2019,"children":2020},{"style":439},[2021],{"type":398,"value":1916},{"type":393,"tag":427,"props":2023,"children":2024},{"style":493},[2025],{"type":398,"value":2026},"'tax_rate'",{"type":393,"tag":427,"props":2028,"children":2029},{"style":439},[2030],{"type":398,"value":2031},"]).round(",{"type":393,"tag":427,"props":2033,"children":2034},{"style":584},[2035],{"type":398,"value":2036},"2",{"type":393,"tag":427,"props":2038,"children":2039},{"style":439},[2040],{"type":398,"value":648},{"type":393,"tag":427,"props":2042,"children":2043},{"class":429,"line":186},[2044],{"type":393,"tag":427,"props":2045,"children":2046},{"emptyLinePlaceholder":12},[2047],{"type":398,"value":460},{"type":393,"tag":427,"props":2049,"children":2050},{"class":429,"line":197},[2051,2055,2059,2064],{"type":393,"tag":427,"props":2052,"children":2053},{"style":584},[2054],{"type":398,"value":633},{"type":393,"tag":427,"props":2056,"children":2057},{"style":439},[2058],{"type":398,"value":638},{"type":393,"tag":427,"props":2060,"children":2061},{"style":493},[2062],{"type":398,"value":2063},"\"With math functions:\"",{"type":393,"tag":427,"props":2065,"children":2066},{"style":439},[2067],{"type":398,"value":648},{"type":393,"tag":427,"props":2069,"children":2070},{"class":429,"line":206},[2071,2075],{"type":393,"tag":427,"props":2072,"children":2073},{"style":584},[2074],{"type":398,"value":633},{"type":393,"tag":427,"props":2076,"children":2077},{"style":439},[2078],{"type":398,"value":1864},{"type":393,"tag":907,"props":2080,"children":2082},{"id":2081},"custom-functions-with-apply",[2083],{"type":398,"value":2084},"🔨 Custom Functions with Apply",{"type":393,"tag":401,"props":2086,"children":2087},{},[2088],{"type":398,"value":2089},"Sometimes you need custom logic that built-in functions can't handle:",{"type":393,"tag":919,"props":2091,"children":2094},{"emoji":2092,"title":2093,"type":923},"🎯","Using .apply() Method",[2095,2103,2139,2147,2165],{"type":393,"tag":401,"props":2096,"children":2097},{},[2098],{"type":393,"tag":929,"props":2099,"children":2100},{},[2101],{"type":398,"value":2102},"Syntax:",{"type":393,"tag":935,"props":2104,"children":2105},{},[2106,2117,2128],{"type":393,"tag":939,"props":2107,"children":2108},{},[2109,2115],{"type":393,"tag":423,"props":2110,"children":2112},{"className":2111},[],[2113],{"type":398,"value":2114},"df['col'].apply(function)",{"type":398,"value":2116}," - Apply to one column",{"type":393,"tag":939,"props":2118,"children":2119},{},[2120,2126],{"type":393,"tag":423,"props":2121,"children":2123},{"className":2122},[],[2124],{"type":398,"value":2125},"df.apply(function, axis=1)",{"type":398,"value":2127}," - Apply to each row",{"type":393,"tag":939,"props":2129,"children":2130},{},[2131,2137],{"type":393,"tag":423,"props":2132,"children":2134},{"className":2133},[],[2135],{"type":398,"value":2136},"df.apply(function, axis=0)",{"type":398,"value":2138}," - Apply to each column",{"type":393,"tag":401,"props":2140,"children":2141},{},[2142],{"type":393,"tag":929,"props":2143,"children":2144},{},[2145],{"type":398,"value":2146},"When to Use:",{"type":393,"tag":935,"props":2148,"children":2149},{},[2150,2155,2160],{"type":393,"tag":939,"props":2151,"children":2152},{},[2153],{"type":398,"value":2154},"Complex logic that needs if/else statements",{"type":393,"tag":939,"props":2156,"children":2157},{},[2158],{"type":398,"value":2159},"Custom calculations",{"type":393,"tag":939,"props":2161,"children":2162},{},[2163],{"type":398,"value":2164},"When built-in functions aren't enough",{"type":393,"tag":401,"props":2166,"children":2167},{},[2168,2173],{"type":393,"tag":929,"props":2169,"children":2170},{},[2171],{"type":398,"value":2172},"Performance Note:",{"type":398,"value":2174}," Use built-in functions when possible (they're faster!)",{"type":393,"tag":1459,"props":2176,"children":2178},{"id":2177},"lambda-functions-quick-custom-functions",[2179],{"type":398,"value":2180},"Lambda Functions (Quick Custom Functions)",{"type":393,"tag":412,"props":2182,"children":2183},{},[2184],{"type":393,"tag":416,"props":2185,"children":2187},{"className":418,"code":2186,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Employee data\nemployees = pd.DataFrame({\n    'name': ['Alice', 'Bob', 'Charlie'],\n    'salary': [50000, 75000, 65000],\n    'years_experience': [2, 8, 5]\n})\n\nprint(\"Employee data:\")\nprint(employees)\nprint()\n\n# Apply lambda functions for quick transformations\nemployees['salary_k'] = employees['salary'].apply(lambda x: f\"{x//1000}k\")\nemployees['experience_level'] = employees['years_experience'].apply(\n    lambda x: 'Senior' if x >= 5 else 'Junior'\n)\nemployees['salary_category'] = employees['salary'].apply(\n    lambda x: 'High' if x > 60000 else 'Standard'\n)\n\nprint(\"With lambda functions:\")\nprint(employees)\n",[2188],{"type":393,"tag":423,"props":2189,"children":2190},{"__ignoreMap":6},[2191,2210,2217,2225,2241,2279,2318,2356,2363,2370,2390,2402,2413,2420,2428,2510,2544,2588,2595,2627,2670,2677,2684,2704],{"type":393,"tag":427,"props":2192,"children":2193},{"class":429,"line":11},[2194,2198,2202,2206],{"type":393,"tag":427,"props":2195,"children":2196},{"style":433},[2197],{"type":398,"value":436},{"type":393,"tag":427,"props":2199,"children":2200},{"style":439},[2201],{"type":398,"value":442},{"type":393,"tag":427,"props":2203,"children":2204},{"style":433},[2205],{"type":398,"value":447},{"type":393,"tag":427,"props":2207,"children":2208},{"style":439},[2209],{"type":398,"value":452},{"type":393,"tag":427,"props":2211,"children":2212},{"class":429,"line":27},[2213],{"type":393,"tag":427,"props":2214,"children":2215},{"emptyLinePlaceholder":12},[2216],{"type":398,"value":460},{"type":393,"tag":427,"props":2218,"children":2219},{"class":429,"line":36},[2220],{"type":393,"tag":427,"props":2221,"children":2222},{"style":466},[2223],{"type":398,"value":2224},"# Employee data\n",{"type":393,"tag":427,"props":2226,"children":2227},{"class":429,"line":45},[2228,2233,2237],{"type":393,"tag":427,"props":2229,"children":2230},{"style":439},[2231],{"type":398,"value":2232},"employees ",{"type":393,"tag":427,"props":2234,"children":2235},{"style":433},[2236],{"type":398,"value":482},{"type":393,"tag":427,"props":2238,"children":2239},{"style":439},[2240],{"type":398,"value":487},{"type":393,"tag":427,"props":2242,"children":2243},{"class":429,"line":54},[2244,2248,2252,2257,2261,2266,2270,2275],{"type":393,"tag":427,"props":2245,"children":2246},{"style":493},[2247],{"type":398,"value":496},{"type":393,"tag":427,"props":2249,"children":2250},{"style":439},[2251],{"type":398,"value":501},{"type":393,"tag":427,"props":2253,"children":2254},{"style":493},[2255],{"type":398,"value":2256},"'Alice'",{"type":393,"tag":427,"props":2258,"children":2259},{"style":439},[2260],{"type":398,"value":511},{"type":393,"tag":427,"props":2262,"children":2263},{"style":493},[2264],{"type":398,"value":2265},"'Bob'",{"type":393,"tag":427,"props":2267,"children":2268},{"style":439},[2269],{"type":398,"value":511},{"type":393,"tag":427,"props":2271,"children":2272},{"style":493},[2273],{"type":398,"value":2274},"'Charlie'",{"type":393,"tag":427,"props":2276,"children":2277},{"style":439},[2278],{"type":398,"value":530},{"type":393,"tag":427,"props":2280,"children":2281},{"class":429,"line":63},[2282,2287,2291,2296,2300,2305,2309,2314],{"type":393,"tag":427,"props":2283,"children":2284},{"style":493},[2285],{"type":398,"value":2286},"    'salary'",{"type":393,"tag":427,"props":2288,"children":2289},{"style":439},[2290],{"type":398,"value":501},{"type":393,"tag":427,"props":2292,"children":2293},{"style":584},[2294],{"type":398,"value":2295},"50000",{"type":393,"tag":427,"props":2297,"children":2298},{"style":439},[2299],{"type":398,"value":511},{"type":393,"tag":427,"props":2301,"children":2302},{"style":584},[2303],{"type":398,"value":2304},"75000",{"type":393,"tag":427,"props":2306,"children":2307},{"style":439},[2308],{"type":398,"value":511},{"type":393,"tag":427,"props":2310,"children":2311},{"style":584},[2312],{"type":398,"value":2313},"65000",{"type":393,"tag":427,"props":2315,"children":2316},{"style":439},[2317],{"type":398,"value":530},{"type":393,"tag":427,"props":2319,"children":2320},{"class":429,"line":72},[2321,2326,2330,2334,2338,2343,2347,2352],{"type":393,"tag":427,"props":2322,"children":2323},{"style":493},[2324],{"type":398,"value":2325},"    'years_experience'",{"type":393,"tag":427,"props":2327,"children":2328},{"style":439},[2329],{"type":398,"value":501},{"type":393,"tag":427,"props":2331,"children":2332},{"style":584},[2333],{"type":398,"value":2036},{"type":393,"tag":427,"props":2335,"children":2336},{"style":439},[2337],{"type":398,"value":511},{"type":393,"tag":427,"props":2339,"children":2340},{"style":584},[2341],{"type":398,"value":2342},"8",{"type":393,"tag":427,"props":2344,"children":2345},{"style":439},[2346],{"type":398,"value":511},{"type":393,"tag":427,"props":2348,"children":2349},{"style":584},[2350],{"type":398,"value":2351},"5",{"type":393,"tag":427,"props":2353,"children":2354},{"style":439},[2355],{"type":398,"value":610},{"type":393,"tag":427,"props":2357,"children":2358},{"class":429,"line":83},[2359],{"type":393,"tag":427,"props":2360,"children":2361},{"style":439},[2362],{"type":398,"value":618},{"type":393,"tag":427,"props":2364,"children":2365},{"class":429,"line":92},[2366],{"type":393,"tag":427,"props":2367,"children":2368},{"emptyLinePlaceholder":12},[2369],{"type":398,"value":460},{"type":393,"tag":427,"props":2371,"children":2372},{"class":429,"line":101},[2373,2377,2381,2386],{"type":393,"tag":427,"props":2374,"children":2375},{"style":584},[2376],{"type":398,"value":633},{"type":393,"tag":427,"props":2378,"children":2379},{"style":439},[2380],{"type":398,"value":638},{"type":393,"tag":427,"props":2382,"children":2383},{"style":493},[2384],{"type":398,"value":2385},"\"Employee data:\"",{"type":393,"tag":427,"props":2387,"children":2388},{"style":439},[2389],{"type":398,"value":648},{"type":393,"tag":427,"props":2391,"children":2392},{"class":429,"line":110},[2393,2397],{"type":393,"tag":427,"props":2394,"children":2395},{"style":584},[2396],{"type":398,"value":633},{"type":393,"tag":427,"props":2398,"children":2399},{"style":439},[2400],{"type":398,"value":2401},"(employees)\n",{"type":393,"tag":427,"props":2403,"children":2404},{"class":429,"line":121},[2405,2409],{"type":393,"tag":427,"props":2406,"children":2407},{"style":584},[2408],{"type":398,"value":633},{"type":393,"tag":427,"props":2410,"children":2411},{"style":439},[2412],{"type":398,"value":672},{"type":393,"tag":427,"props":2414,"children":2415},{"class":429,"line":130},[2416],{"type":393,"tag":427,"props":2417,"children":2418},{"emptyLinePlaceholder":12},[2419],{"type":398,"value":460},{"type":393,"tag":427,"props":2421,"children":2422},{"class":429,"line":139},[2423],{"type":393,"tag":427,"props":2424,"children":2425},{"style":466},[2426],{"type":398,"value":2427},"# Apply lambda functions for quick transformations\n",{"type":393,"tag":427,"props":2429,"children":2430},{"class":429,"line":148},[2431,2436,2441,2445,2449,2454,2459,2463,2467,2471,2476,2481,2486,2491,2496,2501,2506],{"type":393,"tag":427,"props":2432,"children":2433},{"style":439},[2434],{"type":398,"value":2435},"employees[",{"type":393,"tag":427,"props":2437,"children":2438},{"style":493},[2439],{"type":398,"value":2440},"'salary_k'",{"type":393,"tag":427,"props":2442,"children":2443},{"style":439},[2444],{"type":398,"value":705},{"type":393,"tag":427,"props":2446,"children":2447},{"style":433},[2448],{"type":398,"value":482},{"type":393,"tag":427,"props":2450,"children":2451},{"style":439},[2452],{"type":398,"value":2453}," employees[",{"type":393,"tag":427,"props":2455,"children":2456},{"style":493},[2457],{"type":398,"value":2458},"'salary'",{"type":393,"tag":427,"props":2460,"children":2461},{"style":439},[2462],{"type":398,"value":792},{"type":393,"tag":427,"props":2464,"children":2465},{"style":433},[2466],{"type":398,"value":797},{"type":393,"tag":427,"props":2468,"children":2469},{"style":439},[2470],{"type":398,"value":802},{"type":393,"tag":427,"props":2472,"children":2473},{"style":433},[2474],{"type":398,"value":2475},"f",{"type":393,"tag":427,"props":2477,"children":2478},{"style":493},[2479],{"type":398,"value":2480},"\"",{"type":393,"tag":427,"props":2482,"children":2483},{"style":584},[2484],{"type":398,"value":2485},"{",{"type":393,"tag":427,"props":2487,"children":2488},{"style":439},[2489],{"type":398,"value":2490},"x",{"type":393,"tag":427,"props":2492,"children":2493},{"style":433},[2494],{"type":398,"value":2495},"//",{"type":393,"tag":427,"props":2497,"children":2498},{"style":584},[2499],{"type":398,"value":2500},"1000}",{"type":393,"tag":427,"props":2502,"children":2503},{"style":493},[2504],{"type":398,"value":2505},"k\"",{"type":393,"tag":427,"props":2507,"children":2508},{"style":439},[2509],{"type":398,"value":648},{"type":393,"tag":427,"props":2511,"children":2512},{"class":429,"line":159},[2513,2517,2522,2526,2530,2534,2539],{"type":393,"tag":427,"props":2514,"children":2515},{"style":439},[2516],{"type":398,"value":2435},{"type":393,"tag":427,"props":2518,"children":2519},{"style":493},[2520],{"type":398,"value":2521},"'experience_level'",{"type":393,"tag":427,"props":2523,"children":2524},{"style":439},[2525],{"type":398,"value":705},{"type":393,"tag":427,"props":2527,"children":2528},{"style":433},[2529],{"type":398,"value":482},{"type":393,"tag":427,"props":2531,"children":2532},{"style":439},[2533],{"type":398,"value":2453},{"type":393,"tag":427,"props":2535,"children":2536},{"style":493},[2537],{"type":398,"value":2538},"'years_experience'",{"type":393,"tag":427,"props":2540,"children":2541},{"style":439},[2542],{"type":398,"value":2543},"].apply(\n",{"type":393,"tag":427,"props":2545,"children":2546},{"class":429,"line":168},[2547,2552,2556,2561,2565,2569,2574,2579,2583],{"type":393,"tag":427,"props":2548,"children":2549},{"style":433},[2550],{"type":398,"value":2551},"    lambda",{"type":393,"tag":427,"props":2553,"children":2554},{"style":439},[2555],{"type":398,"value":802},{"type":393,"tag":427,"props":2557,"children":2558},{"style":493},[2559],{"type":398,"value":2560},"'Senior'",{"type":393,"tag":427,"props":2562,"children":2563},{"style":433},[2564],{"type":398,"value":812},{"type":393,"tag":427,"props":2566,"children":2567},{"style":439},[2568],{"type":398,"value":817},{"type":393,"tag":427,"props":2570,"children":2571},{"style":433},[2572],{"type":398,"value":2573},">=",{"type":393,"tag":427,"props":2575,"children":2576},{"style":584},[2577],{"type":398,"value":2578}," 5",{"type":393,"tag":427,"props":2580,"children":2581},{"style":433},[2582],{"type":398,"value":832},{"type":393,"tag":427,"props":2584,"children":2585},{"style":493},[2586],{"type":398,"value":2587}," 'Junior'\n",{"type":393,"tag":427,"props":2589,"children":2590},{"class":429,"line":177},[2591],{"type":393,"tag":427,"props":2592,"children":2593},{"style":439},[2594],{"type":398,"value":648},{"type":393,"tag":427,"props":2596,"children":2597},{"class":429,"line":186},[2598,2602,2607,2611,2615,2619,2623],{"type":393,"tag":427,"props":2599,"children":2600},{"style":439},[2601],{"type":398,"value":2435},{"type":393,"tag":427,"props":2603,"children":2604},{"style":493},[2605],{"type":398,"value":2606},"'salary_category'",{"type":393,"tag":427,"props":2608,"children":2609},{"style":439},[2610],{"type":398,"value":705},{"type":393,"tag":427,"props":2612,"children":2613},{"style":433},[2614],{"type":398,"value":482},{"type":393,"tag":427,"props":2616,"children":2617},{"style":439},[2618],{"type":398,"value":2453},{"type":393,"tag":427,"props":2620,"children":2621},{"style":493},[2622],{"type":398,"value":2458},{"type":393,"tag":427,"props":2624,"children":2625},{"style":439},[2626],{"type":398,"value":2543},{"type":393,"tag":427,"props":2628,"children":2629},{"class":429,"line":197},[2630,2634,2638,2643,2647,2651,2656,2661,2665],{"type":393,"tag":427,"props":2631,"children":2632},{"style":433},[2633],{"type":398,"value":2551},{"type":393,"tag":427,"props":2635,"children":2636},{"style":439},[2637],{"type":398,"value":802},{"type":393,"tag":427,"props":2639,"children":2640},{"style":493},[2641],{"type":398,"value":2642},"'High'",{"type":393,"tag":427,"props":2644,"children":2645},{"style":433},[2646],{"type":398,"value":812},{"type":393,"tag":427,"props":2648,"children":2649},{"style":439},[2650],{"type":398,"value":817},{"type":393,"tag":427,"props":2652,"children":2653},{"style":433},[2654],{"type":398,"value":2655},">",{"type":393,"tag":427,"props":2657,"children":2658},{"style":584},[2659],{"type":398,"value":2660}," 60000",{"type":393,"tag":427,"props":2662,"children":2663},{"style":433},[2664],{"type":398,"value":832},{"type":393,"tag":427,"props":2666,"children":2667},{"style":493},[2668],{"type":398,"value":2669}," 'Standard'\n",{"type":393,"tag":427,"props":2671,"children":2672},{"class":429,"line":206},[2673],{"type":393,"tag":427,"props":2674,"children":2675},{"style":439},[2676],{"type":398,"value":648},{"type":393,"tag":427,"props":2678,"children":2679},{"class":429,"line":215},[2680],{"type":393,"tag":427,"props":2681,"children":2682},{"emptyLinePlaceholder":12},[2683],{"type":398,"value":460},{"type":393,"tag":427,"props":2685,"children":2686},{"class":429,"line":224},[2687,2691,2695,2700],{"type":393,"tag":427,"props":2688,"children":2689},{"style":584},[2690],{"type":398,"value":633},{"type":393,"tag":427,"props":2692,"children":2693},{"style":439},[2694],{"type":398,"value":638},{"type":393,"tag":427,"props":2696,"children":2697},{"style":493},[2698],{"type":398,"value":2699},"\"With lambda functions:\"",{"type":393,"tag":427,"props":2701,"children":2702},{"style":439},[2703],{"type":398,"value":648},{"type":393,"tag":427,"props":2705,"children":2706},{"class":429,"line":233},[2707,2711],{"type":393,"tag":427,"props":2708,"children":2709},{"style":584},[2710],{"type":398,"value":633},{"type":393,"tag":427,"props":2712,"children":2713},{"style":439},[2714],{"type":398,"value":2401},{"type":393,"tag":1459,"props":2716,"children":2718},{"id":2717},"regular-custom-functions",[2719],{"type":398,"value":2720},"Regular Custom Functions",{"type":393,"tag":401,"props":2722,"children":2723},{},[2724],{"type":398,"value":2725},"For more complex logic, create regular functions:",{"type":393,"tag":412,"props":2727,"children":2728},{},[2729],{"type":393,"tag":416,"props":2730,"children":2732},{"className":418,"code":2731,"language":420,"meta":6,"style":6},"import pandas as pd\n\ndef categorize_grade(score):\n    \"\"\"Convert numerical score to letter grade\"\"\"\n    if score >= 90:\n        return 'A'\n    elif score >= 80:\n        return 'B'\n    elif score >= 70:\n        return 'C'\n    elif score >= 60:\n        return 'D'\n    else:\n        return 'F'\n\ndef format_phone(phone):\n    \"\"\"Format phone number\"\"\"\n    # Remove all non-digits\n    digits = ''.join(filter(str.isdigit, str(phone)))\n    if len(digits) == 10:\n        return f\"({digits[:3]}) {digits[3:6]}-{digits[6:]}\"\n    return phone\n\n# Student data\nstudents = pd.DataFrame({\n    'name': ['Alice', 'Bob', 'Charlie'],\n    'score': [95, 83, 67],\n    'phone': ['1234567890', '555-123-4567', '9876543210']\n})\n\nprint(\"Student data:\")\nprint(students)\nprint()\n\n# Apply custom functions\nstudents['letter_grade'] = students['score'].apply(categorize_grade)\nstudents['phone_formatted'] = students['phone'].apply(format_phone)\n\nprint(\"With custom functions:\")\nprint(students)\n",[2733],{"type":393,"tag":423,"props":2734,"children":2735},{"__ignoreMap":6},[2736,2755,2762,2781,2789,2816,2829,2854,2866,2890,2902,2926,2938,2950,2962,2969,2986,2994,3002,3052,3083,3190,3203,3210,3218,3234,3269,3308,3347,3354,3361,3381,3393,3404,3411,3419,3455,3489,3496,3516],{"type":393,"tag":427,"props":2737,"children":2738},{"class":429,"line":11},[2739,2743,2747,2751],{"type":393,"tag":427,"props":2740,"children":2741},{"style":433},[2742],{"type":398,"value":436},{"type":393,"tag":427,"props":2744,"children":2745},{"style":439},[2746],{"type":398,"value":442},{"type":393,"tag":427,"props":2748,"children":2749},{"style":433},[2750],{"type":398,"value":447},{"type":393,"tag":427,"props":2752,"children":2753},{"style":439},[2754],{"type":398,"value":452},{"type":393,"tag":427,"props":2756,"children":2757},{"class":429,"line":27},[2758],{"type":393,"tag":427,"props":2759,"children":2760},{"emptyLinePlaceholder":12},[2761],{"type":398,"value":460},{"type":393,"tag":427,"props":2763,"children":2764},{"class":429,"line":36},[2765,2770,2776],{"type":393,"tag":427,"props":2766,"children":2767},{"style":433},[2768],{"type":398,"value":2769},"def",{"type":393,"tag":427,"props":2771,"children":2773},{"style":2772},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[2774],{"type":398,"value":2775}," categorize_grade",{"type":393,"tag":427,"props":2777,"children":2778},{"style":439},[2779],{"type":398,"value":2780},"(score):\n",{"type":393,"tag":427,"props":2782,"children":2783},{"class":429,"line":45},[2784],{"type":393,"tag":427,"props":2785,"children":2786},{"style":493},[2787],{"type":398,"value":2788},"    \"\"\"Convert numerical score to letter grade\"\"\"\n",{"type":393,"tag":427,"props":2790,"children":2791},{"class":429,"line":54},[2792,2797,2802,2806,2811],{"type":393,"tag":427,"props":2793,"children":2794},{"style":433},[2795],{"type":398,"value":2796},"    if",{"type":393,"tag":427,"props":2798,"children":2799},{"style":439},[2800],{"type":398,"value":2801}," score ",{"type":393,"tag":427,"props":2803,"children":2804},{"style":433},[2805],{"type":398,"value":2573},{"type":393,"tag":427,"props":2807,"children":2808},{"style":584},[2809],{"type":398,"value":2810}," 90",{"type":393,"tag":427,"props":2812,"children":2813},{"style":439},[2814],{"type":398,"value":2815},":\n",{"type":393,"tag":427,"props":2817,"children":2818},{"class":429,"line":63},[2819,2824],{"type":393,"tag":427,"props":2820,"children":2821},{"style":433},[2822],{"type":398,"value":2823},"        return",{"type":393,"tag":427,"props":2825,"children":2826},{"style":493},[2827],{"type":398,"value":2828}," 'A'\n",{"type":393,"tag":427,"props":2830,"children":2831},{"class":429,"line":72},[2832,2837,2841,2845,2850],{"type":393,"tag":427,"props":2833,"children":2834},{"style":433},[2835],{"type":398,"value":2836},"    elif",{"type":393,"tag":427,"props":2838,"children":2839},{"style":439},[2840],{"type":398,"value":2801},{"type":393,"tag":427,"props":2842,"children":2843},{"style":433},[2844],{"type":398,"value":2573},{"type":393,"tag":427,"props":2846,"children":2847},{"style":584},[2848],{"type":398,"value":2849}," 80",{"type":393,"tag":427,"props":2851,"children":2852},{"style":439},[2853],{"type":398,"value":2815},{"type":393,"tag":427,"props":2855,"children":2856},{"class":429,"line":83},[2857,2861],{"type":393,"tag":427,"props":2858,"children":2859},{"style":433},[2860],{"type":398,"value":2823},{"type":393,"tag":427,"props":2862,"children":2863},{"style":493},[2864],{"type":398,"value":2865}," 'B'\n",{"type":393,"tag":427,"props":2867,"children":2868},{"class":429,"line":92},[2869,2873,2877,2881,2886],{"type":393,"tag":427,"props":2870,"children":2871},{"style":433},[2872],{"type":398,"value":2836},{"type":393,"tag":427,"props":2874,"children":2875},{"style":439},[2876],{"type":398,"value":2801},{"type":393,"tag":427,"props":2878,"children":2879},{"style":433},[2880],{"type":398,"value":2573},{"type":393,"tag":427,"props":2882,"children":2883},{"style":584},[2884],{"type":398,"value":2885}," 70",{"type":393,"tag":427,"props":2887,"children":2888},{"style":439},[2889],{"type":398,"value":2815},{"type":393,"tag":427,"props":2891,"children":2892},{"class":429,"line":101},[2893,2897],{"type":393,"tag":427,"props":2894,"children":2895},{"style":433},[2896],{"type":398,"value":2823},{"type":393,"tag":427,"props":2898,"children":2899},{"style":493},[2900],{"type":398,"value":2901}," 'C'\n",{"type":393,"tag":427,"props":2903,"children":2904},{"class":429,"line":110},[2905,2909,2913,2917,2922],{"type":393,"tag":427,"props":2906,"children":2907},{"style":433},[2908],{"type":398,"value":2836},{"type":393,"tag":427,"props":2910,"children":2911},{"style":439},[2912],{"type":398,"value":2801},{"type":393,"tag":427,"props":2914,"children":2915},{"style":433},[2916],{"type":398,"value":2573},{"type":393,"tag":427,"props":2918,"children":2919},{"style":584},[2920],{"type":398,"value":2921}," 60",{"type":393,"tag":427,"props":2923,"children":2924},{"style":439},[2925],{"type":398,"value":2815},{"type":393,"tag":427,"props":2927,"children":2928},{"class":429,"line":121},[2929,2933],{"type":393,"tag":427,"props":2930,"children":2931},{"style":433},[2932],{"type":398,"value":2823},{"type":393,"tag":427,"props":2934,"children":2935},{"style":493},[2936],{"type":398,"value":2937}," 'D'\n",{"type":393,"tag":427,"props":2939,"children":2940},{"class":429,"line":130},[2941,2946],{"type":393,"tag":427,"props":2942,"children":2943},{"style":433},[2944],{"type":398,"value":2945},"    else",{"type":393,"tag":427,"props":2947,"children":2948},{"style":439},[2949],{"type":398,"value":2815},{"type":393,"tag":427,"props":2951,"children":2952},{"class":429,"line":139},[2953,2957],{"type":393,"tag":427,"props":2954,"children":2955},{"style":433},[2956],{"type":398,"value":2823},{"type":393,"tag":427,"props":2958,"children":2959},{"style":493},[2960],{"type":398,"value":2961}," 'F'\n",{"type":393,"tag":427,"props":2963,"children":2964},{"class":429,"line":148},[2965],{"type":393,"tag":427,"props":2966,"children":2967},{"emptyLinePlaceholder":12},[2968],{"type":398,"value":460},{"type":393,"tag":427,"props":2970,"children":2971},{"class":429,"line":159},[2972,2976,2981],{"type":393,"tag":427,"props":2973,"children":2974},{"style":433},[2975],{"type":398,"value":2769},{"type":393,"tag":427,"props":2977,"children":2978},{"style":2772},[2979],{"type":398,"value":2980}," format_phone",{"type":393,"tag":427,"props":2982,"children":2983},{"style":439},[2984],{"type":398,"value":2985},"(phone):\n",{"type":393,"tag":427,"props":2987,"children":2988},{"class":429,"line":168},[2989],{"type":393,"tag":427,"props":2990,"children":2991},{"style":493},[2992],{"type":398,"value":2993},"    \"\"\"Format phone number\"\"\"\n",{"type":393,"tag":427,"props":2995,"children":2996},{"class":429,"line":177},[2997],{"type":393,"tag":427,"props":2998,"children":2999},{"style":466},[3000],{"type":398,"value":3001},"    # Remove all non-digits\n",{"type":393,"tag":427,"props":3003,"children":3004},{"class":429,"line":186},[3005,3010,3014,3019,3024,3029,3033,3038,3043,3047],{"type":393,"tag":427,"props":3006,"children":3007},{"style":439},[3008],{"type":398,"value":3009},"    digits ",{"type":393,"tag":427,"props":3011,"children":3012},{"style":433},[3013],{"type":398,"value":482},{"type":393,"tag":427,"props":3015,"children":3016},{"style":493},[3017],{"type":398,"value":3018}," ''",{"type":393,"tag":427,"props":3020,"children":3021},{"style":439},[3022],{"type":398,"value":3023},".join(",{"type":393,"tag":427,"props":3025,"children":3026},{"style":584},[3027],{"type":398,"value":3028},"filter",{"type":393,"tag":427,"props":3030,"children":3031},{"style":439},[3032],{"type":398,"value":638},{"type":393,"tag":427,"props":3034,"children":3035},{"style":584},[3036],{"type":398,"value":3037},"str",{"type":393,"tag":427,"props":3039,"children":3040},{"style":439},[3041],{"type":398,"value":3042},".isdigit, ",{"type":393,"tag":427,"props":3044,"children":3045},{"style":584},[3046],{"type":398,"value":3037},{"type":393,"tag":427,"props":3048,"children":3049},{"style":439},[3050],{"type":398,"value":3051},"(phone)))\n",{"type":393,"tag":427,"props":3053,"children":3054},{"class":429,"line":197},[3055,3059,3064,3069,3074,3079],{"type":393,"tag":427,"props":3056,"children":3057},{"style":433},[3058],{"type":398,"value":2796},{"type":393,"tag":427,"props":3060,"children":3061},{"style":584},[3062],{"type":398,"value":3063}," len",{"type":393,"tag":427,"props":3065,"children":3066},{"style":439},[3067],{"type":398,"value":3068},"(digits) ",{"type":393,"tag":427,"props":3070,"children":3071},{"style":433},[3072],{"type":398,"value":3073},"==",{"type":393,"tag":427,"props":3075,"children":3076},{"style":584},[3077],{"type":398,"value":3078}," 10",{"type":393,"tag":427,"props":3080,"children":3081},{"style":439},[3082],{"type":398,"value":2815},{"type":393,"tag":427,"props":3084,"children":3085},{"class":429,"line":206},[3086,3090,3095,3100,3104,3109,3114,3119,3124,3129,3133,3138,3142,3147,3152,3156,3160,3164,3168,3172,3176,3181,3185],{"type":393,"tag":427,"props":3087,"children":3088},{"style":433},[3089],{"type":398,"value":2823},{"type":393,"tag":427,"props":3091,"children":3092},{"style":433},[3093],{"type":398,"value":3094}," f",{"type":393,"tag":427,"props":3096,"children":3097},{"style":493},[3098],{"type":398,"value":3099},"\"(",{"type":393,"tag":427,"props":3101,"children":3102},{"style":584},[3103],{"type":398,"value":2485},{"type":393,"tag":427,"props":3105,"children":3106},{"style":439},[3107],{"type":398,"value":3108},"digits[:",{"type":393,"tag":427,"props":3110,"children":3111},{"style":584},[3112],{"type":398,"value":3113},"3",{"type":393,"tag":427,"props":3115,"children":3116},{"style":439},[3117],{"type":398,"value":3118},"]",{"type":393,"tag":427,"props":3120,"children":3121},{"style":584},[3122],{"type":398,"value":3123},"}",{"type":393,"tag":427,"props":3125,"children":3126},{"style":493},[3127],{"type":398,"value":3128},") ",{"type":393,"tag":427,"props":3130,"children":3131},{"style":584},[3132],{"type":398,"value":2485},{"type":393,"tag":427,"props":3134,"children":3135},{"style":439},[3136],{"type":398,"value":3137},"digits[",{"type":393,"tag":427,"props":3139,"children":3140},{"style":584},[3141],{"type":398,"value":3113},{"type":393,"tag":427,"props":3143,"children":3144},{"style":439},[3145],{"type":398,"value":3146},":",{"type":393,"tag":427,"props":3148,"children":3149},{"style":584},[3150],{"type":398,"value":3151},"6",{"type":393,"tag":427,"props":3153,"children":3154},{"style":439},[3155],{"type":398,"value":3118},{"type":393,"tag":427,"props":3157,"children":3158},{"style":584},[3159],{"type":398,"value":3123},{"type":393,"tag":427,"props":3161,"children":3162},{"style":493},[3163],{"type":398,"value":1757},{"type":393,"tag":427,"props":3165,"children":3166},{"style":584},[3167],{"type":398,"value":2485},{"type":393,"tag":427,"props":3169,"children":3170},{"style":439},[3171],{"type":398,"value":3137},{"type":393,"tag":427,"props":3173,"children":3174},{"style":584},[3175],{"type":398,"value":3151},{"type":393,"tag":427,"props":3177,"children":3178},{"style":439},[3179],{"type":398,"value":3180},":]",{"type":393,"tag":427,"props":3182,"children":3183},{"style":584},[3184],{"type":398,"value":3123},{"type":393,"tag":427,"props":3186,"children":3187},{"style":493},[3188],{"type":398,"value":3189},"\"\n",{"type":393,"tag":427,"props":3191,"children":3192},{"class":429,"line":215},[3193,3198],{"type":393,"tag":427,"props":3194,"children":3195},{"style":433},[3196],{"type":398,"value":3197},"    return",{"type":393,"tag":427,"props":3199,"children":3200},{"style":439},[3201],{"type":398,"value":3202}," phone\n",{"type":393,"tag":427,"props":3204,"children":3205},{"class":429,"line":224},[3206],{"type":393,"tag":427,"props":3207,"children":3208},{"emptyLinePlaceholder":12},[3209],{"type":398,"value":460},{"type":393,"tag":427,"props":3211,"children":3212},{"class":429,"line":233},[3213],{"type":393,"tag":427,"props":3214,"children":3215},{"style":466},[3216],{"type":398,"value":3217},"# Student data\n",{"type":393,"tag":427,"props":3219,"children":3220},{"class":429,"line":244},[3221,3226,3230],{"type":393,"tag":427,"props":3222,"children":3223},{"style":439},[3224],{"type":398,"value":3225},"students ",{"type":393,"tag":427,"props":3227,"children":3228},{"style":433},[3229],{"type":398,"value":482},{"type":393,"tag":427,"props":3231,"children":3232},{"style":439},[3233],{"type":398,"value":487},{"type":393,"tag":427,"props":3235,"children":3236},{"class":429,"line":253},[3237,3241,3245,3249,3253,3257,3261,3265],{"type":393,"tag":427,"props":3238,"children":3239},{"style":493},[3240],{"type":398,"value":496},{"type":393,"tag":427,"props":3242,"children":3243},{"style":439},[3244],{"type":398,"value":501},{"type":393,"tag":427,"props":3246,"children":3247},{"style":493},[3248],{"type":398,"value":2256},{"type":393,"tag":427,"props":3250,"children":3251},{"style":439},[3252],{"type":398,"value":511},{"type":393,"tag":427,"props":3254,"children":3255},{"style":493},[3256],{"type":398,"value":2265},{"type":393,"tag":427,"props":3258,"children":3259},{"style":439},[3260],{"type":398,"value":511},{"type":393,"tag":427,"props":3262,"children":3263},{"style":493},[3264],{"type":398,"value":2274},{"type":393,"tag":427,"props":3266,"children":3267},{"style":439},[3268],{"type":398,"value":530},{"type":393,"tag":427,"props":3270,"children":3271},{"class":429,"line":262},[3272,3277,3281,3286,3290,3295,3299,3304],{"type":393,"tag":427,"props":3273,"children":3274},{"style":493},[3275],{"type":398,"value":3276},"    'score'",{"type":393,"tag":427,"props":3278,"children":3279},{"style":439},[3280],{"type":398,"value":501},{"type":393,"tag":427,"props":3282,"children":3283},{"style":584},[3284],{"type":398,"value":3285},"95",{"type":393,"tag":427,"props":3287,"children":3288},{"style":439},[3289],{"type":398,"value":511},{"type":393,"tag":427,"props":3291,"children":3292},{"style":584},[3293],{"type":398,"value":3294},"83",{"type":393,"tag":427,"props":3296,"children":3297},{"style":439},[3298],{"type":398,"value":511},{"type":393,"tag":427,"props":3300,"children":3301},{"style":584},[3302],{"type":398,"value":3303},"67",{"type":393,"tag":427,"props":3305,"children":3306},{"style":439},[3307],{"type":398,"value":530},{"type":393,"tag":427,"props":3309,"children":3310},{"class":429,"line":271},[3311,3316,3320,3325,3329,3334,3338,3343],{"type":393,"tag":427,"props":3312,"children":3313},{"style":493},[3314],{"type":398,"value":3315},"    'phone'",{"type":393,"tag":427,"props":3317,"children":3318},{"style":439},[3319],{"type":398,"value":501},{"type":393,"tag":427,"props":3321,"children":3322},{"style":493},[3323],{"type":398,"value":3324},"'1234567890'",{"type":393,"tag":427,"props":3326,"children":3327},{"style":439},[3328],{"type":398,"value":511},{"type":393,"tag":427,"props":3330,"children":3331},{"style":493},[3332],{"type":398,"value":3333},"'555-123-4567'",{"type":393,"tag":427,"props":3335,"children":3336},{"style":439},[3337],{"type":398,"value":511},{"type":393,"tag":427,"props":3339,"children":3340},{"style":493},[3341],{"type":398,"value":3342},"'9876543210'",{"type":393,"tag":427,"props":3344,"children":3345},{"style":439},[3346],{"type":398,"value":610},{"type":393,"tag":427,"props":3348,"children":3349},{"class":429,"line":281},[3350],{"type":393,"tag":427,"props":3351,"children":3352},{"style":439},[3353],{"type":398,"value":618},{"type":393,"tag":427,"props":3355,"children":3356},{"class":429,"line":290},[3357],{"type":393,"tag":427,"props":3358,"children":3359},{"emptyLinePlaceholder":12},[3360],{"type":398,"value":460},{"type":393,"tag":427,"props":3362,"children":3363},{"class":429,"line":299},[3364,3368,3372,3377],{"type":393,"tag":427,"props":3365,"children":3366},{"style":584},[3367],{"type":398,"value":633},{"type":393,"tag":427,"props":3369,"children":3370},{"style":439},[3371],{"type":398,"value":638},{"type":393,"tag":427,"props":3373,"children":3374},{"style":493},[3375],{"type":398,"value":3376},"\"Student data:\"",{"type":393,"tag":427,"props":3378,"children":3379},{"style":439},[3380],{"type":398,"value":648},{"type":393,"tag":427,"props":3382,"children":3383},{"class":429,"line":308},[3384,3388],{"type":393,"tag":427,"props":3385,"children":3386},{"style":584},[3387],{"type":398,"value":633},{"type":393,"tag":427,"props":3389,"children":3390},{"style":439},[3391],{"type":398,"value":3392},"(students)\n",{"type":393,"tag":427,"props":3394,"children":3395},{"class":429,"line":318},[3396,3400],{"type":393,"tag":427,"props":3397,"children":3398},{"style":584},[3399],{"type":398,"value":633},{"type":393,"tag":427,"props":3401,"children":3402},{"style":439},[3403],{"type":398,"value":672},{"type":393,"tag":427,"props":3405,"children":3406},{"class":429,"line":327},[3407],{"type":393,"tag":427,"props":3408,"children":3409},{"emptyLinePlaceholder":12},[3410],{"type":398,"value":460},{"type":393,"tag":427,"props":3412,"children":3413},{"class":429,"line":336},[3414],{"type":393,"tag":427,"props":3415,"children":3416},{"style":466},[3417],{"type":398,"value":3418},"# Apply custom functions\n",{"type":393,"tag":427,"props":3420,"children":3421},{"class":429,"line":346},[3422,3427,3432,3436,3440,3445,3450],{"type":393,"tag":427,"props":3423,"children":3424},{"style":439},[3425],{"type":398,"value":3426},"students[",{"type":393,"tag":427,"props":3428,"children":3429},{"style":493},[3430],{"type":398,"value":3431},"'letter_grade'",{"type":393,"tag":427,"props":3433,"children":3434},{"style":439},[3435],{"type":398,"value":705},{"type":393,"tag":427,"props":3437,"children":3438},{"style":433},[3439],{"type":398,"value":482},{"type":393,"tag":427,"props":3441,"children":3442},{"style":439},[3443],{"type":398,"value":3444}," students[",{"type":393,"tag":427,"props":3446,"children":3447},{"style":493},[3448],{"type":398,"value":3449},"'score'",{"type":393,"tag":427,"props":3451,"children":3452},{"style":439},[3453],{"type":398,"value":3454},"].apply(categorize_grade)\n",{"type":393,"tag":427,"props":3456,"children":3457},{"class":429,"line":355},[3458,3462,3467,3471,3475,3479,3484],{"type":393,"tag":427,"props":3459,"children":3460},{"style":439},[3461],{"type":398,"value":3426},{"type":393,"tag":427,"props":3463,"children":3464},{"style":493},[3465],{"type":398,"value":3466},"'phone_formatted'",{"type":393,"tag":427,"props":3468,"children":3469},{"style":439},[3470],{"type":398,"value":705},{"type":393,"tag":427,"props":3472,"children":3473},{"style":433},[3474],{"type":398,"value":482},{"type":393,"tag":427,"props":3476,"children":3477},{"style":439},[3478],{"type":398,"value":3444},{"type":393,"tag":427,"props":3480,"children":3481},{"style":493},[3482],{"type":398,"value":3483},"'phone'",{"type":393,"tag":427,"props":3485,"children":3486},{"style":439},[3487],{"type":398,"value":3488},"].apply(format_phone)\n",{"type":393,"tag":427,"props":3490,"children":3491},{"class":429,"line":364},[3492],{"type":393,"tag":427,"props":3493,"children":3494},{"emptyLinePlaceholder":12},[3495],{"type":398,"value":460},{"type":393,"tag":427,"props":3497,"children":3498},{"class":429,"line":374},[3499,3503,3507,3512],{"type":393,"tag":427,"props":3500,"children":3501},{"style":584},[3502],{"type":398,"value":633},{"type":393,"tag":427,"props":3504,"children":3505},{"style":439},[3506],{"type":398,"value":638},{"type":393,"tag":427,"props":3508,"children":3509},{"style":493},[3510],{"type":398,"value":3511},"\"With custom functions:\"",{"type":393,"tag":427,"props":3513,"children":3514},{"style":439},[3515],{"type":398,"value":648},{"type":393,"tag":427,"props":3517,"children":3518},{"class":429,"line":383},[3519,3523],{"type":393,"tag":427,"props":3520,"children":3521},{"style":584},[3522],{"type":398,"value":633},{"type":393,"tag":427,"props":3524,"children":3525},{"style":439},[3526],{"type":398,"value":3392},{"type":393,"tag":907,"props":3528,"children":3530},{"id":3529},"applying-functions-to-multiple-columns",[3531],{"type":398,"value":3532},"📊 Applying Functions to Multiple Columns",{"type":393,"tag":401,"props":3534,"children":3535},{},[3536],{"type":398,"value":3537},"Sometimes you need to use data from multiple columns:",{"type":393,"tag":412,"props":3539,"children":3540},{},[3541],{"type":393,"tag":416,"props":3542,"children":3544},{"className":418,"code":3543,"language":420,"meta":6,"style":6},"import pandas as pd\n\ndef calculate_bmi(row):\n    \"\"\"Calculate BMI from height and weight\"\"\"\n    height_m = row['height_cm'] / 100\n    bmi = row['weight_kg'] / (height_m ** 2)\n    return round(bmi, 1)\n\ndef full_address(row):\n    \"\"\"Combine address components\"\"\"\n    return f\"{row['street']}, {row['city']}, {row['state']}\"\n\n# Health data\nhealth = pd.DataFrame({\n    'name': ['Alice', 'Bob', 'Charlie'],\n    'height_cm': [165, 180, 175],\n    'weight_kg': [65, 80, 70],\n    'street': ['123 Main St', '456 Oak Ave', '789 Pine Rd'],\n    'city': ['Boston', 'Chicago', 'Denver'],\n    'state': ['MA', 'IL', 'CO']\n})\n\nprint(\"Health data:\")\nprint(health[['name', 'height_cm', 'weight_kg']])\nprint()\n\n# Apply functions using multiple columns\nhealth['bmi'] = health.apply(calculate_bmi, axis=1)\nhealth['full_address'] = health.apply(full_address, axis=1)\n\nprint(\"With calculated values:\")\nprint(health[['name', 'bmi', 'full_address']])\n",[3545],{"type":393,"tag":423,"props":3546,"children":3547},{"__ignoreMap":6},[3548,3567,3574,3591,3599,3635,3683,3709,3716,3732,3740,3831,3838,3846,3862,3897,3936,3975,4014,4053,4092,4099,4106,4126,4162,4173,4180,4188,4232,4273,4280,4300],{"type":393,"tag":427,"props":3549,"children":3550},{"class":429,"line":11},[3551,3555,3559,3563],{"type":393,"tag":427,"props":3552,"children":3553},{"style":433},[3554],{"type":398,"value":436},{"type":393,"tag":427,"props":3556,"children":3557},{"style":439},[3558],{"type":398,"value":442},{"type":393,"tag":427,"props":3560,"children":3561},{"style":433},[3562],{"type":398,"value":447},{"type":393,"tag":427,"props":3564,"children":3565},{"style":439},[3566],{"type":398,"value":452},{"type":393,"tag":427,"props":3568,"children":3569},{"class":429,"line":27},[3570],{"type":393,"tag":427,"props":3571,"children":3572},{"emptyLinePlaceholder":12},[3573],{"type":398,"value":460},{"type":393,"tag":427,"props":3575,"children":3576},{"class":429,"line":36},[3577,3581,3586],{"type":393,"tag":427,"props":3578,"children":3579},{"style":433},[3580],{"type":398,"value":2769},{"type":393,"tag":427,"props":3582,"children":3583},{"style":2772},[3584],{"type":398,"value":3585}," calculate_bmi",{"type":393,"tag":427,"props":3587,"children":3588},{"style":439},[3589],{"type":398,"value":3590},"(row):\n",{"type":393,"tag":427,"props":3592,"children":3593},{"class":429,"line":45},[3594],{"type":393,"tag":427,"props":3595,"children":3596},{"style":493},[3597],{"type":398,"value":3598},"    \"\"\"Calculate BMI from height and weight\"\"\"\n",{"type":393,"tag":427,"props":3600,"children":3601},{"class":429,"line":54},[3602,3607,3611,3616,3621,3625,3630],{"type":393,"tag":427,"props":3603,"children":3604},{"style":439},[3605],{"type":398,"value":3606},"    height_m ",{"type":393,"tag":427,"props":3608,"children":3609},{"style":433},[3610],{"type":398,"value":482},{"type":393,"tag":427,"props":3612,"children":3613},{"style":439},[3614],{"type":398,"value":3615}," row[",{"type":393,"tag":427,"props":3617,"children":3618},{"style":493},[3619],{"type":398,"value":3620},"'height_cm'",{"type":393,"tag":427,"props":3622,"children":3623},{"style":439},[3624],{"type":398,"value":705},{"type":393,"tag":427,"props":3626,"children":3627},{"style":433},[3628],{"type":398,"value":3629},"/",{"type":393,"tag":427,"props":3631,"children":3632},{"style":584},[3633],{"type":398,"value":3634}," 100\n",{"type":393,"tag":427,"props":3636,"children":3637},{"class":429,"line":63},[3638,3643,3647,3651,3656,3660,3664,3669,3674,3679],{"type":393,"tag":427,"props":3639,"children":3640},{"style":439},[3641],{"type":398,"value":3642},"    bmi ",{"type":393,"tag":427,"props":3644,"children":3645},{"style":433},[3646],{"type":398,"value":482},{"type":393,"tag":427,"props":3648,"children":3649},{"style":439},[3650],{"type":398,"value":3615},{"type":393,"tag":427,"props":3652,"children":3653},{"style":493},[3654],{"type":398,"value":3655},"'weight_kg'",{"type":393,"tag":427,"props":3657,"children":3658},{"style":439},[3659],{"type":398,"value":705},{"type":393,"tag":427,"props":3661,"children":3662},{"style":433},[3663],{"type":398,"value":3629},{"type":393,"tag":427,"props":3665,"children":3666},{"style":439},[3667],{"type":398,"value":3668}," (height_m ",{"type":393,"tag":427,"props":3670,"children":3671},{"style":433},[3672],{"type":398,"value":3673},"**",{"type":393,"tag":427,"props":3675,"children":3676},{"style":584},[3677],{"type":398,"value":3678}," 2",{"type":393,"tag":427,"props":3680,"children":3681},{"style":439},[3682],{"type":398,"value":648},{"type":393,"tag":427,"props":3684,"children":3685},{"class":429,"line":72},[3686,3690,3695,3700,3705],{"type":393,"tag":427,"props":3687,"children":3688},{"style":433},[3689],{"type":398,"value":3197},{"type":393,"tag":427,"props":3691,"children":3692},{"style":584},[3693],{"type":398,"value":3694}," round",{"type":393,"tag":427,"props":3696,"children":3697},{"style":439},[3698],{"type":398,"value":3699},"(bmi, ",{"type":393,"tag":427,"props":3701,"children":3702},{"style":584},[3703],{"type":398,"value":3704},"1",{"type":393,"tag":427,"props":3706,"children":3707},{"style":439},[3708],{"type":398,"value":648},{"type":393,"tag":427,"props":3710,"children":3711},{"class":429,"line":83},[3712],{"type":393,"tag":427,"props":3713,"children":3714},{"emptyLinePlaceholder":12},[3715],{"type":398,"value":460},{"type":393,"tag":427,"props":3717,"children":3718},{"class":429,"line":92},[3719,3723,3728],{"type":393,"tag":427,"props":3720,"children":3721},{"style":433},[3722],{"type":398,"value":2769},{"type":393,"tag":427,"props":3724,"children":3725},{"style":2772},[3726],{"type":398,"value":3727}," full_address",{"type":393,"tag":427,"props":3729,"children":3730},{"style":439},[3731],{"type":398,"value":3590},{"type":393,"tag":427,"props":3733,"children":3734},{"class":429,"line":101},[3735],{"type":393,"tag":427,"props":3736,"children":3737},{"style":493},[3738],{"type":398,"value":3739},"    \"\"\"Combine address components\"\"\"\n",{"type":393,"tag":427,"props":3741,"children":3742},{"class":429,"line":110},[3743,3747,3751,3755,3759,3764,3769,3773,3777,3781,3785,3789,3794,3798,3802,3806,3810,3814,3819,3823,3827],{"type":393,"tag":427,"props":3744,"children":3745},{"style":433},[3746],{"type":398,"value":3197},{"type":393,"tag":427,"props":3748,"children":3749},{"style":433},[3750],{"type":398,"value":3094},{"type":393,"tag":427,"props":3752,"children":3753},{"style":493},[3754],{"type":398,"value":2480},{"type":393,"tag":427,"props":3756,"children":3757},{"style":584},[3758],{"type":398,"value":2485},{"type":393,"tag":427,"props":3760,"children":3761},{"style":439},[3762],{"type":398,"value":3763},"row[",{"type":393,"tag":427,"props":3765,"children":3766},{"style":493},[3767],{"type":398,"value":3768},"'street'",{"type":393,"tag":427,"props":3770,"children":3771},{"style":439},[3772],{"type":398,"value":3118},{"type":393,"tag":427,"props":3774,"children":3775},{"style":584},[3776],{"type":398,"value":3123},{"type":393,"tag":427,"props":3778,"children":3779},{"style":493},[3780],{"type":398,"value":511},{"type":393,"tag":427,"props":3782,"children":3783},{"style":584},[3784],{"type":398,"value":2485},{"type":393,"tag":427,"props":3786,"children":3787},{"style":439},[3788],{"type":398,"value":3763},{"type":393,"tag":427,"props":3790,"children":3791},{"style":493},[3792],{"type":398,"value":3793},"'city'",{"type":393,"tag":427,"props":3795,"children":3796},{"style":439},[3797],{"type":398,"value":3118},{"type":393,"tag":427,"props":3799,"children":3800},{"style":584},[3801],{"type":398,"value":3123},{"type":393,"tag":427,"props":3803,"children":3804},{"style":493},[3805],{"type":398,"value":511},{"type":393,"tag":427,"props":3807,"children":3808},{"style":584},[3809],{"type":398,"value":2485},{"type":393,"tag":427,"props":3811,"children":3812},{"style":439},[3813],{"type":398,"value":3763},{"type":393,"tag":427,"props":3815,"children":3816},{"style":493},[3817],{"type":398,"value":3818},"'state'",{"type":393,"tag":427,"props":3820,"children":3821},{"style":439},[3822],{"type":398,"value":3118},{"type":393,"tag":427,"props":3824,"children":3825},{"style":584},[3826],{"type":398,"value":3123},{"type":393,"tag":427,"props":3828,"children":3829},{"style":493},[3830],{"type":398,"value":3189},{"type":393,"tag":427,"props":3832,"children":3833},{"class":429,"line":121},[3834],{"type":393,"tag":427,"props":3835,"children":3836},{"emptyLinePlaceholder":12},[3837],{"type":398,"value":460},{"type":393,"tag":427,"props":3839,"children":3840},{"class":429,"line":130},[3841],{"type":393,"tag":427,"props":3842,"children":3843},{"style":466},[3844],{"type":398,"value":3845},"# Health data\n",{"type":393,"tag":427,"props":3847,"children":3848},{"class":429,"line":139},[3849,3854,3858],{"type":393,"tag":427,"props":3850,"children":3851},{"style":439},[3852],{"type":398,"value":3853},"health ",{"type":393,"tag":427,"props":3855,"children":3856},{"style":433},[3857],{"type":398,"value":482},{"type":393,"tag":427,"props":3859,"children":3860},{"style":439},[3861],{"type":398,"value":487},{"type":393,"tag":427,"props":3863,"children":3864},{"class":429,"line":148},[3865,3869,3873,3877,3881,3885,3889,3893],{"type":393,"tag":427,"props":3866,"children":3867},{"style":493},[3868],{"type":398,"value":496},{"type":393,"tag":427,"props":3870,"children":3871},{"style":439},[3872],{"type":398,"value":501},{"type":393,"tag":427,"props":3874,"children":3875},{"style":493},[3876],{"type":398,"value":2256},{"type":393,"tag":427,"props":3878,"children":3879},{"style":439},[3880],{"type":398,"value":511},{"type":393,"tag":427,"props":3882,"children":3883},{"style":493},[3884],{"type":398,"value":2265},{"type":393,"tag":427,"props":3886,"children":3887},{"style":439},[3888],{"type":398,"value":511},{"type":393,"tag":427,"props":3890,"children":3891},{"style":493},[3892],{"type":398,"value":2274},{"type":393,"tag":427,"props":3894,"children":3895},{"style":439},[3896],{"type":398,"value":530},{"type":393,"tag":427,"props":3898,"children":3899},{"class":429,"line":159},[3900,3905,3909,3914,3918,3923,3927,3932],{"type":393,"tag":427,"props":3901,"children":3902},{"style":493},[3903],{"type":398,"value":3904},"    'height_cm'",{"type":393,"tag":427,"props":3906,"children":3907},{"style":439},[3908],{"type":398,"value":501},{"type":393,"tag":427,"props":3910,"children":3911},{"style":584},[3912],{"type":398,"value":3913},"165",{"type":393,"tag":427,"props":3915,"children":3916},{"style":439},[3917],{"type":398,"value":511},{"type":393,"tag":427,"props":3919,"children":3920},{"style":584},[3921],{"type":398,"value":3922},"180",{"type":393,"tag":427,"props":3924,"children":3925},{"style":439},[3926],{"type":398,"value":511},{"type":393,"tag":427,"props":3928,"children":3929},{"style":584},[3930],{"type":398,"value":3931},"175",{"type":393,"tag":427,"props":3933,"children":3934},{"style":439},[3935],{"type":398,"value":530},{"type":393,"tag":427,"props":3937,"children":3938},{"class":429,"line":168},[3939,3944,3948,3953,3957,3962,3966,3971],{"type":393,"tag":427,"props":3940,"children":3941},{"style":493},[3942],{"type":398,"value":3943},"    'weight_kg'",{"type":393,"tag":427,"props":3945,"children":3946},{"style":439},[3947],{"type":398,"value":501},{"type":393,"tag":427,"props":3949,"children":3950},{"style":584},[3951],{"type":398,"value":3952},"65",{"type":393,"tag":427,"props":3954,"children":3955},{"style":439},[3956],{"type":398,"value":511},{"type":393,"tag":427,"props":3958,"children":3959},{"style":584},[3960],{"type":398,"value":3961},"80",{"type":393,"tag":427,"props":3963,"children":3964},{"style":439},[3965],{"type":398,"value":511},{"type":393,"tag":427,"props":3967,"children":3968},{"style":584},[3969],{"type":398,"value":3970},"70",{"type":393,"tag":427,"props":3972,"children":3973},{"style":439},[3974],{"type":398,"value":530},{"type":393,"tag":427,"props":3976,"children":3977},{"class":429,"line":177},[3978,3983,3987,3992,3996,4001,4005,4010],{"type":393,"tag":427,"props":3979,"children":3980},{"style":493},[3981],{"type":398,"value":3982},"    'street'",{"type":393,"tag":427,"props":3984,"children":3985},{"style":439},[3986],{"type":398,"value":501},{"type":393,"tag":427,"props":3988,"children":3989},{"style":493},[3990],{"type":398,"value":3991},"'123 Main St'",{"type":393,"tag":427,"props":3993,"children":3994},{"style":439},[3995],{"type":398,"value":511},{"type":393,"tag":427,"props":3997,"children":3998},{"style":493},[3999],{"type":398,"value":4000},"'456 Oak Ave'",{"type":393,"tag":427,"props":4002,"children":4003},{"style":439},[4004],{"type":398,"value":511},{"type":393,"tag":427,"props":4006,"children":4007},{"style":493},[4008],{"type":398,"value":4009},"'789 Pine Rd'",{"type":393,"tag":427,"props":4011,"children":4012},{"style":439},[4013],{"type":398,"value":530},{"type":393,"tag":427,"props":4015,"children":4016},{"class":429,"line":186},[4017,4022,4026,4031,4035,4040,4044,4049],{"type":393,"tag":427,"props":4018,"children":4019},{"style":493},[4020],{"type":398,"value":4021},"    'city'",{"type":393,"tag":427,"props":4023,"children":4024},{"style":439},[4025],{"type":398,"value":501},{"type":393,"tag":427,"props":4027,"children":4028},{"style":493},[4029],{"type":398,"value":4030},"'Boston'",{"type":393,"tag":427,"props":4032,"children":4033},{"style":439},[4034],{"type":398,"value":511},{"type":393,"tag":427,"props":4036,"children":4037},{"style":493},[4038],{"type":398,"value":4039},"'Chicago'",{"type":393,"tag":427,"props":4041,"children":4042},{"style":439},[4043],{"type":398,"value":511},{"type":393,"tag":427,"props":4045,"children":4046},{"style":493},[4047],{"type":398,"value":4048},"'Denver'",{"type":393,"tag":427,"props":4050,"children":4051},{"style":439},[4052],{"type":398,"value":530},{"type":393,"tag":427,"props":4054,"children":4055},{"class":429,"line":197},[4056,4061,4065,4070,4074,4079,4083,4088],{"type":393,"tag":427,"props":4057,"children":4058},{"style":493},[4059],{"type":398,"value":4060},"    'state'",{"type":393,"tag":427,"props":4062,"children":4063},{"style":439},[4064],{"type":398,"value":501},{"type":393,"tag":427,"props":4066,"children":4067},{"style":493},[4068],{"type":398,"value":4069},"'MA'",{"type":393,"tag":427,"props":4071,"children":4072},{"style":439},[4073],{"type":398,"value":511},{"type":393,"tag":427,"props":4075,"children":4076},{"style":493},[4077],{"type":398,"value":4078},"'IL'",{"type":393,"tag":427,"props":4080,"children":4081},{"style":439},[4082],{"type":398,"value":511},{"type":393,"tag":427,"props":4084,"children":4085},{"style":493},[4086],{"type":398,"value":4087},"'CO'",{"type":393,"tag":427,"props":4089,"children":4090},{"style":439},[4091],{"type":398,"value":610},{"type":393,"tag":427,"props":4093,"children":4094},{"class":429,"line":206},[4095],{"type":393,"tag":427,"props":4096,"children":4097},{"style":439},[4098],{"type":398,"value":618},{"type":393,"tag":427,"props":4100,"children":4101},{"class":429,"line":215},[4102],{"type":393,"tag":427,"props":4103,"children":4104},{"emptyLinePlaceholder":12},[4105],{"type":398,"value":460},{"type":393,"tag":427,"props":4107,"children":4108},{"class":429,"line":224},[4109,4113,4117,4122],{"type":393,"tag":427,"props":4110,"children":4111},{"style":584},[4112],{"type":398,"value":633},{"type":393,"tag":427,"props":4114,"children":4115},{"style":439},[4116],{"type":398,"value":638},{"type":393,"tag":427,"props":4118,"children":4119},{"style":493},[4120],{"type":398,"value":4121},"\"Health data:\"",{"type":393,"tag":427,"props":4123,"children":4124},{"style":439},[4125],{"type":398,"value":648},{"type":393,"tag":427,"props":4127,"children":4128},{"class":429,"line":233},[4129,4133,4138,4142,4146,4150,4154,4158],{"type":393,"tag":427,"props":4130,"children":4131},{"style":584},[4132],{"type":398,"value":633},{"type":393,"tag":427,"props":4134,"children":4135},{"style":439},[4136],{"type":398,"value":4137},"(health[[",{"type":393,"tag":427,"props":4139,"children":4140},{"style":493},[4141],{"type":398,"value":719},{"type":393,"tag":427,"props":4143,"children":4144},{"style":439},[4145],{"type":398,"value":511},{"type":393,"tag":427,"props":4147,"children":4148},{"style":493},[4149],{"type":398,"value":3620},{"type":393,"tag":427,"props":4151,"children":4152},{"style":439},[4153],{"type":398,"value":511},{"type":393,"tag":427,"props":4155,"children":4156},{"style":493},[4157],{"type":398,"value":3655},{"type":393,"tag":427,"props":4159,"children":4160},{"style":439},[4161],{"type":398,"value":905},{"type":393,"tag":427,"props":4163,"children":4164},{"class":429,"line":244},[4165,4169],{"type":393,"tag":427,"props":4166,"children":4167},{"style":584},[4168],{"type":398,"value":633},{"type":393,"tag":427,"props":4170,"children":4171},{"style":439},[4172],{"type":398,"value":672},{"type":393,"tag":427,"props":4174,"children":4175},{"class":429,"line":253},[4176],{"type":393,"tag":427,"props":4177,"children":4178},{"emptyLinePlaceholder":12},[4179],{"type":398,"value":460},{"type":393,"tag":427,"props":4181,"children":4182},{"class":429,"line":262},[4183],{"type":393,"tag":427,"props":4184,"children":4185},{"style":466},[4186],{"type":398,"value":4187},"# Apply functions using multiple columns\n",{"type":393,"tag":427,"props":4189,"children":4190},{"class":429,"line":271},[4191,4196,4201,4205,4209,4214,4220,4224,4228],{"type":393,"tag":427,"props":4192,"children":4193},{"style":439},[4194],{"type":398,"value":4195},"health[",{"type":393,"tag":427,"props":4197,"children":4198},{"style":493},[4199],{"type":398,"value":4200},"'bmi'",{"type":393,"tag":427,"props":4202,"children":4203},{"style":439},[4204],{"type":398,"value":705},{"type":393,"tag":427,"props":4206,"children":4207},{"style":433},[4208],{"type":398,"value":482},{"type":393,"tag":427,"props":4210,"children":4211},{"style":439},[4212],{"type":398,"value":4213}," health.apply(calculate_bmi, ",{"type":393,"tag":427,"props":4215,"children":4217},{"style":4216},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[4218],{"type":398,"value":4219},"axis",{"type":393,"tag":427,"props":4221,"children":4222},{"style":433},[4223],{"type":398,"value":482},{"type":393,"tag":427,"props":4225,"children":4226},{"style":584},[4227],{"type":398,"value":3704},{"type":393,"tag":427,"props":4229,"children":4230},{"style":439},[4231],{"type":398,"value":648},{"type":393,"tag":427,"props":4233,"children":4234},{"class":429,"line":281},[4235,4239,4244,4248,4252,4257,4261,4265,4269],{"type":393,"tag":427,"props":4236,"children":4237},{"style":439},[4238],{"type":398,"value":4195},{"type":393,"tag":427,"props":4240,"children":4241},{"style":493},[4242],{"type":398,"value":4243},"'full_address'",{"type":393,"tag":427,"props":4245,"children":4246},{"style":439},[4247],{"type":398,"value":705},{"type":393,"tag":427,"props":4249,"children":4250},{"style":433},[4251],{"type":398,"value":482},{"type":393,"tag":427,"props":4253,"children":4254},{"style":439},[4255],{"type":398,"value":4256}," health.apply(full_address, ",{"type":393,"tag":427,"props":4258,"children":4259},{"style":4216},[4260],{"type":398,"value":4219},{"type":393,"tag":427,"props":4262,"children":4263},{"style":433},[4264],{"type":398,"value":482},{"type":393,"tag":427,"props":4266,"children":4267},{"style":584},[4268],{"type":398,"value":3704},{"type":393,"tag":427,"props":4270,"children":4271},{"style":439},[4272],{"type":398,"value":648},{"type":393,"tag":427,"props":4274,"children":4275},{"class":429,"line":290},[4276],{"type":393,"tag":427,"props":4277,"children":4278},{"emptyLinePlaceholder":12},[4279],{"type":398,"value":460},{"type":393,"tag":427,"props":4281,"children":4282},{"class":429,"line":299},[4283,4287,4291,4296],{"type":393,"tag":427,"props":4284,"children":4285},{"style":584},[4286],{"type":398,"value":633},{"type":393,"tag":427,"props":4288,"children":4289},{"style":439},[4290],{"type":398,"value":638},{"type":393,"tag":427,"props":4292,"children":4293},{"style":493},[4294],{"type":398,"value":4295},"\"With calculated values:\"",{"type":393,"tag":427,"props":4297,"children":4298},{"style":439},[4299],{"type":398,"value":648},{"type":393,"tag":427,"props":4301,"children":4302},{"class":429,"line":308},[4303,4307,4311,4315,4319,4323,4327,4331],{"type":393,"tag":427,"props":4304,"children":4305},{"style":584},[4306],{"type":398,"value":633},{"type":393,"tag":427,"props":4308,"children":4309},{"style":439},[4310],{"type":398,"value":4137},{"type":393,"tag":427,"props":4312,"children":4313},{"style":493},[4314],{"type":398,"value":719},{"type":393,"tag":427,"props":4316,"children":4317},{"style":439},[4318],{"type":398,"value":511},{"type":393,"tag":427,"props":4320,"children":4321},{"style":493},[4322],{"type":398,"value":4200},{"type":393,"tag":427,"props":4324,"children":4325},{"style":439},[4326],{"type":398,"value":511},{"type":393,"tag":427,"props":4328,"children":4329},{"style":493},[4330],{"type":398,"value":4243},{"type":393,"tag":427,"props":4332,"children":4333},{"style":439},[4334],{"type":398,"value":905},{"type":393,"tag":907,"props":4336,"children":4338},{"id":4337},"performance-tips",[4339],{"type":398,"value":4340},"⚡ Performance Tips",{"type":393,"tag":919,"props":4342,"children":4346},{"emoji":4343,"title":4344,"type":4345},"⚡","Function Performance Best Practices","warning",[4347,4355,4436,4444],{"type":393,"tag":401,"props":4348,"children":4349},{},[4350],{"type":393,"tag":929,"props":4351,"children":4352},{},[4353],{"type":398,"value":4354},"Fastest to Slowest:",{"type":393,"tag":4356,"props":4357,"children":4358},"ol",{},[4359,4382,4399,4416,4426],{"type":393,"tag":939,"props":4360,"children":4361},{},[4362,4367,4369,4374,4375,4380],{"type":393,"tag":929,"props":4363,"children":4364},{},[4365],{"type":398,"value":4366},"Built-in methods",{"type":398,"value":4368}," (",{"type":393,"tag":423,"props":4370,"children":4372},{"className":4371},[],[4373],{"type":398,"value":949},{"type":398,"value":511},{"type":393,"tag":423,"props":4376,"children":4378},{"className":4377},[],[4379],{"type":398,"value":967},{"type":398,"value":4381},") - Use these first!",{"type":393,"tag":939,"props":4383,"children":4384},{},[4385,4390,4391,4397],{"type":393,"tag":929,"props":4386,"children":4387},{},[4388],{"type":398,"value":4389},"Vectorized operations",{"type":398,"value":4368},{"type":393,"tag":423,"props":4392,"children":4394},{"className":4393},[],[4395],{"type":398,"value":4396},"df['col'] * 2",{"type":398,"value":4398},") - Very fast",{"type":393,"tag":939,"props":4400,"children":4401},{},[4402,4407,4408,4414],{"type":393,"tag":929,"props":4403,"children":4404},{},[4405],{"type":398,"value":4406},"NumPy functions",{"type":398,"value":4368},{"type":393,"tag":423,"props":4409,"children":4411},{"className":4410},[],[4412],{"type":398,"value":4413},"np.sqrt(df['col'])",{"type":398,"value":4415},") - Fast",{"type":393,"tag":939,"props":4417,"children":4418},{},[4419,4424],{"type":393,"tag":929,"props":4420,"children":4421},{},[4422],{"type":398,"value":4423},"Simple lambda functions",{"type":398,"value":4425}," - Good performance",{"type":393,"tag":939,"props":4427,"children":4428},{},[4429,4434],{"type":393,"tag":929,"props":4430,"children":4431},{},[4432],{"type":398,"value":4433},"Complex custom functions",{"type":398,"value":4435}," - Slower but flexible",{"type":393,"tag":401,"props":4437,"children":4438},{},[4439],{"type":393,"tag":929,"props":4440,"children":4441},{},[4442],{"type":398,"value":4443},"Tips:",{"type":393,"tag":935,"props":4445,"children":4446},{},[4447,4452,4457,4470],{"type":393,"tag":939,"props":4448,"children":4449},{},[4450],{"type":398,"value":4451},"Use built-in functions when possible",{"type":393,"tag":939,"props":4453,"children":4454},{},[4455],{"type":398,"value":4456},"Avoid loops in custom functions",{"type":393,"tag":939,"props":4458,"children":4459},{},[4460,4462,4468],{"type":398,"value":4461},"Test performance with ",{"type":393,"tag":423,"props":4463,"children":4465},{"className":4464},[],[4466],{"type":398,"value":4467},".time()",{"type":398,"value":4469}," for large datasets",{"type":393,"tag":939,"props":4471,"children":4472},{},[4473,4475,4481],{"type":398,"value":4474},"Consider using ",{"type":393,"tag":423,"props":4476,"children":4478},{"className":4477},[],[4479],{"type":398,"value":4480},".map()",{"type":398,"value":4482}," for simple value replacements",{"type":393,"tag":907,"props":4484,"children":4486},{"id":4485},"alternative-map-for-simple-replacements",[4487],{"type":398,"value":4488},"🔄 Alternative: Map for Simple Replacements",{"type":393,"tag":401,"props":4490,"children":4491},{},[4492,4494,4499],{"type":398,"value":4493},"For simple value replacements, ",{"type":393,"tag":423,"props":4495,"children":4497},{"className":4496},[],[4498],{"type":398,"value":4480},{"type":398,"value":4500}," can be faster:",{"type":393,"tag":412,"props":4502,"children":4503},{},[4504],{"type":393,"tag":416,"props":4505,"children":4507},{"className":418,"code":4506,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Survey responses\nsurvey = pd.DataFrame({\n    'response': ['Y', 'N', 'Y', 'N', 'Y'],\n    'rating': [1, 2, 3, 4, 5]\n})\n\nprint(\"Survey data:\")\nprint(survey)\nprint()\n\n# Use map for simple replacements\nresponse_map = {'Y': 'Yes', 'N': 'No'}\nrating_map = {1: 'Poor', 2: 'Fair', 3: 'Good', 4: 'Very Good', 5: 'Excellent'}\n\nsurvey['response_text'] = survey['response'].map(response_map)\nsurvey['rating_text'] = survey['rating'].map(rating_map)\n\nprint(\"With mapped values:\")\nprint(survey)\n",[4508],{"type":393,"tag":423,"props":4509,"children":4510},{"__ignoreMap":6},[4511,4530,4537,4545,4561,4615,4668,4675,4682,4702,4714,4725,4732,4740,4793,4894,4901,4937,4971,4978,4998],{"type":393,"tag":427,"props":4512,"children":4513},{"class":429,"line":11},[4514,4518,4522,4526],{"type":393,"tag":427,"props":4515,"children":4516},{"style":433},[4517],{"type":398,"value":436},{"type":393,"tag":427,"props":4519,"children":4520},{"style":439},[4521],{"type":398,"value":442},{"type":393,"tag":427,"props":4523,"children":4524},{"style":433},[4525],{"type":398,"value":447},{"type":393,"tag":427,"props":4527,"children":4528},{"style":439},[4529],{"type":398,"value":452},{"type":393,"tag":427,"props":4531,"children":4532},{"class":429,"line":27},[4533],{"type":393,"tag":427,"props":4534,"children":4535},{"emptyLinePlaceholder":12},[4536],{"type":398,"value":460},{"type":393,"tag":427,"props":4538,"children":4539},{"class":429,"line":36},[4540],{"type":393,"tag":427,"props":4541,"children":4542},{"style":466},[4543],{"type":398,"value":4544},"# Survey responses\n",{"type":393,"tag":427,"props":4546,"children":4547},{"class":429,"line":45},[4548,4553,4557],{"type":393,"tag":427,"props":4549,"children":4550},{"style":439},[4551],{"type":398,"value":4552},"survey ",{"type":393,"tag":427,"props":4554,"children":4555},{"style":433},[4556],{"type":398,"value":482},{"type":393,"tag":427,"props":4558,"children":4559},{"style":439},[4560],{"type":398,"value":487},{"type":393,"tag":427,"props":4562,"children":4563},{"class":429,"line":54},[4564,4569,4573,4578,4582,4587,4591,4595,4599,4603,4607,4611],{"type":393,"tag":427,"props":4565,"children":4566},{"style":493},[4567],{"type":398,"value":4568},"    'response'",{"type":393,"tag":427,"props":4570,"children":4571},{"style":439},[4572],{"type":398,"value":501},{"type":393,"tag":427,"props":4574,"children":4575},{"style":493},[4576],{"type":398,"value":4577},"'Y'",{"type":393,"tag":427,"props":4579,"children":4580},{"style":439},[4581],{"type":398,"value":511},{"type":393,"tag":427,"props":4583,"children":4584},{"style":493},[4585],{"type":398,"value":4586},"'N'",{"type":393,"tag":427,"props":4588,"children":4589},{"style":439},[4590],{"type":398,"value":511},{"type":393,"tag":427,"props":4592,"children":4593},{"style":493},[4594],{"type":398,"value":4577},{"type":393,"tag":427,"props":4596,"children":4597},{"style":439},[4598],{"type":398,"value":511},{"type":393,"tag":427,"props":4600,"children":4601},{"style":493},[4602],{"type":398,"value":4586},{"type":393,"tag":427,"props":4604,"children":4605},{"style":439},[4606],{"type":398,"value":511},{"type":393,"tag":427,"props":4608,"children":4609},{"style":493},[4610],{"type":398,"value":4577},{"type":393,"tag":427,"props":4612,"children":4613},{"style":439},[4614],{"type":398,"value":530},{"type":393,"tag":427,"props":4616,"children":4617},{"class":429,"line":63},[4618,4623,4627,4631,4635,4639,4643,4647,4651,4656,4660,4664],{"type":393,"tag":427,"props":4619,"children":4620},{"style":493},[4621],{"type":398,"value":4622},"    'rating'",{"type":393,"tag":427,"props":4624,"children":4625},{"style":439},[4626],{"type":398,"value":501},{"type":393,"tag":427,"props":4628,"children":4629},{"style":584},[4630],{"type":398,"value":3704},{"type":393,"tag":427,"props":4632,"children":4633},{"style":439},[4634],{"type":398,"value":511},{"type":393,"tag":427,"props":4636,"children":4637},{"style":584},[4638],{"type":398,"value":2036},{"type":393,"tag":427,"props":4640,"children":4641},{"style":439},[4642],{"type":398,"value":511},{"type":393,"tag":427,"props":4644,"children":4645},{"style":584},[4646],{"type":398,"value":3113},{"type":393,"tag":427,"props":4648,"children":4649},{"style":439},[4650],{"type":398,"value":511},{"type":393,"tag":427,"props":4652,"children":4653},{"style":584},[4654],{"type":398,"value":4655},"4",{"type":393,"tag":427,"props":4657,"children":4658},{"style":439},[4659],{"type":398,"value":511},{"type":393,"tag":427,"props":4661,"children":4662},{"style":584},[4663],{"type":398,"value":2351},{"type":393,"tag":427,"props":4665,"children":4666},{"style":439},[4667],{"type":398,"value":610},{"type":393,"tag":427,"props":4669,"children":4670},{"class":429,"line":72},[4671],{"type":393,"tag":427,"props":4672,"children":4673},{"style":439},[4674],{"type":398,"value":618},{"type":393,"tag":427,"props":4676,"children":4677},{"class":429,"line":83},[4678],{"type":393,"tag":427,"props":4679,"children":4680},{"emptyLinePlaceholder":12},[4681],{"type":398,"value":460},{"type":393,"tag":427,"props":4683,"children":4684},{"class":429,"line":92},[4685,4689,4693,4698],{"type":393,"tag":427,"props":4686,"children":4687},{"style":584},[4688],{"type":398,"value":633},{"type":393,"tag":427,"props":4690,"children":4691},{"style":439},[4692],{"type":398,"value":638},{"type":393,"tag":427,"props":4694,"children":4695},{"style":493},[4696],{"type":398,"value":4697},"\"Survey data:\"",{"type":393,"tag":427,"props":4699,"children":4700},{"style":439},[4701],{"type":398,"value":648},{"type":393,"tag":427,"props":4703,"children":4704},{"class":429,"line":101},[4705,4709],{"type":393,"tag":427,"props":4706,"children":4707},{"style":584},[4708],{"type":398,"value":633},{"type":393,"tag":427,"props":4710,"children":4711},{"style":439},[4712],{"type":398,"value":4713},"(survey)\n",{"type":393,"tag":427,"props":4715,"children":4716},{"class":429,"line":110},[4717,4721],{"type":393,"tag":427,"props":4718,"children":4719},{"style":584},[4720],{"type":398,"value":633},{"type":393,"tag":427,"props":4722,"children":4723},{"style":439},[4724],{"type":398,"value":672},{"type":393,"tag":427,"props":4726,"children":4727},{"class":429,"line":121},[4728],{"type":393,"tag":427,"props":4729,"children":4730},{"emptyLinePlaceholder":12},[4731],{"type":398,"value":460},{"type":393,"tag":427,"props":4733,"children":4734},{"class":429,"line":130},[4735],{"type":393,"tag":427,"props":4736,"children":4737},{"style":466},[4738],{"type":398,"value":4739},"# Use map for simple replacements\n",{"type":393,"tag":427,"props":4741,"children":4742},{"class":429,"line":139},[4743,4748,4752,4757,4761,4766,4771,4775,4779,4783,4788],{"type":393,"tag":427,"props":4744,"children":4745},{"style":439},[4746],{"type":398,"value":4747},"response_map ",{"type":393,"tag":427,"props":4749,"children":4750},{"style":433},[4751],{"type":398,"value":482},{"type":393,"tag":427,"props":4753,"children":4754},{"style":439},[4755],{"type":398,"value":4756}," {",{"type":393,"tag":427,"props":4758,"children":4759},{"style":493},[4760],{"type":398,"value":4577},{"type":393,"tag":427,"props":4762,"children":4763},{"style":439},[4764],{"type":398,"value":4765},": ",{"type":393,"tag":427,"props":4767,"children":4768},{"style":493},[4769],{"type":398,"value":4770},"'Yes'",{"type":393,"tag":427,"props":4772,"children":4773},{"style":439},[4774],{"type":398,"value":511},{"type":393,"tag":427,"props":4776,"children":4777},{"style":493},[4778],{"type":398,"value":4586},{"type":393,"tag":427,"props":4780,"children":4781},{"style":439},[4782],{"type":398,"value":4765},{"type":393,"tag":427,"props":4784,"children":4785},{"style":493},[4786],{"type":398,"value":4787},"'No'",{"type":393,"tag":427,"props":4789,"children":4790},{"style":439},[4791],{"type":398,"value":4792},"}\n",{"type":393,"tag":427,"props":4794,"children":4795},{"class":429,"line":148},[4796,4801,4805,4809,4813,4817,4822,4826,4830,4834,4839,4843,4847,4851,4856,4860,4864,4868,4873,4877,4881,4885,4890],{"type":393,"tag":427,"props":4797,"children":4798},{"style":439},[4799],{"type":398,"value":4800},"rating_map ",{"type":393,"tag":427,"props":4802,"children":4803},{"style":433},[4804],{"type":398,"value":482},{"type":393,"tag":427,"props":4806,"children":4807},{"style":439},[4808],{"type":398,"value":4756},{"type":393,"tag":427,"props":4810,"children":4811},{"style":584},[4812],{"type":398,"value":3704},{"type":393,"tag":427,"props":4814,"children":4815},{"style":439},[4816],{"type":398,"value":4765},{"type":393,"tag":427,"props":4818,"children":4819},{"style":493},[4820],{"type":398,"value":4821},"'Poor'",{"type":393,"tag":427,"props":4823,"children":4824},{"style":439},[4825],{"type":398,"value":511},{"type":393,"tag":427,"props":4827,"children":4828},{"style":584},[4829],{"type":398,"value":2036},{"type":393,"tag":427,"props":4831,"children":4832},{"style":439},[4833],{"type":398,"value":4765},{"type":393,"tag":427,"props":4835,"children":4836},{"style":493},[4837],{"type":398,"value":4838},"'Fair'",{"type":393,"tag":427,"props":4840,"children":4841},{"style":439},[4842],{"type":398,"value":511},{"type":393,"tag":427,"props":4844,"children":4845},{"style":584},[4846],{"type":398,"value":3113},{"type":393,"tag":427,"props":4848,"children":4849},{"style":439},[4850],{"type":398,"value":4765},{"type":393,"tag":427,"props":4852,"children":4853},{"style":493},[4854],{"type":398,"value":4855},"'Good'",{"type":393,"tag":427,"props":4857,"children":4858},{"style":439},[4859],{"type":398,"value":511},{"type":393,"tag":427,"props":4861,"children":4862},{"style":584},[4863],{"type":398,"value":4655},{"type":393,"tag":427,"props":4865,"children":4866},{"style":439},[4867],{"type":398,"value":4765},{"type":393,"tag":427,"props":4869,"children":4870},{"style":493},[4871],{"type":398,"value":4872},"'Very Good'",{"type":393,"tag":427,"props":4874,"children":4875},{"style":439},[4876],{"type":398,"value":511},{"type":393,"tag":427,"props":4878,"children":4879},{"style":584},[4880],{"type":398,"value":2351},{"type":393,"tag":427,"props":4882,"children":4883},{"style":439},[4884],{"type":398,"value":4765},{"type":393,"tag":427,"props":4886,"children":4887},{"style":493},[4888],{"type":398,"value":4889},"'Excellent'",{"type":393,"tag":427,"props":4891,"children":4892},{"style":439},[4893],{"type":398,"value":4792},{"type":393,"tag":427,"props":4895,"children":4896},{"class":429,"line":159},[4897],{"type":393,"tag":427,"props":4898,"children":4899},{"emptyLinePlaceholder":12},[4900],{"type":398,"value":460},{"type":393,"tag":427,"props":4902,"children":4903},{"class":429,"line":168},[4904,4909,4914,4918,4922,4927,4932],{"type":393,"tag":427,"props":4905,"children":4906},{"style":439},[4907],{"type":398,"value":4908},"survey[",{"type":393,"tag":427,"props":4910,"children":4911},{"style":493},[4912],{"type":398,"value":4913},"'response_text'",{"type":393,"tag":427,"props":4915,"children":4916},{"style":439},[4917],{"type":398,"value":705},{"type":393,"tag":427,"props":4919,"children":4920},{"style":433},[4921],{"type":398,"value":482},{"type":393,"tag":427,"props":4923,"children":4924},{"style":439},[4925],{"type":398,"value":4926}," survey[",{"type":393,"tag":427,"props":4928,"children":4929},{"style":493},[4930],{"type":398,"value":4931},"'response'",{"type":393,"tag":427,"props":4933,"children":4934},{"style":439},[4935],{"type":398,"value":4936},"].map(response_map)\n",{"type":393,"tag":427,"props":4938,"children":4939},{"class":429,"line":177},[4940,4944,4949,4953,4957,4961,4966],{"type":393,"tag":427,"props":4941,"children":4942},{"style":439},[4943],{"type":398,"value":4908},{"type":393,"tag":427,"props":4945,"children":4946},{"style":493},[4947],{"type":398,"value":4948},"'rating_text'",{"type":393,"tag":427,"props":4950,"children":4951},{"style":439},[4952],{"type":398,"value":705},{"type":393,"tag":427,"props":4954,"children":4955},{"style":433},[4956],{"type":398,"value":482},{"type":393,"tag":427,"props":4958,"children":4959},{"style":439},[4960],{"type":398,"value":4926},{"type":393,"tag":427,"props":4962,"children":4963},{"style":493},[4964],{"type":398,"value":4965},"'rating'",{"type":393,"tag":427,"props":4967,"children":4968},{"style":439},[4969],{"type":398,"value":4970},"].map(rating_map)\n",{"type":393,"tag":427,"props":4972,"children":4973},{"class":429,"line":186},[4974],{"type":393,"tag":427,"props":4975,"children":4976},{"emptyLinePlaceholder":12},[4977],{"type":398,"value":460},{"type":393,"tag":427,"props":4979,"children":4980},{"class":429,"line":197},[4981,4985,4989,4994],{"type":393,"tag":427,"props":4982,"children":4983},{"style":584},[4984],{"type":398,"value":633},{"type":393,"tag":427,"props":4986,"children":4987},{"style":439},[4988],{"type":398,"value":638},{"type":393,"tag":427,"props":4990,"children":4991},{"style":493},[4992],{"type":398,"value":4993},"\"With mapped values:\"",{"type":393,"tag":427,"props":4995,"children":4996},{"style":439},[4997],{"type":398,"value":648},{"type":393,"tag":427,"props":4999,"children":5000},{"class":429,"line":206},[5001,5005],{"type":393,"tag":427,"props":5002,"children":5003},{"style":584},[5004],{"type":398,"value":633},{"type":393,"tag":427,"props":5006,"children":5007},{"style":439},[5008],{"type":398,"value":4713},{"type":393,"tag":907,"props":5010,"children":5012},{"id":5011},"key-takeaways",[5013],{"type":398,"value":5014},"🎯 Key Takeaways",{"type":393,"tag":919,"props":5016,"children":5019},{"emoji":5017,"title":5018,"type":1469},"📚","Function Application Summary",[5020,5027,5079,5086,5121,5129,5148,5156,5179],{"type":393,"tag":401,"props":5021,"children":5022},{},[5023],{"type":393,"tag":929,"props":5024,"children":5025},{},[5026],{"type":398,"value":933},{"type":393,"tag":935,"props":5028,"children":5029},{},[5030,5052,5074],{"type":393,"tag":939,"props":5031,"children":5032},{},[5033,5035,5040,5041,5046,5047],{"type":398,"value":5034},"String: ",{"type":393,"tag":423,"props":5036,"children":5038},{"className":5037},[],[5039],{"type":398,"value":949},{"type":398,"value":511},{"type":393,"tag":423,"props":5042,"children":5044},{"className":5043},[],[5045],{"type":398,"value":956},{"type":398,"value":511},{"type":393,"tag":423,"props":5048,"children":5050},{"className":5049},[],[5051],{"type":398,"value":1533},{"type":393,"tag":939,"props":5053,"children":5054},{},[5055,5057,5062,5063,5068,5069],{"type":398,"value":5056},"Math: ",{"type":393,"tag":423,"props":5058,"children":5060},{"className":5059},[],[5061],{"type":398,"value":967},{"type":398,"value":511},{"type":393,"tag":423,"props":5064,"children":5066},{"className":5065},[],[5067],{"type":398,"value":974},{"type":398,"value":511},{"type":393,"tag":423,"props":5070,"children":5072},{"className":5071},[],[5073],{"type":398,"value":981},{"type":393,"tag":939,"props":5075,"children":5076},{},[5077],{"type":398,"value":5078},"Use these whenever possible for best performance",{"type":393,"tag":401,"props":5080,"children":5081},{},[5082],{"type":393,"tag":929,"props":5083,"children":5084},{},[5085],{"type":398,"value":1007},{"type":393,"tag":935,"props":5087,"children":5088},{},[5089,5100,5111],{"type":393,"tag":939,"props":5090,"children":5091},{},[5092,5094],{"type":398,"value":5093},"Lambda: ",{"type":393,"tag":423,"props":5095,"children":5097},{"className":5096},[],[5098],{"type":398,"value":5099},"df['col'].apply(lambda x: logic)",{"type":393,"tag":939,"props":5101,"children":5102},{},[5103,5105],{"type":398,"value":5104},"Regular: ",{"type":393,"tag":423,"props":5106,"children":5108},{"className":5107},[],[5109],{"type":398,"value":5110},"df['col'].apply(function_name)",{"type":393,"tag":939,"props":5112,"children":5113},{},[5114,5116],{"type":398,"value":5115},"Multiple columns: ",{"type":393,"tag":423,"props":5117,"children":5119},{"className":5118},[],[5120],{"type":398,"value":2125},{"type":393,"tag":401,"props":5122,"children":5123},{},[5124],{"type":393,"tag":929,"props":5125,"children":5126},{},[5127],{"type":398,"value":5128},"Alternatives:",{"type":393,"tag":935,"props":5130,"children":5131},{},[5132,5143],{"type":393,"tag":939,"props":5133,"children":5134},{},[5135,5141],{"type":393,"tag":423,"props":5136,"children":5138},{"className":5137},[],[5139],{"type":398,"value":5140},".map(dictionary)",{"type":398,"value":5142}," - Fast for simple replacements",{"type":393,"tag":939,"props":5144,"children":5145},{},[5146],{"type":398,"value":5147},"Vectorized operations - Often faster than apply",{"type":393,"tag":401,"props":5149,"children":5150},{},[5151],{"type":393,"tag":929,"props":5152,"children":5153},{},[5154],{"type":398,"value":5155},"Best Practices:",{"type":393,"tag":935,"props":5157,"children":5158},{},[5159,5164,5169,5174],{"type":393,"tag":939,"props":5160,"children":5161},{},[5162],{"type":398,"value":5163},"Start with built-in functions",{"type":393,"tag":939,"props":5165,"children":5166},{},[5167],{"type":398,"value":5168},"Use custom functions for complex logic",{"type":393,"tag":939,"props":5170,"children":5171},{},[5172],{"type":398,"value":5173},"Test performance with large datasets",{"type":393,"tag":939,"props":5175,"children":5176},{},[5177],{"type":398,"value":5178},"Keep functions simple and focused",{"type":393,"tag":401,"props":5180,"children":5181},{},[5182,5187],{"type":393,"tag":929,"props":5183,"children":5184},{},[5185],{"type":398,"value":5186},"Remember:",{"type":398,"value":5188}," Functions transform your data efficiently and make code more readable!",{"type":393,"tag":907,"props":5190,"children":5192},{"id":5191},"whats-next",[5193],{"type":398,"value":5194},"🚀 What's Next?",{"type":393,"tag":401,"props":5196,"children":5197},{},[5198],{"type":398,"value":5199},"Excellent! You now know how to apply functions to transform your data efficiently. Next, let's learn about renaming columns and sorting data to organize your DataFrames.",{"type":393,"tag":401,"props":5201,"children":5202},{},[5203,5208,5209],{"type":393,"tag":929,"props":5204,"children":5205},{},[5206],{"type":398,"value":5207},"Continue to",{"type":398,"value":4765},{"type":393,"tag":5210,"props":5211,"children":5212},"a",{"href":258},[5213],{"type":398,"value":259},{"type":393,"tag":401,"props":5215,"children":5216},{},[5217],{"type":398,"value":5218},"Keep applying those functions! 🔧✨",{"type":393,"tag":5220,"props":5221,"children":5222},"style",{},[5223],{"type":398,"value":5224},"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":5226},[5227,5228,5231,5232,5236,5237,5238,5239,5240],{"id":909,"depth":27,"text":912},{"id":1062,"depth":27,"text":1065,"children":5229},[5230],{"id":1461,"depth":36,"text":1464},{"id":1604,"depth":27,"text":1607},{"id":2081,"depth":27,"text":2084,"children":5233},[5234,5235],{"id":2177,"depth":36,"text":2180},{"id":2717,"depth":36,"text":2720},{"id":3529,"depth":27,"text":3532},{"id":4337,"depth":27,"text":4340},{"id":4485,"depth":27,"text":4488},{"id":5011,"depth":27,"text":5014},{"id":5191,"depth":27,"text":5194},1782373724249]