[{"data":1,"prerenderedAt":3387},["ShallowReactive",2],{"tutorials-pandas":3,"category-items-pandas":387,"content-/pandas/working-with-dates":388},[4,21,31,40,49,58,67,78,87,96,105,116,125,134,143,154,163,172,181,192,201,210,219,228,239,248,257,266,276,285,294,303,313,322,331,341,350,359,369,378],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":6,"title":8,"description":9,"slug":10,"order":11,"isParent":12,"icon":13,"_type":14,"_id":15,"_source":16,"_file":17,"_stem":18,"_extension":19,"children":20,"expanded":12},"/pandas","",false,"Getting Started","Learn the basics of Pandas, Python's powerful data analysis library for working with spreadsheet-like data","getting-started",1,true,"pi pi-play","markdown","content:pandas:1.index.md","content","pandas/1.index.md","pandas/1.index","md",[21,31,40,49,58],{"_path":22,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":14,"_id":28,"_source":16,"_file":29,"_stem":30,"_extension":19},"/pandas/what-is-pandas","pandas","What is Pandas","Understand what Pandas is, why it's essential for data analysis, and how it makes working with data simple and powerful","what-is-pandas",2,"content:pandas:2.what-is-pandas.md","pandas/2.what-is-pandas.md","pandas/2.what-is-pandas",{"_path":32,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":14,"_id":37,"_source":16,"_file":38,"_stem":39,"_extension":19},"/pandas/installing-pandas","Installing Pandas","Learn how to install Pandas on your computer and verify it's working properly","installing-pandas",3,"content:pandas:3.installing-pandas.md","pandas/3.installing-pandas.md","pandas/3.installing-pandas",{"_path":41,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":14,"_id":46,"_source":16,"_file":47,"_stem":48,"_extension":19},"/pandas/your-first-dataframe","Your First DataFrame","Create your first Pandas DataFrame and learn the basics of working with tabular data","your-first-dataframe",4,"content:pandas:4.your-first-dataframe.md","pandas/4.your-first-dataframe.md","pandas/4.your-first-dataframe",{"_path":50,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":14,"_id":55,"_source":16,"_file":56,"_stem":57,"_extension":19},"/pandas/series-vs-dataframe","Series vs DataFrame","Understand the difference between Pandas Series and DataFrames, and learn when to use each one","series-vs-dataframe",5,"content:pandas:5.series-vs-dataframe.md","pandas/5.series-vs-dataframe.md","pandas/5.series-vs-dataframe",{"_path":59,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":14,"_id":64,"_source":16,"_file":65,"_stem":66,"_extension":19},"/pandas/basic-dataframe-info","Basic DataFrame Info","Learn how to explore and get basic information about your DataFrames to understand your data","basic-dataframe-info",6,"content:pandas:6.basic-dataframe-info.md","pandas/6.basic-dataframe-info.md","pandas/6.basic-dataframe-info",{"_path":68,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":69,"description":70,"slug":71,"order":72,"isParent":12,"icon":73,"_type":14,"_id":74,"_source":16,"_file":75,"_stem":76,"_extension":19,"children":77,"expanded":12},"/pandas/loading-data","Loading Data","Learn how to load data from various sources into Pandas DataFrames","loading-data",7,"pi pi-download","content:pandas:7.loading-data.md","pandas/7.loading-data.md","pandas/7.loading-data",[78,87,96],{"_path":79,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":80,"description":81,"slug":82,"parentId":68,"order":83,"_type":14,"_id":84,"_source":16,"_file":85,"_stem":86,"_extension":19},"/pandas/reading-files","Reading Files (CSV, Excel, JSON)","Learn how to load data from CSV, Excel, and JSON files into Pandas DataFrames","reading-files",8,"content:pandas:8.reading-files.md","pandas/8.reading-files.md","pandas/8.reading-files",{"_path":88,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":89,"description":90,"slug":91,"parentId":68,"order":92,"_type":14,"_id":93,"_source":16,"_file":94,"_stem":95,"_extension":19},"/pandas/loading-from-databases","Loading from Databases","Learn how to connect to databases and load data directly into Pandas DataFrames","loading-from-databases",9,"content:pandas:9.loading-from-databases.md","pandas/9.loading-from-databases.md","pandas/9.loading-from-databases",{"_path":97,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":98,"description":99,"slug":100,"parentId":68,"order":101,"_type":14,"_id":102,"_source":16,"_file":103,"_stem":104,"_extension":19},"/pandas/handling-file-errors","Handling File Errors","Learn how to handle common errors when loading data files and how to troubleshoot loading problems","handling-file-errors",10,"content:pandas:10.handling-file-errors.md","pandas/10.handling-file-errors.md","pandas/10.handling-file-errors",{"_path":106,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":107,"description":108,"slug":109,"order":110,"isParent":12,"icon":111,"_type":14,"_id":112,"_source":16,"_file":113,"_stem":114,"_extension":19,"children":115,"expanded":12},"/pandas/data-exploration","Data Exploration","Learn how to explore and understand your data using Pandas methods and techniques","data-exploration",11,"pi pi-search","content:pandas:11.data-exploration.md","pandas/11.data-exploration.md","pandas/11.data-exploration",[116,125,134],{"_path":117,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":118,"description":119,"slug":120,"parentId":106,"order":121,"_type":14,"_id":122,"_source":16,"_file":123,"_stem":124,"_extension":19},"/pandas/viewing-your-data","Viewing Your Data","Learn different ways to look at and sample your DataFrame data for exploration and understanding","viewing-your-data",12,"content:pandas:12.viewing-your-data.md","pandas/12.viewing-your-data.md","pandas/12.viewing-your-data",{"_path":126,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":127,"description":128,"slug":129,"parentId":106,"order":130,"_type":14,"_id":131,"_source":16,"_file":132,"_stem":133,"_extension":19},"/pandas/data-shape-and-statistics","Data Shape and Statistics","Learn how to understand your DataFrame's size, structure, and get basic statistical summaries","data-shape-and-statistics",13,"content:pandas:13.data-shape-and-statistics.md","pandas/13.data-shape-and-statistics.md","pandas/13.data-shape-and-statistics",{"_path":135,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":136,"description":137,"slug":138,"parentId":106,"order":139,"_type":14,"_id":140,"_source":16,"_file":141,"_stem":142,"_extension":19},"/pandas/column-information-and-data-types","Column Information and Data Types","Learn how to explore individual columns and understand different data types in your DataFrames","column-information-and-data-types",14,"content:pandas:14.column-information-and-data-types.md","pandas/14.column-information-and-data-types.md","pandas/14.column-information-and-data-types",{"_path":144,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":145,"description":146,"slug":147,"order":148,"isParent":12,"icon":149,"_type":14,"_id":150,"_source":16,"_file":151,"_stem":152,"_extension":19,"children":153,"expanded":12},"/pandas/selecting-data","Selecting Data","Learn how to select specific columns, rows, and subsets of data from your DataFrames","selecting-data",15,"pi pi-filter","content:pandas:15.selecting-data.md","pandas/15.selecting-data.md","pandas/15.selecting-data",[154,163,172],{"_path":155,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":156,"description":157,"slug":158,"parentId":144,"order":159,"_type":14,"_id":160,"_source":16,"_file":161,"_stem":162,"_extension":19},"/pandas/selecting-columns-and-rows","Selecting Columns and Rows","Learn how to select specific columns and rows from your DataFrames using basic selection techniques","selecting-columns-and-rows",16,"content:pandas:16.selecting-columns-and-rows.md","pandas/16.selecting-columns-and-rows.md","pandas/16.selecting-columns-and-rows",{"_path":164,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":165,"description":166,"slug":167,"parentId":144,"order":168,"_type":14,"_id":169,"_source":16,"_file":170,"_stem":171,"_extension":19},"/pandas/using-loc-and-iloc","Using loc and iloc","Master precise data selection with label-based (loc) and position-based (iloc) indexing in pandas","using-loc-and-iloc",17,"content:pandas:17.using-loc-and-iloc.md","pandas/17.using-loc-and-iloc.md","pandas/17.using-loc-and-iloc",{"_path":173,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":174,"description":175,"slug":176,"parentId":144,"order":177,"_type":14,"_id":178,"_source":16,"_file":179,"_stem":180,"_extension":19},"/pandas/boolean-and-conditional-selection","Boolean and Conditional Selection","Learn to filter DataFrames using conditions, boolean logic, and multiple criteria for precise data selection","boolean-and-conditional-selection",18,"content:pandas:18.boolean-and-conditional-selection.md","pandas/18.boolean-and-conditional-selection.md","pandas/18.boolean-and-conditional-selection",{"_path":182,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":183,"description":184,"slug":185,"order":186,"isParent":12,"icon":187,"_type":14,"_id":188,"_source":16,"_file":189,"_stem":190,"_extension":19,"children":191,"expanded":12},"/pandas/data-cleaning","Data Cleaning","Learn essential data cleaning techniques to prepare messy data for analysis","data-cleaning",19,"pi pi-wrench","content:pandas:19.data-cleaning.md","pandas/19.data-cleaning.md","pandas/19.data-cleaning",[192,201,210,219],{"_path":193,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":194,"description":195,"slug":196,"parentId":182,"order":197,"_type":14,"_id":198,"_source":16,"_file":199,"_stem":200,"_extension":19},"/pandas/handling-missing-data","Handling Missing Data","Learn to identify, fill, and remove missing values in your DataFrames effectively","handling-missing-data",20,"content:pandas:20.handling-missing-data.md","pandas/20.handling-missing-data.md","pandas/20.handling-missing-data",{"_path":202,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":203,"description":204,"slug":205,"parentId":182,"order":206,"_type":14,"_id":207,"_source":16,"_file":208,"_stem":209,"_extension":19},"/pandas/removing-duplicates","Removing Duplicates","Learn to find and eliminate duplicate rows from your DataFrames to ensure data quality","removing-duplicates",21,"content:pandas:21.removing-duplicates.md","pandas/21.removing-duplicates.md","pandas/21.removing-duplicates",{"_path":211,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":212,"description":213,"slug":214,"parentId":182,"order":215,"_type":14,"_id":216,"_source":16,"_file":217,"_stem":218,"_extension":19},"/pandas/data-type-conversion","Data Type Conversion","Learn to convert data to the right types for proper analysis and calculations","data-type-conversion",22,"content:pandas:22.data-type-conversion.md","pandas/22.data-type-conversion.md","pandas/22.data-type-conversion",{"_path":220,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":221,"description":222,"slug":223,"parentId":182,"order":224,"_type":14,"_id":225,"_source":16,"_file":226,"_stem":227,"_extension":19},"/pandas/string-cleaning-operations","String Cleaning Operations","Learn to clean and standardize text data for consistent analysis using pandas string methods","string-cleaning-operations",23,"content:pandas:23.string-cleaning-operations.md","pandas/23.string-cleaning-operations.md","pandas/23.string-cleaning-operations",{"_path":229,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":230,"description":231,"slug":232,"order":233,"isParent":12,"icon":234,"_type":14,"_id":235,"_source":16,"_file":236,"_stem":237,"_extension":19,"children":238,"expanded":12},"/pandas/data-transformation","Data Transformation","Learn how to modify, add, and transform data in your DataFrames for analysis","data-transformation",24,"pi pi-folder","content:pandas:24.data-transformation.md","pandas/24.data-transformation.md","pandas/24.data-transformation",[239,248,257],{"_path":240,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":241,"description":242,"slug":243,"parentId":229,"order":244,"_type":14,"_id":245,"_source":16,"_file":246,"_stem":247,"_extension":19},"/pandas/adding-and-modifying-columns","Adding and Modifying Columns","Learn how to create new columns and update existing ones with calculations and conditional logic","adding-and-modifying-columns",25,"content:pandas:25.adding-and-modifying-columns.md","pandas/25.adding-and-modifying-columns.md","pandas/25.adding-and-modifying-columns",{"_path":249,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":250,"description":251,"slug":252,"parentId":229,"order":253,"_type":14,"_id":254,"_source":16,"_file":255,"_stem":256,"_extension":19},"/pandas/applying-functions","Applying Functions","Use built-in and custom functions to transform your data efficiently","applying-functions",26,"content:pandas:26.applying-functions.md","pandas/26.applying-functions.md","pandas/26.applying-functions",{"_path":258,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":259,"description":260,"slug":261,"parentId":229,"order":262,"_type":14,"_id":263,"_source":16,"_file":264,"_stem":265,"_extension":19},"/pandas/renaming-and-sorting-data","Renaming and Sorting Data","Organize your DataFrame with better column names and logical data ordering","renaming-and-sorting-data",27,"content:pandas:27.renaming-and-sorting-data.md","pandas/27.renaming-and-sorting-data.md","pandas/27.renaming-and-sorting-data",{"_path":267,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":268,"description":269,"slug":270,"order":271,"isParent":12,"icon":234,"_type":14,"_id":272,"_source":16,"_file":273,"_stem":274,"_extension":19,"children":275,"expanded":12},"/pandas/grouping-and-aggregation","Grouping and Aggregation","Learn to group data and calculate summary statistics for powerful data analysis","grouping-and-aggregation",28,"content:pandas:28.grouping-and-aggregation.md","pandas/28.grouping-and-aggregation.md","pandas/28.grouping-and-aggregation",[276,285,294],{"_path":277,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":278,"description":279,"slug":280,"parentId":267,"order":281,"_type":14,"_id":282,"_source":16,"_file":283,"_stem":284,"_extension":19},"/pandas/groupby-operations","GroupBy Operations","Learn the fundamentals of splitting data into groups and basic aggregations","groupby-operations",29,"content:pandas:29.groupby-operations.md","pandas/29.groupby-operations.md","pandas/29.groupby-operations",{"_path":286,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":287,"description":288,"slug":289,"parentId":267,"order":290,"_type":14,"_id":291,"_source":16,"_file":292,"_stem":293,"_extension":19},"/pandas/aggregation-functions","Aggregation Functions","Explore different ways to summarize your grouped data with built-in and custom functions","aggregation-functions",30,"content:pandas:30.aggregation-functions.md","pandas/30.aggregation-functions.md","pandas/30.aggregation-functions",{"_path":295,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":296,"description":297,"slug":298,"parentId":267,"order":299,"_type":14,"_id":300,"_source":16,"_file":301,"_stem":302,"_extension":19},"/pandas/pivot-tables-and-cross-tabulation","Pivot Tables and Cross Tabulation","Create powerful summary tables and cross-tabulations for analysis","pivot-tables-and-cross-tabulation",31,"content:pandas:31.pivot-tables-and-cross-tabulation.md","pandas/31.pivot-tables-and-cross-tabulation.md","pandas/31.pivot-tables-and-cross-tabulation",{"_path":304,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":305,"description":306,"slug":307,"order":308,"isParent":12,"icon":234,"_type":14,"_id":309,"_source":16,"_file":310,"_stem":311,"_extension":19,"children":312,"expanded":12},"/pandas/combining-data","Combining Data","Learn to combine data from multiple DataFrames for comprehensive analysis","combining-data",32,"content:pandas:32.combining-data.md","pandas/32.combining-data.md","pandas/32.combining-data",[313,322],{"_path":314,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":315,"description":316,"slug":317,"parentId":304,"order":318,"_type":14,"_id":319,"_source":16,"_file":320,"_stem":321,"_extension":19},"/pandas/concatenating-dataframes","Concatenating DataFrames","Learn to stack DataFrames vertically and horizontally for simple data combination","concatenating-dataframes",33,"content:pandas:33.concatenating-dataframes.md","pandas/33.concatenating-dataframes.md","pandas/33.concatenating-dataframes",{"_path":323,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":324,"description":325,"slug":326,"parentId":304,"order":327,"_type":14,"_id":328,"_source":16,"_file":329,"_stem":330,"_extension":19},"/pandas/merging-and-join-operations","Merging and Join Operations","Master different types of joins to combine related data from multiple sources","merging-and-join-operations",34,"content:pandas:34.merging-and-join-operations.md","pandas/34.merging-and-join-operations.md","pandas/34.merging-and-join-operations",{"_path":332,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":333,"description":334,"slug":335,"order":336,"isParent":12,"icon":234,"_type":14,"_id":337,"_source":16,"_file":338,"_stem":339,"_extension":19,"children":340},"/pandas/working-with-dates","Working with Dates","Master date and time operations for time-based analysis and reporting","working-with-dates",35,"content:pandas:35.working-with-dates.md","pandas/35.working-with-dates.md","pandas/35.working-with-dates",[341,350],{"_path":342,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":343,"description":344,"slug":345,"parentId":332,"order":346,"_type":14,"_id":347,"_source":16,"_file":348,"_stem":349,"_extension":19},"/pandas/datetime-operations","DateTime Operations","Learn to convert, manipulate, and extract information from dates and times","datetime-operations",36,"content:pandas:36.datetime-operations.md","pandas/36.datetime-operations.md","pandas/36.datetime-operations",{"_path":351,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":352,"description":353,"slug":354,"parentId":332,"order":355,"_type":14,"_id":356,"_source":16,"_file":357,"_stem":358,"_extension":19},"/pandas/time-series-and-resampling","Time Series and Resampling","Discover how to analyze data over time periods and aggregate by different time intervals","time-series-and-resampling",37,"content:pandas:37.time-series-and-resampling.md","pandas/37.time-series-and-resampling.md","pandas/37.time-series-and-resampling",{"_path":360,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":361,"description":362,"slug":363,"order":364,"isParent":12,"icon":234,"_type":14,"_id":365,"_source":16,"_file":366,"_stem":367,"_extension":19,"children":368},"/pandas/saving-your-work","Saving Your Work","Learn to export your analyzed data to different formats for sharing and reporting","saving-your-work",38,"content:pandas:38.saving-your-work.md","pandas/38.saving-your-work.md","pandas/38.saving-your-work",[369,378],{"_path":370,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":371,"description":372,"slug":373,"parentId":360,"order":374,"_type":14,"_id":375,"_source":16,"_file":376,"_stem":377,"_extension":19},"/pandas/exporting-data","Exporting Data (CSV, Excel, JSON)","Learn to save your DataFrames to common file formats for sharing and reporting","exporting-data",39,"content:pandas:39.exporting-data.md","pandas/39.exporting-data.md","pandas/39.exporting-data",{"_path":379,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":380,"description":381,"slug":382,"parentId":360,"order":383,"_type":14,"_id":384,"_source":16,"_file":385,"_stem":386,"_extension":19},"/pandas/database-export","Database Export","Discover how to save data back to databases for integration with other systems","database-export",40,"content:pandas:40.database-export.md","pandas/40.database-export.md","pandas/40.database-export",[331],{"_path":332,"_dir":23,"_draft":7,"_partial":7,"_locale":6,"title":333,"description":334,"slug":335,"order":336,"isParent":12,"icon":234,"body":389,"_type":14,"_id":337,"_source":16,"_file":338,"_stem":339,"_extension":19},{"type":390,"children":391,"toc":3375},"root",[392,400,406,411,925,932,937,1071,1077,1082,1108,1114,1119,1230,1236,1241,1805,1811,1816,2228,2234,2239,2373,2379,2384,3062,3068,3203,3209,3214,3339,3345,3350,3364,3369],{"type":393,"tag":394,"props":395,"children":396},"element","h1",{"id":335},[397],{"type":398,"value":399},"text","📅 Working with Dates",{"type":393,"tag":401,"props":402,"children":403},"p",{},[404],{"type":398,"value":405},"Working with dates and times is essential for data analysis! Whether you're analyzing sales trends over time, tracking customer behavior, or creating time-based reports, pandas provides powerful tools for handling temporal data.",{"type":393,"tag":401,"props":407,"children":408},{},[409],{"type":398,"value":410},"Think of dates like timestamps that help you organize events in chronological order and discover patterns over time.",{"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\nfrom datetime import datetime\n\n# Sales data with dates as strings\nsales = pd.DataFrame({\n    'date': ['2023-01-15', '2023-02-20', '2023-03-10'],\n    'product': ['Laptop', 'Mouse', 'Keyboard'],\n    'sales': [10, 25, 15]\n})\n\nprint(\"Original data with date strings:\")\nprint(sales)\nprint(\"Date column type:\", sales['date'].dtype)\nprint()\n\n# Convert to datetime\nsales['date'] = pd.to_datetime(sales['date'])\nprint(\"After converting to datetime:\")\nprint(sales)\nprint(\"Date column type:\", sales['date'].dtype)\nprint()\n\n# Extract month from dates\nsales['month'] = sales['date'].dt.month\nprint(\"With extracted month:\")\nprint(sales)\n","python",[422],{"type":393,"tag":423,"props":424,"children":425},"code",{"__ignoreMap":6},[426,453,475,483,492,510,553,592,633,641,648,671,683,714,726,733,741,776,796,807,834,845,852,860,894,914],{"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,461,466,470],{"type":393,"tag":427,"props":457,"children":458},{"style":433},[459],{"type":398,"value":460},"from",{"type":393,"tag":427,"props":462,"children":463},{"style":439},[464],{"type":398,"value":465}," datetime ",{"type":393,"tag":427,"props":467,"children":468},{"style":433},[469],{"type":398,"value":436},{"type":393,"tag":427,"props":471,"children":472},{"style":439},[473],{"type":398,"value":474}," datetime\n",{"type":393,"tag":427,"props":476,"children":477},{"class":429,"line":36},[478],{"type":393,"tag":427,"props":479,"children":480},{"emptyLinePlaceholder":12},[481],{"type":398,"value":482},"\n",{"type":393,"tag":427,"props":484,"children":485},{"class":429,"line":45},[486],{"type":393,"tag":427,"props":487,"children":489},{"style":488},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[490],{"type":398,"value":491},"# Sales data with dates as strings\n",{"type":393,"tag":427,"props":493,"children":494},{"class":429,"line":54},[495,500,505],{"type":393,"tag":427,"props":496,"children":497},{"style":439},[498],{"type":398,"value":499},"sales ",{"type":393,"tag":427,"props":501,"children":502},{"style":433},[503],{"type":398,"value":504},"=",{"type":393,"tag":427,"props":506,"children":507},{"style":439},[508],{"type":398,"value":509}," pd.DataFrame({\n",{"type":393,"tag":427,"props":511,"children":512},{"class":429,"line":63},[513,519,524,529,534,539,543,548],{"type":393,"tag":427,"props":514,"children":516},{"style":515},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[517],{"type":398,"value":518},"    'date'",{"type":393,"tag":427,"props":520,"children":521},{"style":439},[522],{"type":398,"value":523},": [",{"type":393,"tag":427,"props":525,"children":526},{"style":515},[527],{"type":398,"value":528},"'2023-01-15'",{"type":393,"tag":427,"props":530,"children":531},{"style":439},[532],{"type":398,"value":533},", ",{"type":393,"tag":427,"props":535,"children":536},{"style":515},[537],{"type":398,"value":538},"'2023-02-20'",{"type":393,"tag":427,"props":540,"children":541},{"style":439},[542],{"type":398,"value":533},{"type":393,"tag":427,"props":544,"children":545},{"style":515},[546],{"type":398,"value":547},"'2023-03-10'",{"type":393,"tag":427,"props":549,"children":550},{"style":439},[551],{"type":398,"value":552},"],\n",{"type":393,"tag":427,"props":554,"children":555},{"class":429,"line":72},[556,561,565,570,574,579,583,588],{"type":393,"tag":427,"props":557,"children":558},{"style":515},[559],{"type":398,"value":560},"    'product'",{"type":393,"tag":427,"props":562,"children":563},{"style":439},[564],{"type":398,"value":523},{"type":393,"tag":427,"props":566,"children":567},{"style":515},[568],{"type":398,"value":569},"'Laptop'",{"type":393,"tag":427,"props":571,"children":572},{"style":439},[573],{"type":398,"value":533},{"type":393,"tag":427,"props":575,"children":576},{"style":515},[577],{"type":398,"value":578},"'Mouse'",{"type":393,"tag":427,"props":580,"children":581},{"style":439},[582],{"type":398,"value":533},{"type":393,"tag":427,"props":584,"children":585},{"style":515},[586],{"type":398,"value":587},"'Keyboard'",{"type":393,"tag":427,"props":589,"children":590},{"style":439},[591],{"type":398,"value":552},{"type":393,"tag":427,"props":593,"children":594},{"class":429,"line":83},[595,600,604,610,614,619,623,628],{"type":393,"tag":427,"props":596,"children":597},{"style":515},[598],{"type":398,"value":599},"    'sales'",{"type":393,"tag":427,"props":601,"children":602},{"style":439},[603],{"type":398,"value":523},{"type":393,"tag":427,"props":605,"children":607},{"style":606},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[608],{"type":398,"value":609},"10",{"type":393,"tag":427,"props":611,"children":612},{"style":439},[613],{"type":398,"value":533},{"type":393,"tag":427,"props":615,"children":616},{"style":606},[617],{"type":398,"value":618},"25",{"type":393,"tag":427,"props":620,"children":621},{"style":439},[622],{"type":398,"value":533},{"type":393,"tag":427,"props":624,"children":625},{"style":606},[626],{"type":398,"value":627},"15",{"type":393,"tag":427,"props":629,"children":630},{"style":439},[631],{"type":398,"value":632},"]\n",{"type":393,"tag":427,"props":634,"children":635},{"class":429,"line":92},[636],{"type":393,"tag":427,"props":637,"children":638},{"style":439},[639],{"type":398,"value":640},"})\n",{"type":393,"tag":427,"props":642,"children":643},{"class":429,"line":101},[644],{"type":393,"tag":427,"props":645,"children":646},{"emptyLinePlaceholder":12},[647],{"type":398,"value":482},{"type":393,"tag":427,"props":649,"children":650},{"class":429,"line":110},[651,656,661,666],{"type":393,"tag":427,"props":652,"children":653},{"style":606},[654],{"type":398,"value":655},"print",{"type":393,"tag":427,"props":657,"children":658},{"style":439},[659],{"type":398,"value":660},"(",{"type":393,"tag":427,"props":662,"children":663},{"style":515},[664],{"type":398,"value":665},"\"Original data with date strings:\"",{"type":393,"tag":427,"props":667,"children":668},{"style":439},[669],{"type":398,"value":670},")\n",{"type":393,"tag":427,"props":672,"children":673},{"class":429,"line":121},[674,678],{"type":393,"tag":427,"props":675,"children":676},{"style":606},[677],{"type":398,"value":655},{"type":393,"tag":427,"props":679,"children":680},{"style":439},[681],{"type":398,"value":682},"(sales)\n",{"type":393,"tag":427,"props":684,"children":685},{"class":429,"line":130},[686,690,694,699,704,709],{"type":393,"tag":427,"props":687,"children":688},{"style":606},[689],{"type":398,"value":655},{"type":393,"tag":427,"props":691,"children":692},{"style":439},[693],{"type":398,"value":660},{"type":393,"tag":427,"props":695,"children":696},{"style":515},[697],{"type":398,"value":698},"\"Date column type:\"",{"type":393,"tag":427,"props":700,"children":701},{"style":439},[702],{"type":398,"value":703},", sales[",{"type":393,"tag":427,"props":705,"children":706},{"style":515},[707],{"type":398,"value":708},"'date'",{"type":393,"tag":427,"props":710,"children":711},{"style":439},[712],{"type":398,"value":713},"].dtype)\n",{"type":393,"tag":427,"props":715,"children":716},{"class":429,"line":139},[717,721],{"type":393,"tag":427,"props":718,"children":719},{"style":606},[720],{"type":398,"value":655},{"type":393,"tag":427,"props":722,"children":723},{"style":439},[724],{"type":398,"value":725},"()\n",{"type":393,"tag":427,"props":727,"children":728},{"class":429,"line":148},[729],{"type":393,"tag":427,"props":730,"children":731},{"emptyLinePlaceholder":12},[732],{"type":398,"value":482},{"type":393,"tag":427,"props":734,"children":735},{"class":429,"line":159},[736],{"type":393,"tag":427,"props":737,"children":738},{"style":488},[739],{"type":398,"value":740},"# Convert to datetime\n",{"type":393,"tag":427,"props":742,"children":743},{"class":429,"line":168},[744,749,753,758,762,767,771],{"type":393,"tag":427,"props":745,"children":746},{"style":439},[747],{"type":398,"value":748},"sales[",{"type":393,"tag":427,"props":750,"children":751},{"style":515},[752],{"type":398,"value":708},{"type":393,"tag":427,"props":754,"children":755},{"style":439},[756],{"type":398,"value":757},"] ",{"type":393,"tag":427,"props":759,"children":760},{"style":433},[761],{"type":398,"value":504},{"type":393,"tag":427,"props":763,"children":764},{"style":439},[765],{"type":398,"value":766}," pd.to_datetime(sales[",{"type":393,"tag":427,"props":768,"children":769},{"style":515},[770],{"type":398,"value":708},{"type":393,"tag":427,"props":772,"children":773},{"style":439},[774],{"type":398,"value":775},"])\n",{"type":393,"tag":427,"props":777,"children":778},{"class":429,"line":177},[779,783,787,792],{"type":393,"tag":427,"props":780,"children":781},{"style":606},[782],{"type":398,"value":655},{"type":393,"tag":427,"props":784,"children":785},{"style":439},[786],{"type":398,"value":660},{"type":393,"tag":427,"props":788,"children":789},{"style":515},[790],{"type":398,"value":791},"\"After converting to datetime:\"",{"type":393,"tag":427,"props":793,"children":794},{"style":439},[795],{"type":398,"value":670},{"type":393,"tag":427,"props":797,"children":798},{"class":429,"line":186},[799,803],{"type":393,"tag":427,"props":800,"children":801},{"style":606},[802],{"type":398,"value":655},{"type":393,"tag":427,"props":804,"children":805},{"style":439},[806],{"type":398,"value":682},{"type":393,"tag":427,"props":808,"children":809},{"class":429,"line":197},[810,814,818,822,826,830],{"type":393,"tag":427,"props":811,"children":812},{"style":606},[813],{"type":398,"value":655},{"type":393,"tag":427,"props":815,"children":816},{"style":439},[817],{"type":398,"value":660},{"type":393,"tag":427,"props":819,"children":820},{"style":515},[821],{"type":398,"value":698},{"type":393,"tag":427,"props":823,"children":824},{"style":439},[825],{"type":398,"value":703},{"type":393,"tag":427,"props":827,"children":828},{"style":515},[829],{"type":398,"value":708},{"type":393,"tag":427,"props":831,"children":832},{"style":439},[833],{"type":398,"value":713},{"type":393,"tag":427,"props":835,"children":836},{"class":429,"line":206},[837,841],{"type":393,"tag":427,"props":838,"children":839},{"style":606},[840],{"type":398,"value":655},{"type":393,"tag":427,"props":842,"children":843},{"style":439},[844],{"type":398,"value":725},{"type":393,"tag":427,"props":846,"children":847},{"class":429,"line":215},[848],{"type":393,"tag":427,"props":849,"children":850},{"emptyLinePlaceholder":12},[851],{"type":398,"value":482},{"type":393,"tag":427,"props":853,"children":854},{"class":429,"line":224},[855],{"type":393,"tag":427,"props":856,"children":857},{"style":488},[858],{"type":398,"value":859},"# Extract month from dates\n",{"type":393,"tag":427,"props":861,"children":862},{"class":429,"line":233},[863,867,872,876,880,885,889],{"type":393,"tag":427,"props":864,"children":865},{"style":439},[866],{"type":398,"value":748},{"type":393,"tag":427,"props":868,"children":869},{"style":515},[870],{"type":398,"value":871},"'month'",{"type":393,"tag":427,"props":873,"children":874},{"style":439},[875],{"type":398,"value":757},{"type":393,"tag":427,"props":877,"children":878},{"style":433},[879],{"type":398,"value":504},{"type":393,"tag":427,"props":881,"children":882},{"style":439},[883],{"type":398,"value":884}," sales[",{"type":393,"tag":427,"props":886,"children":887},{"style":515},[888],{"type":398,"value":708},{"type":393,"tag":427,"props":890,"children":891},{"style":439},[892],{"type":398,"value":893},"].dt.month\n",{"type":393,"tag":427,"props":895,"children":896},{"class":429,"line":244},[897,901,905,910],{"type":393,"tag":427,"props":898,"children":899},{"style":606},[900],{"type":398,"value":655},{"type":393,"tag":427,"props":902,"children":903},{"style":439},[904],{"type":398,"value":660},{"type":393,"tag":427,"props":906,"children":907},{"style":515},[908],{"type":398,"value":909},"\"With extracted month:\"",{"type":393,"tag":427,"props":911,"children":912},{"style":439},[913],{"type":398,"value":670},{"type":393,"tag":427,"props":915,"children":916},{"class":429,"line":253},[917,921],{"type":393,"tag":427,"props":918,"children":919},{"style":606},[920],{"type":398,"value":655},{"type":393,"tag":427,"props":922,"children":923},{"style":439},[924],{"type":398,"value":682},{"type":393,"tag":926,"props":927,"children":929},"h2",{"id":928},"why-work-with-dates",[930],{"type":398,"value":931},"🎯 Why Work with Dates?",{"type":393,"tag":401,"props":933,"children":934},{},[935],{"type":398,"value":936},"Temporal data analysis reveals powerful insights:",{"type":393,"tag":938,"props":939,"children":943},"info-box",{"emoji":940,"title":941,"type":942},"📈","Benefits of Date Analysis","info",[944,953,978,986,1009,1017,1040,1048],{"type":393,"tag":401,"props":945,"children":946},{},[947],{"type":393,"tag":948,"props":949,"children":950},"strong",{},[951],{"type":398,"value":952},"Time-Based Insights:",{"type":393,"tag":954,"props":955,"children":956},"ul",{},[957,963,968,973],{"type":393,"tag":958,"props":959,"children":960},"li",{},[961],{"type":398,"value":962},"Seasonal trends and patterns",{"type":393,"tag":958,"props":964,"children":965},{},[966],{"type":398,"value":967},"Growth rates and comparisons",{"type":393,"tag":958,"props":969,"children":970},{},[971],{"type":398,"value":972},"Peak periods identification",{"type":393,"tag":958,"props":974,"children":975},{},[976],{"type":398,"value":977},"Historical performance tracking",{"type":393,"tag":401,"props":979,"children":980},{},[981],{"type":393,"tag":948,"props":982,"children":983},{},[984],{"type":398,"value":985},"Business Applications:",{"type":393,"tag":954,"props":987,"children":988},{},[989,994,999,1004],{"type":393,"tag":958,"props":990,"children":991},{},[992],{"type":398,"value":993},"Sales trends by month/quarter/year",{"type":393,"tag":958,"props":995,"children":996},{},[997],{"type":398,"value":998},"Customer behavior over time",{"type":393,"tag":958,"props":1000,"children":1001},{},[1002],{"type":398,"value":1003},"Inventory planning and forecasting",{"type":393,"tag":958,"props":1005,"children":1006},{},[1007],{"type":398,"value":1008},"Performance monitoring",{"type":393,"tag":401,"props":1010,"children":1011},{},[1012],{"type":393,"tag":948,"props":1013,"children":1014},{},[1015],{"type":398,"value":1016},"Pandas Date Advantages:",{"type":393,"tag":954,"props":1018,"children":1019},{},[1020,1025,1030,1035],{"type":393,"tag":958,"props":1021,"children":1022},{},[1023],{"type":398,"value":1024},"Automatic sorting and indexing",{"type":393,"tag":958,"props":1026,"children":1027},{},[1028],{"type":398,"value":1029},"Easy filtering by date ranges",{"type":393,"tag":958,"props":1031,"children":1032},{},[1033],{"type":398,"value":1034},"Built-in time period grouping",{"type":393,"tag":958,"props":1036,"children":1037},{},[1038],{"type":398,"value":1039},"Powerful resampling capabilities",{"type":393,"tag":401,"props":1041,"children":1042},{},[1043],{"type":393,"tag":948,"props":1044,"children":1045},{},[1046],{"type":398,"value":1047},"Common Tasks:",{"type":393,"tag":954,"props":1049,"children":1050},{},[1051,1056,1061,1066],{"type":393,"tag":958,"props":1052,"children":1053},{},[1054],{"type":398,"value":1055},"Convert text dates to datetime objects",{"type":393,"tag":958,"props":1057,"children":1058},{},[1059],{"type":398,"value":1060},"Extract components (year, month, day)",{"type":393,"tag":958,"props":1062,"children":1063},{},[1064],{"type":398,"value":1065},"Filter data by date ranges",{"type":393,"tag":958,"props":1067,"children":1068},{},[1069],{"type":398,"value":1070},"Group data by time periods",{"type":393,"tag":926,"props":1072,"children":1074},{"id":1073},"what-youll-learn-in-this-section",[1075],{"type":398,"value":1076},"📚 What You'll Learn in This Section",{"type":393,"tag":401,"props":1078,"children":1079},{},[1080],{"type":398,"value":1081},"Master essential date and time operations:",{"type":393,"tag":954,"props":1083,"children":1084},{},[1085,1097],{"type":393,"tag":958,"props":1086,"children":1087},{},[1088,1090,1095],{"type":398,"value":1089},"🕒 ",{"type":393,"tag":1091,"props":1092,"children":1093},"a",{"href":342},[1094],{"type":398,"value":343},{"type":398,"value":1096}," Learn to convert, manipulate, and extract information from dates and times.",{"type":393,"tag":958,"props":1098,"children":1099},{},[1100,1102,1106],{"type":398,"value":1101},"📊 ",{"type":393,"tag":1091,"props":1103,"children":1104},{"href":351},[1105],{"type":398,"value":352},{"type":398,"value":1107}," Discover how to analyze data over time periods and aggregate by different time intervals.",{"type":393,"tag":926,"props":1109,"children":1111},{"id":1110},"date-data-types-in-pandas",[1112],{"type":398,"value":1113},"🔍 Date Data Types in Pandas",{"type":393,"tag":401,"props":1115,"children":1116},{},[1117],{"type":398,"value":1118},"Understanding how pandas handles dates:",{"type":393,"tag":938,"props":1120,"children":1124},{"emoji":1121,"title":1122,"type":1123},"🗓️","Date Data Types","success",[1125,1133,1151,1159,1177,1185,1203,1211],{"type":393,"tag":401,"props":1126,"children":1127},{},[1128],{"type":393,"tag":948,"props":1129,"children":1130},{},[1131],{"type":398,"value":1132},"String Dates:",{"type":393,"tag":954,"props":1134,"children":1135},{},[1136,1141,1146],{"type":393,"tag":958,"props":1137,"children":1138},{},[1139],{"type":398,"value":1140},"Example: '2023-01-15', 'Jan 15, 2023'",{"type":393,"tag":958,"props":1142,"children":1143},{},[1144],{"type":398,"value":1145},"Need conversion to work with properly",{"type":393,"tag":958,"props":1147,"children":1148},{},[1149],{"type":398,"value":1150},"Limited functionality for analysis",{"type":393,"tag":401,"props":1152,"children":1153},{},[1154],{"type":393,"tag":948,"props":1155,"children":1156},{},[1157],{"type":398,"value":1158},"DateTime Objects:",{"type":393,"tag":954,"props":1160,"children":1161},{},[1162,1167,1172],{"type":393,"tag":958,"props":1163,"children":1164},{},[1165],{"type":398,"value":1166},"pandas datetime64 format",{"type":393,"tag":958,"props":1168,"children":1169},{},[1170],{"type":398,"value":1171},"Full date/time functionality",{"type":393,"tag":958,"props":1173,"children":1174},{},[1175],{"type":398,"value":1176},"Allows date arithmetic and comparisons",{"type":393,"tag":401,"props":1178,"children":1179},{},[1180],{"type":393,"tag":948,"props":1181,"children":1182},{},[1183],{"type":398,"value":1184},"DatetimeIndex:",{"type":393,"tag":954,"props":1186,"children":1187},{},[1188,1193,1198],{"type":393,"tag":958,"props":1189,"children":1190},{},[1191],{"type":398,"value":1192},"Special index type for time series",{"type":393,"tag":958,"props":1194,"children":1195},{},[1196],{"type":398,"value":1197},"Enables powerful time-based operations",{"type":393,"tag":958,"props":1199,"children":1200},{},[1201],{"type":398,"value":1202},"Perfect for time series analysis",{"type":393,"tag":401,"props":1204,"children":1205},{},[1206],{"type":393,"tag":948,"props":1207,"children":1208},{},[1209],{"type":398,"value":1210},"Conversion:",{"type":393,"tag":954,"props":1212,"children":1213},{},[1214,1225],{"type":393,"tag":958,"props":1215,"children":1216},{},[1217,1223],{"type":393,"tag":423,"props":1218,"children":1220},{"className":1219},[],[1221],{"type":398,"value":1222},"pd.to_datetime()",{"type":398,"value":1224}," - Convert strings to datetime",{"type":393,"tag":958,"props":1226,"children":1227},{},[1228],{"type":398,"value":1229},"Automatic format detection in most cases",{"type":393,"tag":926,"props":1231,"children":1233},{"id":1232},"️-common-date-operations-preview",[1234],{"type":398,"value":1235},"🛠️ Common Date Operations Preview",{"type":393,"tag":401,"props":1237,"children":1238},{},[1239],{"type":398,"value":1240},"Here's what you can do with dates in pandas:",{"type":393,"tag":412,"props":1242,"children":1243},{},[1244],{"type":393,"tag":416,"props":1245,"children":1247},{"className":418,"code":1246,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Create sample data with various date formats\ndata = pd.DataFrame({\n    'date_str': ['2023-01-15', '2023-02-20', '2023-03-10', '2023-04-05'],\n    'sales': [100, 150, 120, 180]\n})\n\n# Convert to datetime\ndata['date'] = pd.to_datetime(data['date_str'])\n\nprint(\"Sample data:\")\nprint(data)\nprint()\n\n# Extract date components\ndata['year'] = data['date'].dt.year\ndata['month'] = data['date'].dt.month\ndata['day_of_week'] = data['date'].dt.day_name()\n\nprint(\"With extracted components:\")\nprint(data[['date', 'year', 'month', 'day_of_week', 'sales']])\nprint()\n\n# Filter by date range\nrecent_data = data[data['date'] >= '2023-02-01']\nprint(\"February and later:\")\nprint(recent_data[['date', 'sales']])\n",[1248],{"type":393,"tag":423,"props":1249,"children":1250},{"__ignoreMap":6},[1251,1270,1277,1285,1301,1346,1393,1400,1407,1414,1448,1455,1475,1487,1498,1505,1513,1547,1578,1611,1618,1638,1692,1703,1710,1718,1757,1777],{"type":393,"tag":427,"props":1252,"children":1253},{"class":429,"line":11},[1254,1258,1262,1266],{"type":393,"tag":427,"props":1255,"children":1256},{"style":433},[1257],{"type":398,"value":436},{"type":393,"tag":427,"props":1259,"children":1260},{"style":439},[1261],{"type":398,"value":442},{"type":393,"tag":427,"props":1263,"children":1264},{"style":433},[1265],{"type":398,"value":447},{"type":393,"tag":427,"props":1267,"children":1268},{"style":439},[1269],{"type":398,"value":452},{"type":393,"tag":427,"props":1271,"children":1272},{"class":429,"line":27},[1273],{"type":393,"tag":427,"props":1274,"children":1275},{"emptyLinePlaceholder":12},[1276],{"type":398,"value":482},{"type":393,"tag":427,"props":1278,"children":1279},{"class":429,"line":36},[1280],{"type":393,"tag":427,"props":1281,"children":1282},{"style":488},[1283],{"type":398,"value":1284},"# Create sample data with various date formats\n",{"type":393,"tag":427,"props":1286,"children":1287},{"class":429,"line":45},[1288,1293,1297],{"type":393,"tag":427,"props":1289,"children":1290},{"style":439},[1291],{"type":398,"value":1292},"data ",{"type":393,"tag":427,"props":1294,"children":1295},{"style":433},[1296],{"type":398,"value":504},{"type":393,"tag":427,"props":1298,"children":1299},{"style":439},[1300],{"type":398,"value":509},{"type":393,"tag":427,"props":1302,"children":1303},{"class":429,"line":54},[1304,1309,1313,1317,1321,1325,1329,1333,1337,1342],{"type":393,"tag":427,"props":1305,"children":1306},{"style":515},[1307],{"type":398,"value":1308},"    'date_str'",{"type":393,"tag":427,"props":1310,"children":1311},{"style":439},[1312],{"type":398,"value":523},{"type":393,"tag":427,"props":1314,"children":1315},{"style":515},[1316],{"type":398,"value":528},{"type":393,"tag":427,"props":1318,"children":1319},{"style":439},[1320],{"type":398,"value":533},{"type":393,"tag":427,"props":1322,"children":1323},{"style":515},[1324],{"type":398,"value":538},{"type":393,"tag":427,"props":1326,"children":1327},{"style":439},[1328],{"type":398,"value":533},{"type":393,"tag":427,"props":1330,"children":1331},{"style":515},[1332],{"type":398,"value":547},{"type":393,"tag":427,"props":1334,"children":1335},{"style":439},[1336],{"type":398,"value":533},{"type":393,"tag":427,"props":1338,"children":1339},{"style":515},[1340],{"type":398,"value":1341},"'2023-04-05'",{"type":393,"tag":427,"props":1343,"children":1344},{"style":439},[1345],{"type":398,"value":552},{"type":393,"tag":427,"props":1347,"children":1348},{"class":429,"line":63},[1349,1353,1357,1362,1366,1371,1375,1380,1384,1389],{"type":393,"tag":427,"props":1350,"children":1351},{"style":515},[1352],{"type":398,"value":599},{"type":393,"tag":427,"props":1354,"children":1355},{"style":439},[1356],{"type":398,"value":523},{"type":393,"tag":427,"props":1358,"children":1359},{"style":606},[1360],{"type":398,"value":1361},"100",{"type":393,"tag":427,"props":1363,"children":1364},{"style":439},[1365],{"type":398,"value":533},{"type":393,"tag":427,"props":1367,"children":1368},{"style":606},[1369],{"type":398,"value":1370},"150",{"type":393,"tag":427,"props":1372,"children":1373},{"style":439},[1374],{"type":398,"value":533},{"type":393,"tag":427,"props":1376,"children":1377},{"style":606},[1378],{"type":398,"value":1379},"120",{"type":393,"tag":427,"props":1381,"children":1382},{"style":439},[1383],{"type":398,"value":533},{"type":393,"tag":427,"props":1385,"children":1386},{"style":606},[1387],{"type":398,"value":1388},"180",{"type":393,"tag":427,"props":1390,"children":1391},{"style":439},[1392],{"type":398,"value":632},{"type":393,"tag":427,"props":1394,"children":1395},{"class":429,"line":72},[1396],{"type":393,"tag":427,"props":1397,"children":1398},{"style":439},[1399],{"type":398,"value":640},{"type":393,"tag":427,"props":1401,"children":1402},{"class":429,"line":83},[1403],{"type":393,"tag":427,"props":1404,"children":1405},{"emptyLinePlaceholder":12},[1406],{"type":398,"value":482},{"type":393,"tag":427,"props":1408,"children":1409},{"class":429,"line":92},[1410],{"type":393,"tag":427,"props":1411,"children":1412},{"style":488},[1413],{"type":398,"value":740},{"type":393,"tag":427,"props":1415,"children":1416},{"class":429,"line":101},[1417,1422,1426,1430,1434,1439,1444],{"type":393,"tag":427,"props":1418,"children":1419},{"style":439},[1420],{"type":398,"value":1421},"data[",{"type":393,"tag":427,"props":1423,"children":1424},{"style":515},[1425],{"type":398,"value":708},{"type":393,"tag":427,"props":1427,"children":1428},{"style":439},[1429],{"type":398,"value":757},{"type":393,"tag":427,"props":1431,"children":1432},{"style":433},[1433],{"type":398,"value":504},{"type":393,"tag":427,"props":1435,"children":1436},{"style":439},[1437],{"type":398,"value":1438}," pd.to_datetime(data[",{"type":393,"tag":427,"props":1440,"children":1441},{"style":515},[1442],{"type":398,"value":1443},"'date_str'",{"type":393,"tag":427,"props":1445,"children":1446},{"style":439},[1447],{"type":398,"value":775},{"type":393,"tag":427,"props":1449,"children":1450},{"class":429,"line":110},[1451],{"type":393,"tag":427,"props":1452,"children":1453},{"emptyLinePlaceholder":12},[1454],{"type":398,"value":482},{"type":393,"tag":427,"props":1456,"children":1457},{"class":429,"line":121},[1458,1462,1466,1471],{"type":393,"tag":427,"props":1459,"children":1460},{"style":606},[1461],{"type":398,"value":655},{"type":393,"tag":427,"props":1463,"children":1464},{"style":439},[1465],{"type":398,"value":660},{"type":393,"tag":427,"props":1467,"children":1468},{"style":515},[1469],{"type":398,"value":1470},"\"Sample data:\"",{"type":393,"tag":427,"props":1472,"children":1473},{"style":439},[1474],{"type":398,"value":670},{"type":393,"tag":427,"props":1476,"children":1477},{"class":429,"line":130},[1478,1482],{"type":393,"tag":427,"props":1479,"children":1480},{"style":606},[1481],{"type":398,"value":655},{"type":393,"tag":427,"props":1483,"children":1484},{"style":439},[1485],{"type":398,"value":1486},"(data)\n",{"type":393,"tag":427,"props":1488,"children":1489},{"class":429,"line":139},[1490,1494],{"type":393,"tag":427,"props":1491,"children":1492},{"style":606},[1493],{"type":398,"value":655},{"type":393,"tag":427,"props":1495,"children":1496},{"style":439},[1497],{"type":398,"value":725},{"type":393,"tag":427,"props":1499,"children":1500},{"class":429,"line":148},[1501],{"type":393,"tag":427,"props":1502,"children":1503},{"emptyLinePlaceholder":12},[1504],{"type":398,"value":482},{"type":393,"tag":427,"props":1506,"children":1507},{"class":429,"line":159},[1508],{"type":393,"tag":427,"props":1509,"children":1510},{"style":488},[1511],{"type":398,"value":1512},"# Extract date components\n",{"type":393,"tag":427,"props":1514,"children":1515},{"class":429,"line":168},[1516,1520,1525,1529,1533,1538,1542],{"type":393,"tag":427,"props":1517,"children":1518},{"style":439},[1519],{"type":398,"value":1421},{"type":393,"tag":427,"props":1521,"children":1522},{"style":515},[1523],{"type":398,"value":1524},"'year'",{"type":393,"tag":427,"props":1526,"children":1527},{"style":439},[1528],{"type":398,"value":757},{"type":393,"tag":427,"props":1530,"children":1531},{"style":433},[1532],{"type":398,"value":504},{"type":393,"tag":427,"props":1534,"children":1535},{"style":439},[1536],{"type":398,"value":1537}," data[",{"type":393,"tag":427,"props":1539,"children":1540},{"style":515},[1541],{"type":398,"value":708},{"type":393,"tag":427,"props":1543,"children":1544},{"style":439},[1545],{"type":398,"value":1546},"].dt.year\n",{"type":393,"tag":427,"props":1548,"children":1549},{"class":429,"line":177},[1550,1554,1558,1562,1566,1570,1574],{"type":393,"tag":427,"props":1551,"children":1552},{"style":439},[1553],{"type":398,"value":1421},{"type":393,"tag":427,"props":1555,"children":1556},{"style":515},[1557],{"type":398,"value":871},{"type":393,"tag":427,"props":1559,"children":1560},{"style":439},[1561],{"type":398,"value":757},{"type":393,"tag":427,"props":1563,"children":1564},{"style":433},[1565],{"type":398,"value":504},{"type":393,"tag":427,"props":1567,"children":1568},{"style":439},[1569],{"type":398,"value":1537},{"type":393,"tag":427,"props":1571,"children":1572},{"style":515},[1573],{"type":398,"value":708},{"type":393,"tag":427,"props":1575,"children":1576},{"style":439},[1577],{"type":398,"value":893},{"type":393,"tag":427,"props":1579,"children":1580},{"class":429,"line":186},[1581,1585,1590,1594,1598,1602,1606],{"type":393,"tag":427,"props":1582,"children":1583},{"style":439},[1584],{"type":398,"value":1421},{"type":393,"tag":427,"props":1586,"children":1587},{"style":515},[1588],{"type":398,"value":1589},"'day_of_week'",{"type":393,"tag":427,"props":1591,"children":1592},{"style":439},[1593],{"type":398,"value":757},{"type":393,"tag":427,"props":1595,"children":1596},{"style":433},[1597],{"type":398,"value":504},{"type":393,"tag":427,"props":1599,"children":1600},{"style":439},[1601],{"type":398,"value":1537},{"type":393,"tag":427,"props":1603,"children":1604},{"style":515},[1605],{"type":398,"value":708},{"type":393,"tag":427,"props":1607,"children":1608},{"style":439},[1609],{"type":398,"value":1610},"].dt.day_name()\n",{"type":393,"tag":427,"props":1612,"children":1613},{"class":429,"line":197},[1614],{"type":393,"tag":427,"props":1615,"children":1616},{"emptyLinePlaceholder":12},[1617],{"type":398,"value":482},{"type":393,"tag":427,"props":1619,"children":1620},{"class":429,"line":206},[1621,1625,1629,1634],{"type":393,"tag":427,"props":1622,"children":1623},{"style":606},[1624],{"type":398,"value":655},{"type":393,"tag":427,"props":1626,"children":1627},{"style":439},[1628],{"type":398,"value":660},{"type":393,"tag":427,"props":1630,"children":1631},{"style":515},[1632],{"type":398,"value":1633},"\"With extracted components:\"",{"type":393,"tag":427,"props":1635,"children":1636},{"style":439},[1637],{"type":398,"value":670},{"type":393,"tag":427,"props":1639,"children":1640},{"class":429,"line":215},[1641,1645,1650,1654,1658,1662,1666,1670,1674,1678,1682,1687],{"type":393,"tag":427,"props":1642,"children":1643},{"style":606},[1644],{"type":398,"value":655},{"type":393,"tag":427,"props":1646,"children":1647},{"style":439},[1648],{"type":398,"value":1649},"(data[[",{"type":393,"tag":427,"props":1651,"children":1652},{"style":515},[1653],{"type":398,"value":708},{"type":393,"tag":427,"props":1655,"children":1656},{"style":439},[1657],{"type":398,"value":533},{"type":393,"tag":427,"props":1659,"children":1660},{"style":515},[1661],{"type":398,"value":1524},{"type":393,"tag":427,"props":1663,"children":1664},{"style":439},[1665],{"type":398,"value":533},{"type":393,"tag":427,"props":1667,"children":1668},{"style":515},[1669],{"type":398,"value":871},{"type":393,"tag":427,"props":1671,"children":1672},{"style":439},[1673],{"type":398,"value":533},{"type":393,"tag":427,"props":1675,"children":1676},{"style":515},[1677],{"type":398,"value":1589},{"type":393,"tag":427,"props":1679,"children":1680},{"style":439},[1681],{"type":398,"value":533},{"type":393,"tag":427,"props":1683,"children":1684},{"style":515},[1685],{"type":398,"value":1686},"'sales'",{"type":393,"tag":427,"props":1688,"children":1689},{"style":439},[1690],{"type":398,"value":1691},"]])\n",{"type":393,"tag":427,"props":1693,"children":1694},{"class":429,"line":224},[1695,1699],{"type":393,"tag":427,"props":1696,"children":1697},{"style":606},[1698],{"type":398,"value":655},{"type":393,"tag":427,"props":1700,"children":1701},{"style":439},[1702],{"type":398,"value":725},{"type":393,"tag":427,"props":1704,"children":1705},{"class":429,"line":233},[1706],{"type":393,"tag":427,"props":1707,"children":1708},{"emptyLinePlaceholder":12},[1709],{"type":398,"value":482},{"type":393,"tag":427,"props":1711,"children":1712},{"class":429,"line":244},[1713],{"type":393,"tag":427,"props":1714,"children":1715},{"style":488},[1716],{"type":398,"value":1717},"# Filter by date range\n",{"type":393,"tag":427,"props":1719,"children":1720},{"class":429,"line":253},[1721,1726,1730,1735,1739,1743,1748,1753],{"type":393,"tag":427,"props":1722,"children":1723},{"style":439},[1724],{"type":398,"value":1725},"recent_data ",{"type":393,"tag":427,"props":1727,"children":1728},{"style":433},[1729],{"type":398,"value":504},{"type":393,"tag":427,"props":1731,"children":1732},{"style":439},[1733],{"type":398,"value":1734}," data[data[",{"type":393,"tag":427,"props":1736,"children":1737},{"style":515},[1738],{"type":398,"value":708},{"type":393,"tag":427,"props":1740,"children":1741},{"style":439},[1742],{"type":398,"value":757},{"type":393,"tag":427,"props":1744,"children":1745},{"style":433},[1746],{"type":398,"value":1747},">=",{"type":393,"tag":427,"props":1749,"children":1750},{"style":515},[1751],{"type":398,"value":1752}," '2023-02-01'",{"type":393,"tag":427,"props":1754,"children":1755},{"style":439},[1756],{"type":398,"value":632},{"type":393,"tag":427,"props":1758,"children":1759},{"class":429,"line":262},[1760,1764,1768,1773],{"type":393,"tag":427,"props":1761,"children":1762},{"style":606},[1763],{"type":398,"value":655},{"type":393,"tag":427,"props":1765,"children":1766},{"style":439},[1767],{"type":398,"value":660},{"type":393,"tag":427,"props":1769,"children":1770},{"style":515},[1771],{"type":398,"value":1772},"\"February and later:\"",{"type":393,"tag":427,"props":1774,"children":1775},{"style":439},[1776],{"type":398,"value":670},{"type":393,"tag":427,"props":1778,"children":1779},{"class":429,"line":271},[1780,1784,1789,1793,1797,1801],{"type":393,"tag":427,"props":1781,"children":1782},{"style":606},[1783],{"type":398,"value":655},{"type":393,"tag":427,"props":1785,"children":1786},{"style":439},[1787],{"type":398,"value":1788},"(recent_data[[",{"type":393,"tag":427,"props":1790,"children":1791},{"style":515},[1792],{"type":398,"value":708},{"type":393,"tag":427,"props":1794,"children":1795},{"style":439},[1796],{"type":398,"value":533},{"type":393,"tag":427,"props":1798,"children":1799},{"style":515},[1800],{"type":398,"value":1686},{"type":393,"tag":427,"props":1802,"children":1803},{"style":439},[1804],{"type":398,"value":1691},{"type":393,"tag":926,"props":1806,"children":1808},{"id":1807},"time-series-analysis-preview",[1809],{"type":398,"value":1810},"📊 Time Series Analysis Preview",{"type":393,"tag":401,"props":1812,"children":1813},{},[1814],{"type":398,"value":1815},"See how dates enable powerful time-based analysis:",{"type":393,"tag":412,"props":1817,"children":1818},{},[1819],{"type":393,"tag":416,"props":1820,"children":1822},{"className":418,"code":1821,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Daily sales data\ndaily_sales = pd.DataFrame({\n    'date': pd.date_range('2023-01-01', periods=7, freq='D'),\n    'sales': [100, 120, 110, 130, 140, 160, 150]\n})\n\nprint(\"Daily sales:\")\nprint(daily_sales)\nprint()\n\n# Set date as index for time series operations\ndaily_sales.set_index('date', inplace=True)\nprint(\"With date index:\")\nprint(daily_sales)\nprint()\n\n# Resample to weekly totals\nweekly_sales = daily_sales.resample('W').sum()\nprint(\"Weekly totals:\")\nprint(weekly_sales)\n",[1823],{"type":393,"tag":423,"props":1824,"children":1825},{"__ignoreMap":6},[1826,1845,1852,1860,1876,1935,2006,2013,2020,2040,2052,2063,2070,2078,2112,2132,2143,2154,2161,2169,2196,2216],{"type":393,"tag":427,"props":1827,"children":1828},{"class":429,"line":11},[1829,1833,1837,1841],{"type":393,"tag":427,"props":1830,"children":1831},{"style":433},[1832],{"type":398,"value":436},{"type":393,"tag":427,"props":1834,"children":1835},{"style":439},[1836],{"type":398,"value":442},{"type":393,"tag":427,"props":1838,"children":1839},{"style":433},[1840],{"type":398,"value":447},{"type":393,"tag":427,"props":1842,"children":1843},{"style":439},[1844],{"type":398,"value":452},{"type":393,"tag":427,"props":1846,"children":1847},{"class":429,"line":27},[1848],{"type":393,"tag":427,"props":1849,"children":1850},{"emptyLinePlaceholder":12},[1851],{"type":398,"value":482},{"type":393,"tag":427,"props":1853,"children":1854},{"class":429,"line":36},[1855],{"type":393,"tag":427,"props":1856,"children":1857},{"style":488},[1858],{"type":398,"value":1859},"# Daily sales data\n",{"type":393,"tag":427,"props":1861,"children":1862},{"class":429,"line":45},[1863,1868,1872],{"type":393,"tag":427,"props":1864,"children":1865},{"style":439},[1866],{"type":398,"value":1867},"daily_sales ",{"type":393,"tag":427,"props":1869,"children":1870},{"style":433},[1871],{"type":398,"value":504},{"type":393,"tag":427,"props":1873,"children":1874},{"style":439},[1875],{"type":398,"value":509},{"type":393,"tag":427,"props":1877,"children":1878},{"class":429,"line":54},[1879,1883,1888,1893,1897,1903,1907,1912,1916,1921,1925,1930],{"type":393,"tag":427,"props":1880,"children":1881},{"style":515},[1882],{"type":398,"value":518},{"type":393,"tag":427,"props":1884,"children":1885},{"style":439},[1886],{"type":398,"value":1887},": pd.date_range(",{"type":393,"tag":427,"props":1889,"children":1890},{"style":515},[1891],{"type":398,"value":1892},"'2023-01-01'",{"type":393,"tag":427,"props":1894,"children":1895},{"style":439},[1896],{"type":398,"value":533},{"type":393,"tag":427,"props":1898,"children":1900},{"style":1899},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[1901],{"type":398,"value":1902},"periods",{"type":393,"tag":427,"props":1904,"children":1905},{"style":433},[1906],{"type":398,"value":504},{"type":393,"tag":427,"props":1908,"children":1909},{"style":606},[1910],{"type":398,"value":1911},"7",{"type":393,"tag":427,"props":1913,"children":1914},{"style":439},[1915],{"type":398,"value":533},{"type":393,"tag":427,"props":1917,"children":1918},{"style":1899},[1919],{"type":398,"value":1920},"freq",{"type":393,"tag":427,"props":1922,"children":1923},{"style":433},[1924],{"type":398,"value":504},{"type":393,"tag":427,"props":1926,"children":1927},{"style":515},[1928],{"type":398,"value":1929},"'D'",{"type":393,"tag":427,"props":1931,"children":1932},{"style":439},[1933],{"type":398,"value":1934},"),\n",{"type":393,"tag":427,"props":1936,"children":1937},{"class":429,"line":63},[1938,1942,1946,1950,1954,1958,1962,1967,1971,1976,1980,1985,1989,1994,1998,2002],{"type":393,"tag":427,"props":1939,"children":1940},{"style":515},[1941],{"type":398,"value":599},{"type":393,"tag":427,"props":1943,"children":1944},{"style":439},[1945],{"type":398,"value":523},{"type":393,"tag":427,"props":1947,"children":1948},{"style":606},[1949],{"type":398,"value":1361},{"type":393,"tag":427,"props":1951,"children":1952},{"style":439},[1953],{"type":398,"value":533},{"type":393,"tag":427,"props":1955,"children":1956},{"style":606},[1957],{"type":398,"value":1379},{"type":393,"tag":427,"props":1959,"children":1960},{"style":439},[1961],{"type":398,"value":533},{"type":393,"tag":427,"props":1963,"children":1964},{"style":606},[1965],{"type":398,"value":1966},"110",{"type":393,"tag":427,"props":1968,"children":1969},{"style":439},[1970],{"type":398,"value":533},{"type":393,"tag":427,"props":1972,"children":1973},{"style":606},[1974],{"type":398,"value":1975},"130",{"type":393,"tag":427,"props":1977,"children":1978},{"style":439},[1979],{"type":398,"value":533},{"type":393,"tag":427,"props":1981,"children":1982},{"style":606},[1983],{"type":398,"value":1984},"140",{"type":393,"tag":427,"props":1986,"children":1987},{"style":439},[1988],{"type":398,"value":533},{"type":393,"tag":427,"props":1990,"children":1991},{"style":606},[1992],{"type":398,"value":1993},"160",{"type":393,"tag":427,"props":1995,"children":1996},{"style":439},[1997],{"type":398,"value":533},{"type":393,"tag":427,"props":1999,"children":2000},{"style":606},[2001],{"type":398,"value":1370},{"type":393,"tag":427,"props":2003,"children":2004},{"style":439},[2005],{"type":398,"value":632},{"type":393,"tag":427,"props":2007,"children":2008},{"class":429,"line":72},[2009],{"type":393,"tag":427,"props":2010,"children":2011},{"style":439},[2012],{"type":398,"value":640},{"type":393,"tag":427,"props":2014,"children":2015},{"class":429,"line":83},[2016],{"type":393,"tag":427,"props":2017,"children":2018},{"emptyLinePlaceholder":12},[2019],{"type":398,"value":482},{"type":393,"tag":427,"props":2021,"children":2022},{"class":429,"line":92},[2023,2027,2031,2036],{"type":393,"tag":427,"props":2024,"children":2025},{"style":606},[2026],{"type":398,"value":655},{"type":393,"tag":427,"props":2028,"children":2029},{"style":439},[2030],{"type":398,"value":660},{"type":393,"tag":427,"props":2032,"children":2033},{"style":515},[2034],{"type":398,"value":2035},"\"Daily sales:\"",{"type":393,"tag":427,"props":2037,"children":2038},{"style":439},[2039],{"type":398,"value":670},{"type":393,"tag":427,"props":2041,"children":2042},{"class":429,"line":101},[2043,2047],{"type":393,"tag":427,"props":2044,"children":2045},{"style":606},[2046],{"type":398,"value":655},{"type":393,"tag":427,"props":2048,"children":2049},{"style":439},[2050],{"type":398,"value":2051},"(daily_sales)\n",{"type":393,"tag":427,"props":2053,"children":2054},{"class":429,"line":110},[2055,2059],{"type":393,"tag":427,"props":2056,"children":2057},{"style":606},[2058],{"type":398,"value":655},{"type":393,"tag":427,"props":2060,"children":2061},{"style":439},[2062],{"type":398,"value":725},{"type":393,"tag":427,"props":2064,"children":2065},{"class":429,"line":121},[2066],{"type":393,"tag":427,"props":2067,"children":2068},{"emptyLinePlaceholder":12},[2069],{"type":398,"value":482},{"type":393,"tag":427,"props":2071,"children":2072},{"class":429,"line":130},[2073],{"type":393,"tag":427,"props":2074,"children":2075},{"style":488},[2076],{"type":398,"value":2077},"# Set date as index for time series operations\n",{"type":393,"tag":427,"props":2079,"children":2080},{"class":429,"line":139},[2081,2086,2090,2094,2099,2103,2108],{"type":393,"tag":427,"props":2082,"children":2083},{"style":439},[2084],{"type":398,"value":2085},"daily_sales.set_index(",{"type":393,"tag":427,"props":2087,"children":2088},{"style":515},[2089],{"type":398,"value":708},{"type":393,"tag":427,"props":2091,"children":2092},{"style":439},[2093],{"type":398,"value":533},{"type":393,"tag":427,"props":2095,"children":2096},{"style":1899},[2097],{"type":398,"value":2098},"inplace",{"type":393,"tag":427,"props":2100,"children":2101},{"style":433},[2102],{"type":398,"value":504},{"type":393,"tag":427,"props":2104,"children":2105},{"style":606},[2106],{"type":398,"value":2107},"True",{"type":393,"tag":427,"props":2109,"children":2110},{"style":439},[2111],{"type":398,"value":670},{"type":393,"tag":427,"props":2113,"children":2114},{"class":429,"line":148},[2115,2119,2123,2128],{"type":393,"tag":427,"props":2116,"children":2117},{"style":606},[2118],{"type":398,"value":655},{"type":393,"tag":427,"props":2120,"children":2121},{"style":439},[2122],{"type":398,"value":660},{"type":393,"tag":427,"props":2124,"children":2125},{"style":515},[2126],{"type":398,"value":2127},"\"With date index:\"",{"type":393,"tag":427,"props":2129,"children":2130},{"style":439},[2131],{"type":398,"value":670},{"type":393,"tag":427,"props":2133,"children":2134},{"class":429,"line":159},[2135,2139],{"type":393,"tag":427,"props":2136,"children":2137},{"style":606},[2138],{"type":398,"value":655},{"type":393,"tag":427,"props":2140,"children":2141},{"style":439},[2142],{"type":398,"value":2051},{"type":393,"tag":427,"props":2144,"children":2145},{"class":429,"line":168},[2146,2150],{"type":393,"tag":427,"props":2147,"children":2148},{"style":606},[2149],{"type":398,"value":655},{"type":393,"tag":427,"props":2151,"children":2152},{"style":439},[2153],{"type":398,"value":725},{"type":393,"tag":427,"props":2155,"children":2156},{"class":429,"line":177},[2157],{"type":393,"tag":427,"props":2158,"children":2159},{"emptyLinePlaceholder":12},[2160],{"type":398,"value":482},{"type":393,"tag":427,"props":2162,"children":2163},{"class":429,"line":186},[2164],{"type":393,"tag":427,"props":2165,"children":2166},{"style":488},[2167],{"type":398,"value":2168},"# Resample to weekly totals\n",{"type":393,"tag":427,"props":2170,"children":2171},{"class":429,"line":197},[2172,2177,2181,2186,2191],{"type":393,"tag":427,"props":2173,"children":2174},{"style":439},[2175],{"type":398,"value":2176},"weekly_sales ",{"type":393,"tag":427,"props":2178,"children":2179},{"style":433},[2180],{"type":398,"value":504},{"type":393,"tag":427,"props":2182,"children":2183},{"style":439},[2184],{"type":398,"value":2185}," daily_sales.resample(",{"type":393,"tag":427,"props":2187,"children":2188},{"style":515},[2189],{"type":398,"value":2190},"'W'",{"type":393,"tag":427,"props":2192,"children":2193},{"style":439},[2194],{"type":398,"value":2195},").sum()\n",{"type":393,"tag":427,"props":2197,"children":2198},{"class":429,"line":206},[2199,2203,2207,2212],{"type":393,"tag":427,"props":2200,"children":2201},{"style":606},[2202],{"type":398,"value":655},{"type":393,"tag":427,"props":2204,"children":2205},{"style":439},[2206],{"type":398,"value":660},{"type":393,"tag":427,"props":2208,"children":2209},{"style":515},[2210],{"type":398,"value":2211},"\"Weekly totals:\"",{"type":393,"tag":427,"props":2213,"children":2214},{"style":439},[2215],{"type":398,"value":670},{"type":393,"tag":427,"props":2217,"children":2218},{"class":429,"line":215},[2219,2223],{"type":393,"tag":427,"props":2220,"children":2221},{"style":606},[2222],{"type":398,"value":655},{"type":393,"tag":427,"props":2224,"children":2225},{"style":439},[2226],{"type":398,"value":2227},"(weekly_sales)\n",{"type":393,"tag":926,"props":2229,"children":2231},{"id":2230},"date-conversion-challenges",[2232],{"type":398,"value":2233},"🔧 Date Conversion Challenges",{"type":393,"tag":401,"props":2235,"children":2236},{},[2237],{"type":398,"value":2238},"Real-world date data often needs cleaning:",{"type":393,"tag":938,"props":2240,"children":2244},{"emoji":2241,"title":2242,"type":2243},"⚠️","Common Date Challenges","warning",[2245,2253,2271,2279,2297,2305,2323,2331],{"type":393,"tag":401,"props":2246,"children":2247},{},[2248],{"type":393,"tag":948,"props":2249,"children":2250},{},[2251],{"type":398,"value":2252},"Format Variations:",{"type":393,"tag":954,"props":2254,"children":2255},{},[2256,2261,2266],{"type":393,"tag":958,"props":2257,"children":2258},{},[2259],{"type":398,"value":2260},"Different date formats: '01/15/2023', '15-Jan-2023'",{"type":393,"tag":958,"props":2262,"children":2263},{},[2264],{"type":398,"value":2265},"Mixed formats in same column",{"type":393,"tag":958,"props":2267,"children":2268},{},[2269],{"type":398,"value":2270},"International vs US date formats",{"type":393,"tag":401,"props":2272,"children":2273},{},[2274],{"type":393,"tag":948,"props":2275,"children":2276},{},[2277],{"type":398,"value":2278},"Missing or Invalid Dates:",{"type":393,"tag":954,"props":2280,"children":2281},{},[2282,2287,2292],{"type":393,"tag":958,"props":2283,"children":2284},{},[2285],{"type":398,"value":2286},"Empty strings or NaN values",{"type":393,"tag":958,"props":2288,"children":2289},{},[2290],{"type":398,"value":2291},"Invalid dates like '2023-02-30'",{"type":393,"tag":958,"props":2293,"children":2294},{},[2295],{"type":398,"value":2296},"Partial dates missing components",{"type":393,"tag":401,"props":2298,"children":2299},{},[2300],{"type":393,"tag":948,"props":2301,"children":2302},{},[2303],{"type":398,"value":2304},"Time Zones:",{"type":393,"tag":954,"props":2306,"children":2307},{},[2308,2313,2318],{"type":393,"tag":958,"props":2309,"children":2310},{},[2311],{"type":398,"value":2312},"Data from different time zones",{"type":393,"tag":958,"props":2314,"children":2315},{},[2316],{"type":398,"value":2317},"Daylight saving time changes",{"type":393,"tag":958,"props":2319,"children":2320},{},[2321],{"type":398,"value":2322},"UTC vs local time conversions",{"type":393,"tag":401,"props":2324,"children":2325},{},[2326],{"type":393,"tag":948,"props":2327,"children":2328},{},[2329],{"type":398,"value":2330},"Solutions:",{"type":393,"tag":954,"props":2332,"children":2333},{},[2334,2346,2357,2368],{"type":393,"tag":958,"props":2335,"children":2336},{},[2337,2339,2344],{"type":398,"value":2338},"Use ",{"type":393,"tag":423,"props":2340,"children":2342},{"className":2341},[],[2343],{"type":398,"value":1222},{"type":398,"value":2345}," with error handling",{"type":393,"tag":958,"props":2347,"children":2348},{},[2349,2351],{"type":398,"value":2350},"Specify format when known: ",{"type":393,"tag":423,"props":2352,"children":2354},{"className":2353},[],[2355],{"type":398,"value":2356},"format='%Y-%m-%d'",{"type":393,"tag":958,"props":2358,"children":2359},{},[2360,2362],{"type":398,"value":2361},"Handle errors with ",{"type":393,"tag":423,"props":2363,"children":2365},{"className":2364},[],[2366],{"type":398,"value":2367},"errors='coerce'",{"type":393,"tag":958,"props":2369,"children":2370},{},[2371],{"type":398,"value":2372},"Clean data before conversion",{"type":393,"tag":926,"props":2374,"children":2376},{"id":2375},"business-applications",[2377],{"type":398,"value":2378},"📈 Business Applications",{"type":393,"tag":401,"props":2380,"children":2381},{},[2382],{"type":398,"value":2383},"Real-world scenarios where date operations are crucial:",{"type":393,"tag":412,"props":2385,"children":2386},{},[2387],{"type":393,"tag":416,"props":2388,"children":2390},{"className":418,"code":2389,"language":420,"meta":6,"style":6},"import pandas as pd\n\n# Customer transactions over time\ntransactions = pd.DataFrame({\n    'transaction_date': ['2023-01-15', '2023-01-20', '2023-02-10', '2023-02-25', '2023-03-05'],\n    'customer_id': [1, 2, 1, 3, 2],\n    'amount': [250, 100, 300, 150, 200]\n})\n\n# Convert to datetime\ntransactions['transaction_date'] = pd.to_datetime(transactions['transaction_date'])\n\nprint(\"Transaction data:\")\nprint(transactions)\nprint()\n\n# Extract month for analysis\ntransactions['month'] = transactions['transaction_date'].dt.month\n\n# Monthly sales summary\nmonthly_summary = transactions.groupby('month')['amount'].agg(['sum', 'count'])\nmonthly_summary.columns = ['Total_Sales', 'Transaction_Count']\n\nprint(\"Monthly summary:\")\nprint(monthly_summary)\nprint()\n\n# Calculate days since first transaction\nfirst_date = transactions['transaction_date'].min()\ntransactions['days_since_start'] = (transactions['transaction_date'] - first_date).dt.days\n\nprint(\"With days since start:\")\nprint(transactions[['transaction_date', 'amount', 'days_since_start']])\n",[2391],{"type":393,"tag":423,"props":2392,"children":2393},{"__ignoreMap":6},[2394,2413,2420,2428,2444,2500,2555,2610,2617,2624,2631,2665,2672,2692,2704,2715,2722,2730,2762,2769,2777,2831,2866,2873,2893,2905,2916,2923,2931,2956,2999,3006,3026],{"type":393,"tag":427,"props":2395,"children":2396},{"class":429,"line":11},[2397,2401,2405,2409],{"type":393,"tag":427,"props":2398,"children":2399},{"style":433},[2400],{"type":398,"value":436},{"type":393,"tag":427,"props":2402,"children":2403},{"style":439},[2404],{"type":398,"value":442},{"type":393,"tag":427,"props":2406,"children":2407},{"style":433},[2408],{"type":398,"value":447},{"type":393,"tag":427,"props":2410,"children":2411},{"style":439},[2412],{"type":398,"value":452},{"type":393,"tag":427,"props":2414,"children":2415},{"class":429,"line":27},[2416],{"type":393,"tag":427,"props":2417,"children":2418},{"emptyLinePlaceholder":12},[2419],{"type":398,"value":482},{"type":393,"tag":427,"props":2421,"children":2422},{"class":429,"line":36},[2423],{"type":393,"tag":427,"props":2424,"children":2425},{"style":488},[2426],{"type":398,"value":2427},"# Customer transactions over time\n",{"type":393,"tag":427,"props":2429,"children":2430},{"class":429,"line":45},[2431,2436,2440],{"type":393,"tag":427,"props":2432,"children":2433},{"style":439},[2434],{"type":398,"value":2435},"transactions ",{"type":393,"tag":427,"props":2437,"children":2438},{"style":433},[2439],{"type":398,"value":504},{"type":393,"tag":427,"props":2441,"children":2442},{"style":439},[2443],{"type":398,"value":509},{"type":393,"tag":427,"props":2445,"children":2446},{"class":429,"line":54},[2447,2452,2456,2460,2464,2469,2473,2478,2482,2487,2491,2496],{"type":393,"tag":427,"props":2448,"children":2449},{"style":515},[2450],{"type":398,"value":2451},"    'transaction_date'",{"type":393,"tag":427,"props":2453,"children":2454},{"style":439},[2455],{"type":398,"value":523},{"type":393,"tag":427,"props":2457,"children":2458},{"style":515},[2459],{"type":398,"value":528},{"type":393,"tag":427,"props":2461,"children":2462},{"style":439},[2463],{"type":398,"value":533},{"type":393,"tag":427,"props":2465,"children":2466},{"style":515},[2467],{"type":398,"value":2468},"'2023-01-20'",{"type":393,"tag":427,"props":2470,"children":2471},{"style":439},[2472],{"type":398,"value":533},{"type":393,"tag":427,"props":2474,"children":2475},{"style":515},[2476],{"type":398,"value":2477},"'2023-02-10'",{"type":393,"tag":427,"props":2479,"children":2480},{"style":439},[2481],{"type":398,"value":533},{"type":393,"tag":427,"props":2483,"children":2484},{"style":515},[2485],{"type":398,"value":2486},"'2023-02-25'",{"type":393,"tag":427,"props":2488,"children":2489},{"style":439},[2490],{"type":398,"value":533},{"type":393,"tag":427,"props":2492,"children":2493},{"style":515},[2494],{"type":398,"value":2495},"'2023-03-05'",{"type":393,"tag":427,"props":2497,"children":2498},{"style":439},[2499],{"type":398,"value":552},{"type":393,"tag":427,"props":2501,"children":2502},{"class":429,"line":63},[2503,2508,2512,2517,2521,2526,2530,2534,2538,2543,2547,2551],{"type":393,"tag":427,"props":2504,"children":2505},{"style":515},[2506],{"type":398,"value":2507},"    'customer_id'",{"type":393,"tag":427,"props":2509,"children":2510},{"style":439},[2511],{"type":398,"value":523},{"type":393,"tag":427,"props":2513,"children":2514},{"style":606},[2515],{"type":398,"value":2516},"1",{"type":393,"tag":427,"props":2518,"children":2519},{"style":439},[2520],{"type":398,"value":533},{"type":393,"tag":427,"props":2522,"children":2523},{"style":606},[2524],{"type":398,"value":2525},"2",{"type":393,"tag":427,"props":2527,"children":2528},{"style":439},[2529],{"type":398,"value":533},{"type":393,"tag":427,"props":2531,"children":2532},{"style":606},[2533],{"type":398,"value":2516},{"type":393,"tag":427,"props":2535,"children":2536},{"style":439},[2537],{"type":398,"value":533},{"type":393,"tag":427,"props":2539,"children":2540},{"style":606},[2541],{"type":398,"value":2542},"3",{"type":393,"tag":427,"props":2544,"children":2545},{"style":439},[2546],{"type":398,"value":533},{"type":393,"tag":427,"props":2548,"children":2549},{"style":606},[2550],{"type":398,"value":2525},{"type":393,"tag":427,"props":2552,"children":2553},{"style":439},[2554],{"type":398,"value":552},{"type":393,"tag":427,"props":2556,"children":2557},{"class":429,"line":72},[2558,2563,2567,2572,2576,2580,2584,2589,2593,2597,2601,2606],{"type":393,"tag":427,"props":2559,"children":2560},{"style":515},[2561],{"type":398,"value":2562},"    'amount'",{"type":393,"tag":427,"props":2564,"children":2565},{"style":439},[2566],{"type":398,"value":523},{"type":393,"tag":427,"props":2568,"children":2569},{"style":606},[2570],{"type":398,"value":2571},"250",{"type":393,"tag":427,"props":2573,"children":2574},{"style":439},[2575],{"type":398,"value":533},{"type":393,"tag":427,"props":2577,"children":2578},{"style":606},[2579],{"type":398,"value":1361},{"type":393,"tag":427,"props":2581,"children":2582},{"style":439},[2583],{"type":398,"value":533},{"type":393,"tag":427,"props":2585,"children":2586},{"style":606},[2587],{"type":398,"value":2588},"300",{"type":393,"tag":427,"props":2590,"children":2591},{"style":439},[2592],{"type":398,"value":533},{"type":393,"tag":427,"props":2594,"children":2595},{"style":606},[2596],{"type":398,"value":1370},{"type":393,"tag":427,"props":2598,"children":2599},{"style":439},[2600],{"type":398,"value":533},{"type":393,"tag":427,"props":2602,"children":2603},{"style":606},[2604],{"type":398,"value":2605},"200",{"type":393,"tag":427,"props":2607,"children":2608},{"style":439},[2609],{"type":398,"value":632},{"type":393,"tag":427,"props":2611,"children":2612},{"class":429,"line":83},[2613],{"type":393,"tag":427,"props":2614,"children":2615},{"style":439},[2616],{"type":398,"value":640},{"type":393,"tag":427,"props":2618,"children":2619},{"class":429,"line":92},[2620],{"type":393,"tag":427,"props":2621,"children":2622},{"emptyLinePlaceholder":12},[2623],{"type":398,"value":482},{"type":393,"tag":427,"props":2625,"children":2626},{"class":429,"line":101},[2627],{"type":393,"tag":427,"props":2628,"children":2629},{"style":488},[2630],{"type":398,"value":740},{"type":393,"tag":427,"props":2632,"children":2633},{"class":429,"line":110},[2634,2639,2644,2648,2652,2657,2661],{"type":393,"tag":427,"props":2635,"children":2636},{"style":439},[2637],{"type":398,"value":2638},"transactions[",{"type":393,"tag":427,"props":2640,"children":2641},{"style":515},[2642],{"type":398,"value":2643},"'transaction_date'",{"type":393,"tag":427,"props":2645,"children":2646},{"style":439},[2647],{"type":398,"value":757},{"type":393,"tag":427,"props":2649,"children":2650},{"style":433},[2651],{"type":398,"value":504},{"type":393,"tag":427,"props":2653,"children":2654},{"style":439},[2655],{"type":398,"value":2656}," pd.to_datetime(transactions[",{"type":393,"tag":427,"props":2658,"children":2659},{"style":515},[2660],{"type":398,"value":2643},{"type":393,"tag":427,"props":2662,"children":2663},{"style":439},[2664],{"type":398,"value":775},{"type":393,"tag":427,"props":2666,"children":2667},{"class":429,"line":121},[2668],{"type":393,"tag":427,"props":2669,"children":2670},{"emptyLinePlaceholder":12},[2671],{"type":398,"value":482},{"type":393,"tag":427,"props":2673,"children":2674},{"class":429,"line":130},[2675,2679,2683,2688],{"type":393,"tag":427,"props":2676,"children":2677},{"style":606},[2678],{"type":398,"value":655},{"type":393,"tag":427,"props":2680,"children":2681},{"style":439},[2682],{"type":398,"value":660},{"type":393,"tag":427,"props":2684,"children":2685},{"style":515},[2686],{"type":398,"value":2687},"\"Transaction data:\"",{"type":393,"tag":427,"props":2689,"children":2690},{"style":439},[2691],{"type":398,"value":670},{"type":393,"tag":427,"props":2693,"children":2694},{"class":429,"line":139},[2695,2699],{"type":393,"tag":427,"props":2696,"children":2697},{"style":606},[2698],{"type":398,"value":655},{"type":393,"tag":427,"props":2700,"children":2701},{"style":439},[2702],{"type":398,"value":2703},"(transactions)\n",{"type":393,"tag":427,"props":2705,"children":2706},{"class":429,"line":148},[2707,2711],{"type":393,"tag":427,"props":2708,"children":2709},{"style":606},[2710],{"type":398,"value":655},{"type":393,"tag":427,"props":2712,"children":2713},{"style":439},[2714],{"type":398,"value":725},{"type":393,"tag":427,"props":2716,"children":2717},{"class":429,"line":159},[2718],{"type":393,"tag":427,"props":2719,"children":2720},{"emptyLinePlaceholder":12},[2721],{"type":398,"value":482},{"type":393,"tag":427,"props":2723,"children":2724},{"class":429,"line":168},[2725],{"type":393,"tag":427,"props":2726,"children":2727},{"style":488},[2728],{"type":398,"value":2729},"# Extract month for analysis\n",{"type":393,"tag":427,"props":2731,"children":2732},{"class":429,"line":177},[2733,2737,2741,2745,2749,2754,2758],{"type":393,"tag":427,"props":2734,"children":2735},{"style":439},[2736],{"type":398,"value":2638},{"type":393,"tag":427,"props":2738,"children":2739},{"style":515},[2740],{"type":398,"value":871},{"type":393,"tag":427,"props":2742,"children":2743},{"style":439},[2744],{"type":398,"value":757},{"type":393,"tag":427,"props":2746,"children":2747},{"style":433},[2748],{"type":398,"value":504},{"type":393,"tag":427,"props":2750,"children":2751},{"style":439},[2752],{"type":398,"value":2753}," transactions[",{"type":393,"tag":427,"props":2755,"children":2756},{"style":515},[2757],{"type":398,"value":2643},{"type":393,"tag":427,"props":2759,"children":2760},{"style":439},[2761],{"type":398,"value":893},{"type":393,"tag":427,"props":2763,"children":2764},{"class":429,"line":186},[2765],{"type":393,"tag":427,"props":2766,"children":2767},{"emptyLinePlaceholder":12},[2768],{"type":398,"value":482},{"type":393,"tag":427,"props":2770,"children":2771},{"class":429,"line":197},[2772],{"type":393,"tag":427,"props":2773,"children":2774},{"style":488},[2775],{"type":398,"value":2776},"# Monthly sales summary\n",{"type":393,"tag":427,"props":2778,"children":2779},{"class":429,"line":206},[2780,2785,2789,2794,2798,2803,2808,2813,2818,2822,2827],{"type":393,"tag":427,"props":2781,"children":2782},{"style":439},[2783],{"type":398,"value":2784},"monthly_summary ",{"type":393,"tag":427,"props":2786,"children":2787},{"style":433},[2788],{"type":398,"value":504},{"type":393,"tag":427,"props":2790,"children":2791},{"style":439},[2792],{"type":398,"value":2793}," transactions.groupby(",{"type":393,"tag":427,"props":2795,"children":2796},{"style":515},[2797],{"type":398,"value":871},{"type":393,"tag":427,"props":2799,"children":2800},{"style":439},[2801],{"type":398,"value":2802},")[",{"type":393,"tag":427,"props":2804,"children":2805},{"style":515},[2806],{"type":398,"value":2807},"'amount'",{"type":393,"tag":427,"props":2809,"children":2810},{"style":439},[2811],{"type":398,"value":2812},"].agg([",{"type":393,"tag":427,"props":2814,"children":2815},{"style":515},[2816],{"type":398,"value":2817},"'sum'",{"type":393,"tag":427,"props":2819,"children":2820},{"style":439},[2821],{"type":398,"value":533},{"type":393,"tag":427,"props":2823,"children":2824},{"style":515},[2825],{"type":398,"value":2826},"'count'",{"type":393,"tag":427,"props":2828,"children":2829},{"style":439},[2830],{"type":398,"value":775},{"type":393,"tag":427,"props":2832,"children":2833},{"class":429,"line":215},[2834,2839,2843,2848,2853,2857,2862],{"type":393,"tag":427,"props":2835,"children":2836},{"style":439},[2837],{"type":398,"value":2838},"monthly_summary.columns ",{"type":393,"tag":427,"props":2840,"children":2841},{"style":433},[2842],{"type":398,"value":504},{"type":393,"tag":427,"props":2844,"children":2845},{"style":439},[2846],{"type":398,"value":2847}," [",{"type":393,"tag":427,"props":2849,"children":2850},{"style":515},[2851],{"type":398,"value":2852},"'Total_Sales'",{"type":393,"tag":427,"props":2854,"children":2855},{"style":439},[2856],{"type":398,"value":533},{"type":393,"tag":427,"props":2858,"children":2859},{"style":515},[2860],{"type":398,"value":2861},"'Transaction_Count'",{"type":393,"tag":427,"props":2863,"children":2864},{"style":439},[2865],{"type":398,"value":632},{"type":393,"tag":427,"props":2867,"children":2868},{"class":429,"line":224},[2869],{"type":393,"tag":427,"props":2870,"children":2871},{"emptyLinePlaceholder":12},[2872],{"type":398,"value":482},{"type":393,"tag":427,"props":2874,"children":2875},{"class":429,"line":233},[2876,2880,2884,2889],{"type":393,"tag":427,"props":2877,"children":2878},{"style":606},[2879],{"type":398,"value":655},{"type":393,"tag":427,"props":2881,"children":2882},{"style":439},[2883],{"type":398,"value":660},{"type":393,"tag":427,"props":2885,"children":2886},{"style":515},[2887],{"type":398,"value":2888},"\"Monthly summary:\"",{"type":393,"tag":427,"props":2890,"children":2891},{"style":439},[2892],{"type":398,"value":670},{"type":393,"tag":427,"props":2894,"children":2895},{"class":429,"line":244},[2896,2900],{"type":393,"tag":427,"props":2897,"children":2898},{"style":606},[2899],{"type":398,"value":655},{"type":393,"tag":427,"props":2901,"children":2902},{"style":439},[2903],{"type":398,"value":2904},"(monthly_summary)\n",{"type":393,"tag":427,"props":2906,"children":2907},{"class":429,"line":253},[2908,2912],{"type":393,"tag":427,"props":2909,"children":2910},{"style":606},[2911],{"type":398,"value":655},{"type":393,"tag":427,"props":2913,"children":2914},{"style":439},[2915],{"type":398,"value":725},{"type":393,"tag":427,"props":2917,"children":2918},{"class":429,"line":262},[2919],{"type":393,"tag":427,"props":2920,"children":2921},{"emptyLinePlaceholder":12},[2922],{"type":398,"value":482},{"type":393,"tag":427,"props":2924,"children":2925},{"class":429,"line":271},[2926],{"type":393,"tag":427,"props":2927,"children":2928},{"style":488},[2929],{"type":398,"value":2930},"# Calculate days since first transaction\n",{"type":393,"tag":427,"props":2932,"children":2933},{"class":429,"line":281},[2934,2939,2943,2947,2951],{"type":393,"tag":427,"props":2935,"children":2936},{"style":439},[2937],{"type":398,"value":2938},"first_date ",{"type":393,"tag":427,"props":2940,"children":2941},{"style":433},[2942],{"type":398,"value":504},{"type":393,"tag":427,"props":2944,"children":2945},{"style":439},[2946],{"type":398,"value":2753},{"type":393,"tag":427,"props":2948,"children":2949},{"style":515},[2950],{"type":398,"value":2643},{"type":393,"tag":427,"props":2952,"children":2953},{"style":439},[2954],{"type":398,"value":2955},"].min()\n",{"type":393,"tag":427,"props":2957,"children":2958},{"class":429,"line":290},[2959,2963,2968,2972,2976,2981,2985,2989,2994],{"type":393,"tag":427,"props":2960,"children":2961},{"style":439},[2962],{"type":398,"value":2638},{"type":393,"tag":427,"props":2964,"children":2965},{"style":515},[2966],{"type":398,"value":2967},"'days_since_start'",{"type":393,"tag":427,"props":2969,"children":2970},{"style":439},[2971],{"type":398,"value":757},{"type":393,"tag":427,"props":2973,"children":2974},{"style":433},[2975],{"type":398,"value":504},{"type":393,"tag":427,"props":2977,"children":2978},{"style":439},[2979],{"type":398,"value":2980}," (transactions[",{"type":393,"tag":427,"props":2982,"children":2983},{"style":515},[2984],{"type":398,"value":2643},{"type":393,"tag":427,"props":2986,"children":2987},{"style":439},[2988],{"type":398,"value":757},{"type":393,"tag":427,"props":2990,"children":2991},{"style":433},[2992],{"type":398,"value":2993},"-",{"type":393,"tag":427,"props":2995,"children":2996},{"style":439},[2997],{"type":398,"value":2998}," first_date).dt.days\n",{"type":393,"tag":427,"props":3000,"children":3001},{"class":429,"line":299},[3002],{"type":393,"tag":427,"props":3003,"children":3004},{"emptyLinePlaceholder":12},[3005],{"type":398,"value":482},{"type":393,"tag":427,"props":3007,"children":3008},{"class":429,"line":308},[3009,3013,3017,3022],{"type":393,"tag":427,"props":3010,"children":3011},{"style":606},[3012],{"type":398,"value":655},{"type":393,"tag":427,"props":3014,"children":3015},{"style":439},[3016],{"type":398,"value":660},{"type":393,"tag":427,"props":3018,"children":3019},{"style":515},[3020],{"type":398,"value":3021},"\"With days since start:\"",{"type":393,"tag":427,"props":3023,"children":3024},{"style":439},[3025],{"type":398,"value":670},{"type":393,"tag":427,"props":3027,"children":3028},{"class":429,"line":318},[3029,3033,3038,3042,3046,3050,3054,3058],{"type":393,"tag":427,"props":3030,"children":3031},{"style":606},[3032],{"type":398,"value":655},{"type":393,"tag":427,"props":3034,"children":3035},{"style":439},[3036],{"type":398,"value":3037},"(transactions[[",{"type":393,"tag":427,"props":3039,"children":3040},{"style":515},[3041],{"type":398,"value":2643},{"type":393,"tag":427,"props":3043,"children":3044},{"style":439},[3045],{"type":398,"value":533},{"type":393,"tag":427,"props":3047,"children":3048},{"style":515},[3049],{"type":398,"value":2807},{"type":393,"tag":427,"props":3051,"children":3052},{"style":439},[3053],{"type":398,"value":533},{"type":393,"tag":427,"props":3055,"children":3056},{"style":515},[3057],{"type":398,"value":2967},{"type":393,"tag":427,"props":3059,"children":3060},{"style":439},[3061],{"type":398,"value":1691},{"type":393,"tag":926,"props":3063,"children":3065},{"id":3064},"date-operation-categories",[3066],{"type":398,"value":3067},"🎯 Date Operation Categories",{"type":393,"tag":938,"props":3069,"children":3072},{"emoji":3070,"title":3071,"type":942},"🔧","Types of Date Operations",[3073,3081,3099,3107,3125,3133,3151,3159,3177,3185],{"type":393,"tag":401,"props":3074,"children":3075},{},[3076],{"type":393,"tag":948,"props":3077,"children":3078},{},[3079],{"type":398,"value":3080},"Conversion & Parsing:",{"type":393,"tag":954,"props":3082,"children":3083},{},[3084,3089,3094],{"type":393,"tag":958,"props":3085,"children":3086},{},[3087],{"type":398,"value":3088},"Convert strings to datetime objects",{"type":393,"tag":958,"props":3090,"children":3091},{},[3092],{"type":398,"value":3093},"Handle different date formats",{"type":393,"tag":958,"props":3095,"children":3096},{},[3097],{"type":398,"value":3098},"Deal with invalid or missing dates",{"type":393,"tag":401,"props":3100,"children":3101},{},[3102],{"type":393,"tag":948,"props":3103,"children":3104},{},[3105],{"type":398,"value":3106},"Extraction & Components:",{"type":393,"tag":954,"props":3108,"children":3109},{},[3110,3115,3120],{"type":393,"tag":958,"props":3111,"children":3112},{},[3113],{"type":398,"value":3114},"Get year, month, day, weekday",{"type":393,"tag":958,"props":3116,"children":3117},{},[3118],{"type":398,"value":3119},"Extract time components (hour, minute)",{"type":393,"tag":958,"props":3121,"children":3122},{},[3123],{"type":398,"value":3124},"Calculate date differences",{"type":393,"tag":401,"props":3126,"children":3127},{},[3128],{"type":393,"tag":948,"props":3129,"children":3130},{},[3131],{"type":398,"value":3132},"Filtering & Selection:",{"type":393,"tag":954,"props":3134,"children":3135},{},[3136,3141,3146],{"type":393,"tag":958,"props":3137,"children":3138},{},[3139],{"type":398,"value":3140},"Select data by date ranges",{"type":393,"tag":958,"props":3142,"children":3143},{},[3144],{"type":398,"value":3145},"Find records from specific periods",{"type":393,"tag":958,"props":3147,"children":3148},{},[3149],{"type":398,"value":3150},"Filter by day of week or month",{"type":393,"tag":401,"props":3152,"children":3153},{},[3154],{"type":393,"tag":948,"props":3155,"children":3156},{},[3157],{"type":398,"value":3158},"Aggregation & Grouping:",{"type":393,"tag":954,"props":3160,"children":3161},{},[3162,3167,3172],{"type":393,"tag":958,"props":3163,"children":3164},{},[3165],{"type":398,"value":3166},"Group by time periods (daily, monthly, yearly)",{"type":393,"tag":958,"props":3168,"children":3169},{},[3170],{"type":398,"value":3171},"Resample data to different frequencies",{"type":393,"tag":958,"props":3173,"children":3174},{},[3175],{"type":398,"value":3176},"Calculate rolling averages and trends",{"type":393,"tag":401,"props":3178,"children":3179},{},[3180],{"type":393,"tag":948,"props":3181,"children":3182},{},[3183],{"type":398,"value":3184},"Time Series Analysis:",{"type":393,"tag":954,"props":3186,"children":3187},{},[3188,3193,3198],{"type":393,"tag":958,"props":3189,"children":3190},{},[3191],{"type":398,"value":3192},"Analyze trends over time",{"type":393,"tag":958,"props":3194,"children":3195},{},[3196],{"type":398,"value":3197},"Seasonal pattern detection",{"type":393,"tag":958,"props":3199,"children":3200},{},[3201],{"type":398,"value":3202},"Forecasting and prediction",{"type":393,"tag":926,"props":3204,"children":3206},{"id":3205},"getting-started-with-dates",[3207],{"type":398,"value":3208},"🚀 Getting Started with Dates",{"type":393,"tag":401,"props":3210,"children":3211},{},[3212],{"type":398,"value":3213},"The key to working with dates effectively:",{"type":393,"tag":938,"props":3215,"children":3218},{"emoji":3216,"title":3217,"type":1123},"📋","Date Analysis Workflow",[3219,3227,3251,3259,3277,3285,3303,3311,3329],{"type":393,"tag":401,"props":3220,"children":3221},{},[3222],{"type":393,"tag":948,"props":3223,"children":3224},{},[3225],{"type":398,"value":3226},"Step 1: Convert to DateTime",{"type":393,"tag":954,"props":3228,"children":3229},{},[3230,3241,3246],{"type":393,"tag":958,"props":3231,"children":3232},{},[3233,3234,3239],{"type":398,"value":2338},{"type":393,"tag":423,"props":3235,"children":3237},{"className":3236},[],[3238],{"type":398,"value":1222},{"type":398,"value":3240}," for string dates",{"type":393,"tag":958,"props":3242,"children":3243},{},[3244],{"type":398,"value":3245},"Handle errors appropriately",{"type":393,"tag":958,"props":3247,"children":3248},{},[3249],{"type":398,"value":3250},"Verify conversion worked correctly",{"type":393,"tag":401,"props":3252,"children":3253},{},[3254],{"type":393,"tag":948,"props":3255,"children":3256},{},[3257],{"type":398,"value":3258},"Step 2: Extract Components",{"type":393,"tag":954,"props":3260,"children":3261},{},[3262,3267,3272],{"type":393,"tag":958,"props":3263,"children":3264},{},[3265],{"type":398,"value":3266},"Get relevant parts (year, month, quarter)",{"type":393,"tag":958,"props":3268,"children":3269},{},[3270],{"type":398,"value":3271},"Create categorical variables (weekday, season)",{"type":393,"tag":958,"props":3273,"children":3274},{},[3275],{"type":398,"value":3276},"Calculate derived metrics (age, duration)",{"type":393,"tag":401,"props":3278,"children":3279},{},[3280],{"type":393,"tag":948,"props":3281,"children":3282},{},[3283],{"type":398,"value":3284},"Step 3: Set Up Time Index",{"type":393,"tag":954,"props":3286,"children":3287},{},[3288,3293,3298],{"type":393,"tag":958,"props":3289,"children":3290},{},[3291],{"type":398,"value":3292},"Use datetime column as index when appropriate",{"type":393,"tag":958,"props":3294,"children":3295},{},[3296],{"type":398,"value":3297},"Enables powerful time series operations",{"type":393,"tag":958,"props":3299,"children":3300},{},[3301],{"type":398,"value":3302},"Makes filtering and resampling easier",{"type":393,"tag":401,"props":3304,"children":3305},{},[3306],{"type":393,"tag":948,"props":3307,"children":3308},{},[3309],{"type":398,"value":3310},"Step 4: Analyze Patterns",{"type":393,"tag":954,"props":3312,"children":3313},{},[3314,3319,3324],{"type":393,"tag":958,"props":3315,"children":3316},{},[3317],{"type":398,"value":3318},"Group by time periods",{"type":393,"tag":958,"props":3320,"children":3321},{},[3322],{"type":398,"value":3323},"Look for trends and seasonality",{"type":393,"tag":958,"props":3325,"children":3326},{},[3327],{"type":398,"value":3328},"Create time-based visualizations",{"type":393,"tag":401,"props":3330,"children":3331},{},[3332,3337],{"type":393,"tag":948,"props":3333,"children":3334},{},[3335],{"type":398,"value":3336},"Remember:",{"type":398,"value":3338}," Good date handling is the foundation of time series analysis!",{"type":393,"tag":926,"props":3340,"children":3342},{"id":3341},"whats-next",[3343],{"type":398,"value":3344},"🚀 What's Next?",{"type":393,"tag":401,"props":3346,"children":3347},{},[3348],{"type":398,"value":3349},"Ready to master date and time operations? Let's start with the fundamentals of converting and manipulating datetime data.",{"type":393,"tag":401,"props":3351,"children":3352},{},[3353,3358,3360],{"type":393,"tag":948,"props":3354,"children":3355},{},[3356],{"type":398,"value":3357},"Start with",{"type":398,"value":3359},": ",{"type":393,"tag":1091,"props":3361,"children":3362},{"href":342},[3363],{"type":398,"value":343},{"type":393,"tag":401,"props":3365,"children":3366},{},[3367],{"type":398,"value":3368},"Time to work with time! 📅⏰",{"type":393,"tag":3370,"props":3371,"children":3372},"style",{},[3373],{"type":398,"value":3374},"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":3376},[3377,3378,3379,3380,3381,3382,3383,3384,3385,3386],{"id":928,"depth":27,"text":931},{"id":1073,"depth":27,"text":1076},{"id":1110,"depth":27,"text":1113},{"id":1232,"depth":27,"text":1235},{"id":1807,"depth":27,"text":1810},{"id":2230,"depth":27,"text":2233},{"id":2375,"depth":27,"text":2378},{"id":3064,"depth":27,"text":3067},{"id":3205,"depth":27,"text":3208},{"id":3341,"depth":27,"text":3344},1782373726949]