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