[{"data":1,"prerenderedAt":4186},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/work-csv-files":601},[4,22,31,40,49,58,67,76,86,94,103,112,121,130,139,148,158,167,176,185,194,203,212,222,231,240,249,258,267,276,285,297,306,315,324,333,342,351,362,371,380,389,398,407,418,427,436,445,454,463,472,483,492,501,510,519,528,539,548,557,566,575,584,593],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"slug":11,"order":12,"isParent":13,"icon":14,"_type":15,"_id":16,"_source":17,"_file":18,"_stem":19,"_extension":20,"children":21,"expanded":13},"/python-how-to/string-manipulation","python-how-to",false,"","String Manipulation","Learn essential string manipulation techniques in Python","string-manipulation",1,true,"pi pi-folder","markdown","content:python-how-to:1.string-manipulation.md","content","python-how-to/1.string-manipulation.md","python-how-to/1.string-manipulation","md",[22,31,40,49,58,67],{"_path":23,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":15,"_id":28,"_source":17,"_file":29,"_stem":30,"_extension":20},"/python-how-to/split-join-strings","Split and Join Strings","Learn how to split strings into lists and join lists back into strings in Python","split-join-strings",2,"content:python-how-to:2.split-join-strings.md","python-how-to/2.split-join-strings.md","python-how-to/2.split-join-strings",{"_path":32,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":15,"_id":37,"_source":17,"_file":38,"_stem":39,"_extension":20},"/python-how-to/remove-whitespace","Remove Whitespace","Learn how to clean up and remove unwanted whitespace from strings in Python","remove-whitespace",3,"content:python-how-to:3.remove-whitespace.md","python-how-to/3.remove-whitespace.md","python-how-to/3.remove-whitespace",{"_path":41,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":15,"_id":46,"_source":17,"_file":47,"_stem":48,"_extension":20},"/python-how-to/find-replace-text","Find and Replace Text","Learn how to search for and replace text within strings in Python","find-replace-text",4,"content:python-how-to:4.find-replace-text.md","python-how-to/4.find-replace-text.md","python-how-to/4.find-replace-text",{"_path":50,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":15,"_id":55,"_source":17,"_file":56,"_stem":57,"_extension":20},"/python-how-to/check-string-content","Check String Content","Learn how to validate and check the content of strings in Python","check-string-content",5,"content:python-how-to:5.check-string-content.md","python-how-to/5.check-string-content.md","python-how-to/5.check-string-content",{"_path":59,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":15,"_id":64,"_source":17,"_file":65,"_stem":66,"_extension":20},"/python-how-to/format-strings","Format Strings","Learn how to format strings in Python using f-strings and format() method","format-strings",6,"content:python-how-to:6.format-strings.md","python-how-to/6.format-strings.md","python-how-to/6.format-strings",{"_path":68,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":69,"description":70,"slug":71,"parentId":5,"order":72,"_type":15,"_id":73,"_source":17,"_file":74,"_stem":75,"_extension":20},"/python-how-to/unicode-special-chars","Handle Unicode and Special Characters","Learn how to work with Unicode and special characters in Python strings","unicode-special-chars",7,"content:python-how-to:7.unicode-special-chars.md","python-how-to/7.unicode-special-chars.md","python-how-to/7.unicode-special-chars",{"_path":77,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":78,"description":79,"slug":80,"order":81,"isParent":13,"icon":14,"_type":15,"_id":82,"_source":17,"_file":83,"_stem":84,"_extension":20,"children":85,"expanded":13},"/python-how-to/list-operations","List Operations","Learn essential operations for working with lists in Python","list-operations",8,"content:python-how-to:8.list-operations.md","python-how-to/8.list-operations.md","python-how-to/8.list-operations",[86,94,103,112,121,130,139],{"_path":87,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":88,"description":89,"slug":90,"parentId":77,"order":81,"_type":15,"_id":91,"_source":17,"_file":92,"_stem":93,"_extension":20},"/python-how-to/sort-lists","Sort Lists","Learn how to sort lists in Python using different methods and custom sorting","sort-lists","content:python-how-to:9.sort-lists.md","python-how-to/9.sort-lists.md","python-how-to/9.sort-lists",{"_path":95,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":96,"description":97,"slug":98,"parentId":77,"order":99,"_type":15,"_id":100,"_source":17,"_file":101,"_stem":102,"_extension":20},"/python-how-to/remove-duplicates","Remove Duplicates","Learn how to remove duplicate elements from lists in Python","remove-duplicates",10,"content:python-how-to:10.remove-duplicates.md","python-how-to/10.remove-duplicates.md","python-how-to/10.remove-duplicates",{"_path":104,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":105,"description":106,"slug":107,"parentId":77,"order":108,"_type":15,"_id":109,"_source":17,"_file":110,"_stem":111,"_extension":20},"/python-how-to/filter-lists","Filter Lists","Learn how to filter lists in Python using different methods","filter-lists",11,"content:python-how-to:11.filter-lists.md","python-how-to/11.filter-lists.md","python-how-to/11.filter-lists",{"_path":113,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":114,"description":115,"slug":116,"parentId":77,"order":117,"_type":15,"_id":118,"_source":17,"_file":119,"_stem":120,"_extension":20},"/python-how-to/combine-lists","Combine Lists","Learn different methods to combine lists in Python","combine-lists",12,"content:python-how-to:12.combine-lists.md","python-how-to/12.combine-lists.md","python-how-to/12.combine-lists",{"_path":122,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":123,"description":124,"slug":125,"parentId":77,"order":126,"_type":15,"_id":127,"_source":17,"_file":128,"_stem":129,"_extension":20},"/python-how-to/list-comprehensions","Use List Comprehensions","Learn how to create and transform lists efficiently using Python's list comprehension syntax","list-comprehensions",13,"content:python-how-to:13.list-comprehensions.md","python-how-to/13.list-comprehensions.md","python-how-to/13.list-comprehensions",{"_path":131,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":132,"description":133,"slug":134,"parentId":77,"order":135,"_type":15,"_id":136,"_source":17,"_file":137,"_stem":138,"_extension":20},"/python-how-to/nested-lists","Work with Nested Lists","Learn how to work with nested lists (2D arrays) in Python","nested-lists",14,"content:python-how-to:14.nested-lists.md","python-how-to/14.nested-lists.md","python-how-to/14.nested-lists",{"_path":140,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":141,"description":142,"slug":143,"parentId":77,"order":144,"_type":15,"_id":145,"_source":17,"_file":146,"_stem":147,"_extension":20},"/python-how-to/enumerate-zip","Use enumerate() and zip()","Learn how to use enumerate() and zip() for efficient iteration in Python","enumerate-zip",15,"content:python-how-to:15.enumerate-zip.md","python-how-to/15.enumerate-zip.md","python-how-to/15.enumerate-zip",{"_path":149,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":150,"description":151,"slug":152,"order":153,"isParent":13,"icon":14,"_type":15,"_id":154,"_source":17,"_file":155,"_stem":156,"_extension":20,"children":157,"expanded":13},"/python-how-to/dictionary-operations","Dictionary Operations","Learn essential operations for working with dictionaries in Python","dictionary-operations",16,"content:python-how-to:16.dictionary-operations.md","python-how-to/16.dictionary-operations.md","python-how-to/16.dictionary-operations",[158,167,176,185,194,203],{"_path":159,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":160,"description":161,"slug":162,"parentId":149,"order":163,"_type":15,"_id":164,"_source":17,"_file":165,"_stem":166,"_extension":20},"/python-how-to/merge-dictionaries","Merge Dictionaries","Learn different methods to merge dictionaries in Python","merge-dictionaries",17,"content:python-how-to:17.merge-dictionaries.md","python-how-to/17.merge-dictionaries.md","python-how-to/17.merge-dictionaries",{"_path":168,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":169,"description":170,"slug":171,"parentId":149,"order":172,"_type":15,"_id":173,"_source":17,"_file":174,"_stem":175,"_extension":20},"/python-how-to/sort-dictionaries","Sort Dictionaries","Learn how to sort dictionaries by keys or values in Python","sort-dictionaries",18,"content:python-how-to:18.sort-dictionaries.md","python-how-to/18.sort-dictionaries.md","python-how-to/18.sort-dictionaries",{"_path":177,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":178,"description":179,"slug":180,"parentId":149,"order":181,"_type":15,"_id":182,"_source":17,"_file":183,"_stem":184,"_extension":20},"/python-how-to/filter-dictionaries","Filter Dictionaries","Learn how to filter dictionaries based on keys or values in Python","filter-dictionaries",19,"content:python-how-to:19.filter-dictionaries.md","python-how-to/19.filter-dictionaries.md","python-how-to/19.filter-dictionaries",{"_path":186,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":187,"description":188,"slug":189,"parentId":149,"order":190,"_type":15,"_id":191,"_source":17,"_file":192,"_stem":193,"_extension":20},"/python-how-to/handle-missing-keys","Handle Missing Keys","Learn safe ways to access dictionary keys and handle missing values","handle-missing-keys",20,"content:python-how-to:20.handle-missing-keys.md","python-how-to/20.handle-missing-keys.md","python-how-to/20.handle-missing-keys",{"_path":195,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":196,"description":197,"slug":198,"parentId":149,"order":199,"_type":15,"_id":200,"_source":17,"_file":201,"_stem":202,"_extension":20},"/python-how-to/dictionary-comprehensions","Use Dictionary Comprehensions","Learn how to create dictionaries efficiently using comprehensions","dictionary-comprehensions",21,"content:python-how-to:21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions",{"_path":204,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":205,"description":206,"slug":207,"parentId":149,"order":208,"_type":15,"_id":209,"_source":17,"_file":210,"_stem":211,"_extension":20},"/python-how-to/convert-lists-dictionaries","Convert Between Lists and Dictionaries","Learn how to transform data between lists and dictionaries in Python","convert-lists-dictionaries",22,"content:python-how-to:22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries",{"_path":213,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":214,"description":215,"slug":216,"order":217,"isParent":13,"icon":14,"_type":15,"_id":218,"_source":17,"_file":219,"_stem":220,"_extension":20,"children":221,"expanded":13},"/python-how-to/file-operations","File Operations","Learn essential file operations in Python for reading, writing, and managing files","file-operations",23,"content:python-how-to:23.file-operations.md","python-how-to/23.file-operations.md","python-how-to/23.file-operations",[222,231,240,249,258,267,276],{"_path":223,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":224,"description":225,"slug":226,"parentId":213,"order":227,"_type":15,"_id":228,"_source":17,"_file":229,"_stem":230,"_extension":20},"/python-how-to/read-text-files","Read Text Files","Learn how to read text files in Python using different methods","read-text-files",24,"content:python-how-to:24.read-text-files.md","python-how-to/24.read-text-files.md","python-how-to/24.read-text-files",{"_path":232,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":233,"description":234,"slug":235,"parentId":213,"order":236,"_type":15,"_id":237,"_source":17,"_file":238,"_stem":239,"_extension":20},"/python-how-to/write-to-files","Write to Files","Learn how to write and create files in Python using different methods","write-to-files",25,"content:python-how-to:25.write-to-files.md","python-how-to/25.write-to-files.md","python-how-to/25.write-to-files",{"_path":241,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":242,"description":243,"slug":244,"parentId":213,"order":245,"_type":15,"_id":246,"_source":17,"_file":247,"_stem":248,"_extension":20},"/python-how-to/work-csv-files","Work with CSV Files","Learn how to read and write CSV files in Python using the csv module","work-csv-files",26,"content:python-how-to:26.work-csv-files.md","python-how-to/26.work-csv-files.md","python-how-to/26.work-csv-files",{"_path":250,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":251,"description":252,"slug":253,"parentId":213,"order":254,"_type":15,"_id":255,"_source":17,"_file":256,"_stem":257,"_extension":20},"/python-how-to/handle-file-paths","Handle File Paths","Learn how to work with file and directory paths in Python using pathlib and os modules","handle-file-paths",27,"content:python-how-to:27.handle-file-paths.md","python-how-to/27.handle-file-paths.md","python-how-to/27.handle-file-paths",{"_path":259,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":260,"description":261,"slug":262,"parentId":213,"order":263,"_type":15,"_id":264,"_source":17,"_file":265,"_stem":266,"_extension":20},"/python-how-to/work-json-files","Work with JSON Files","Learn how to read and write JSON files in Python using the json module","work-json-files",28,"content:python-how-to:28.work-json-files.md","python-how-to/28.work-json-files.md","python-how-to/28.work-json-files",{"_path":268,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":269,"description":270,"slug":271,"parentId":213,"order":272,"_type":15,"_id":273,"_source":17,"_file":274,"_stem":275,"_extension":20},"/python-how-to/handle-binary-files","Handle Binary Files","Learn how to work with binary files in Python for images, data, and other non-text content","handle-binary-files",29,"content:python-how-to:29.handle-binary-files.md","python-how-to/29.handle-binary-files.md","python-how-to/29.handle-binary-files",{"_path":277,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":278,"description":279,"slug":280,"parentId":213,"order":281,"_type":15,"_id":282,"_source":17,"_file":283,"_stem":284,"_extension":20},"/python-how-to/use-context-managers","Use Context Managers","Learn how to use context managers for safe resource handling in Python","use-context-managers",30,"content:python-how-to:30.use-context-managers.md","python-how-to/30.use-context-managers.md","python-how-to/30.use-context-managers",{"_path":286,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":287,"description":288,"slug":289,"parentId":290,"order":291,"isParent":13,"icon":292,"_type":15,"_id":293,"_source":17,"_file":294,"_stem":295,"_extension":20,"children":296},"/python-how-to/date-and-time","Date and Time","Master Python's date and time handling with datetime, time zones, formatting, and calculations","date-and-time","/python-how-to",31,"pi pi-calendar","content:python-how-to:31.date-and-time.md","python-how-to/31.date-and-time.md","python-how-to/31.date-and-time",[297,306,315,324,333,342],{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":286,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python-how-to/get-current-datetime","Get Current Date/Time","Learn how to get current date, time, and timestamps using Python's datetime module","get-current-datetime",32,"content:python-how-to:32.get-current-datetime.md","python-how-to/32.get-current-datetime.md","python-how-to/32.get-current-datetime",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":286,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python-how-to/format-dates","Format Dates","Master date formatting with strftime, custom formats, and locale-aware formatting for user-friendly displays","format-dates",33,"content:python-how-to:33.format-dates.md","python-how-to/33.format-dates.md","python-how-to/33.format-dates",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":286,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python-how-to/calculate-date-differences","Calculate Date Differences","Learn to calculate time differences, durations, and intervals using Python's timedelta for scheduling and analytics","calculate-date-differences",34,"content:python-how-to:34.calculate-date-differences.md","python-how-to/34.calculate-date-differences.md","python-how-to/34.calculate-date-differences",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":286,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python-how-to/parse-date-strings","Parse Date Strings","Convert text dates into Python datetime objects using strptime, handle multiple formats, and validate date input","parse-date-strings",35,"content:python-how-to:35.parse-date-strings.md","python-how-to/35.parse-date-strings.md","python-how-to/35.parse-date-strings",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":286,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python-how-to/handle-timezones","Handle Timezones","Master timezone handling with zoneinfo, UTC conversions, and timezone-aware datetime objects for global applications","handle-timezones",36,"content:python-how-to:36.handle-timezones.md","python-how-to/36.handle-timezones.md","python-how-to/36.handle-timezones",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":286,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python-how-to/work-with-timestamps","Work with Timestamps","Master Unix timestamps in Python - convert between datetime objects and timestamps for APIs, databases, and system integration","work-with-timestamps",37,"content:python-how-to:37.work-with-timestamps.md","python-how-to/37.work-with-timestamps.md","python-how-to/37.work-with-timestamps",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":290,"order":356,"isParent":13,"icon":357,"_type":15,"_id":358,"_source":17,"_file":359,"_stem":360,"_extension":20,"children":361},"/python-how-to/error-handling","Error Handling","Learn Python's error handling with try/except, custom exceptions, debugging, logging, and retry logic for robust applications","error-handling",38,"pi pi-exclamation-triangle","content:python-how-to:38.error-handling.md","python-how-to/38.error-handling.md","python-how-to/38.error-handling",[362,371,380,389,398],{"_path":363,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":364,"description":365,"slug":366,"parentId":352,"order":367,"_type":15,"_id":368,"_source":17,"_file":369,"_stem":370,"_extension":20},"/python-how-to/handle-exceptions","Handle Exceptions","Master try/except blocks, multiple exception handling, and finally clauses for robust error handling in Python","handle-exceptions",39,"content:python-how-to:39.handle-exceptions.md","python-how-to/39.handle-exceptions.md","python-how-to/39.handle-exceptions",{"_path":372,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":373,"description":374,"slug":375,"parentId":352,"order":376,"_type":15,"_id":377,"_source":17,"_file":378,"_stem":379,"_extension":20},"/python-how-to/create-custom-exceptions","Create Custom Exceptions","Learn to create custom exception classes in Python for specific error handling and better code organization","create-custom-exceptions",40,"content:python-how-to:40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions",{"_path":381,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":382,"description":383,"slug":384,"parentId":352,"order":385,"_type":15,"_id":386,"_source":17,"_file":387,"_stem":388,"_extension":20},"/python-how-to/debug-code","Debug Code","Learn Python debugging techniques using print statements, the debugger, and tools to find and fix code issues","debug-code",41,"content:python-how-to:41.debug-code.md","python-how-to/41.debug-code.md","python-how-to/41.debug-code",{"_path":390,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":391,"description":392,"slug":393,"parentId":352,"order":394,"_type":15,"_id":395,"_source":17,"_file":396,"_stem":397,"_extension":20},"/python-how-to/use-logging","Use Logging","Learn Python's logging module for tracking application behavior, errors, and debugging information","use-logging",42,"content:python-how-to:42.use-logging.md","python-how-to/42.use-logging.md","python-how-to/42.use-logging",{"_path":399,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":400,"description":401,"slug":402,"parentId":352,"order":403,"_type":15,"_id":404,"_source":17,"_file":405,"_stem":406,"_extension":20},"/python-how-to/implement-retry-logic","Implement Retry Logic","Learn to implement retry mechanisms in Python for handling temporary failures and building resilient applications","implement-retry-logic",43,"content:python-how-to:43.implement-retry-logic.md","python-how-to/43.implement-retry-logic.md","python-how-to/43.implement-retry-logic",{"_path":408,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":409,"description":410,"slug":411,"parentId":290,"order":412,"isParent":13,"icon":413,"_type":15,"_id":414,"_source":17,"_file":415,"_stem":416,"_extension":20,"children":417},"/python-how-to/functions-and-modules","Functions and Modules","Learn Python functions, modules, and code organization for building reusable, maintainable applications","functions-and-modules",44,"pi pi-box","content:python-how-to:44.functions-and-modules.md","python-how-to/44.functions-and-modules.md","python-how-to/44.functions-and-modules",[418,427,436,445,454,463],{"_path":419,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":420,"description":421,"slug":422,"parentId":408,"order":423,"_type":15,"_id":424,"_source":17,"_file":425,"_stem":426,"_extension":20},"/python-how-to/write-functions","Write Functions","Learn to create Python functions with parameters, return values, and documentation for reusable code","write-functions",45,"content:python-how-to:45.write-functions.md","python-how-to/45.write-functions.md","python-how-to/45.write-functions",{"_path":428,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":429,"description":430,"slug":431,"parentId":408,"order":432,"_type":15,"_id":433,"_source":17,"_file":434,"_stem":435,"_extension":20},"/python-how-to/use-args-kwargs","Use *args and **kwargs","Learn to use *args and **kwargs for flexible function arguments in Python","use-args-kwargs",46,"content:python-how-to:46.use-args-kwargs.md","python-how-to/46.use-args-kwargs.md","python-how-to/46.use-args-kwargs",{"_path":437,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":438,"description":439,"slug":440,"parentId":408,"order":441,"_type":15,"_id":442,"_source":17,"_file":443,"_stem":444,"_extension":20},"/python-how-to/create-decorators","Create Decorators","Learn to create and use Python decorators to enhance function behavior and add functionality","create-decorators",47,"content:python-how-to:47.create-decorators.md","python-how-to/47.create-decorators.md","python-how-to/47.create-decorators",{"_path":446,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":447,"description":448,"slug":449,"parentId":408,"order":450,"_type":15,"_id":451,"_source":17,"_file":452,"_stem":453,"_extension":20},"/python-how-to/use-generators","Use Generators","Learn to create memory-efficient generators with yield for processing large datasets and sequences","use-generators",48,"content:python-how-to:48.use-generators.md","python-how-to/48.use-generators.md","python-how-to/48.use-generators",{"_path":455,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":456,"description":457,"slug":458,"parentId":408,"order":459,"_type":15,"_id":460,"_source":17,"_file":461,"_stem":462,"_extension":20},"/python-how-to/work-modules-packages","Work with Modules and Packages","Learn to organize Python code with modules and packages, and use imports effectively","work-modules-packages",49,"content:python-how-to:49.work-modules-packages.md","python-how-to/49.work-modules-packages.md","python-how-to/49.work-modules-packages",{"_path":464,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":465,"description":466,"slug":467,"parentId":408,"order":468,"_type":15,"_id":469,"_source":17,"_file":470,"_stem":471,"_extension":20},"/python-how-to/create-virtual-environments","Create Virtual Environments","Learn to create and manage Python virtual environments for project dependency isolation","create-virtual-environments",50,"content:python-how-to:50.create-virtual-environments.md","python-how-to/50.create-virtual-environments.md","python-how-to/50.create-virtual-environments",{"_path":473,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":474,"description":475,"slug":476,"parentId":290,"order":477,"isParent":13,"icon":478,"_type":15,"_id":479,"_source":17,"_file":480,"_stem":481,"_extension":20,"children":482},"/python-how-to/data-processing","Data Processing","Learn Python data processing techniques including regex, APIs, databases, and large file handling","data-processing",51,"pi pi-database","content:python-how-to:51.data-processing.md","python-how-to/51.data-processing.md","python-how-to/51.data-processing",[483,492,501,510,519],{"_path":484,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":485,"description":486,"slug":487,"parentId":473,"order":488,"_type":15,"_id":489,"_source":17,"_file":490,"_stem":491,"_extension":20},"/python-how-to/work-regular-expressions","Work with Regular Expressions","Learn to use Python's re module for pattern matching, text extraction, and data validation","work-regular-expressions",52,"content:python-how-to:52.work-regular-expressions.md","python-how-to/52.work-regular-expressions.md","python-how-to/52.work-regular-expressions",{"_path":493,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":494,"description":495,"slug":496,"parentId":473,"order":497,"_type":15,"_id":498,"_source":17,"_file":499,"_stem":500,"_extension":20},"/python-how-to/parse-xml-html","Parse XML and HTML","Learn to extract data from XML and HTML documents using Python's built-in parsing tools","parse-xml-html",53,"content:python-how-to:53.parse-xml-html.md","python-how-to/53.parse-xml-html.md","python-how-to/53.parse-xml-html",{"_path":502,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":503,"description":504,"slug":505,"parentId":473,"order":506,"_type":15,"_id":507,"_source":17,"_file":508,"_stem":509,"_extension":20},"/python-how-to/handle-api-requests","Handle API Requests","Learn to fetch and process data from web APIs using Python's urllib and external requests library","handle-api-requests",54,"content:python-how-to:54.handle-api-requests.md","python-how-to/54.handle-api-requests.md","python-how-to/54.handle-api-requests",{"_path":511,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":512,"description":513,"slug":514,"parentId":473,"order":515,"_type":15,"_id":516,"_source":17,"_file":517,"_stem":518,"_extension":20},"/python-how-to/work-databases","Work with Databases","Learn to connect to and query SQL databases using Python's sqlite3 and database techniques","work-databases",55,"content:python-how-to:55.work-databases.md","python-how-to/55.work-databases.md","python-how-to/55.work-databases",{"_path":520,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":521,"description":522,"slug":523,"parentId":473,"order":524,"_type":15,"_id":525,"_source":17,"_file":526,"_stem":527,"_extension":20},"/python-how-to/process-large-files","Process Large Files","Learn memory-efficient techniques for handling large files and datasets in Python","process-large-files",56,"content:python-how-to:56.process-large-files.md","python-how-to/56.process-large-files.md","python-how-to/56.process-large-files",{"_path":529,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":530,"description":531,"slug":532,"parentId":290,"order":533,"isParent":13,"icon":534,"_type":15,"_id":535,"_source":17,"_file":536,"_stem":537,"_extension":20,"children":538},"/python-how-to/best-practices","Best Practices","Learn Python best practices for writing clean, maintainable, and efficient code","best-practices",57,"pi pi-star","content:python-how-to:57.best-practices.md","python-how-to/57.best-practices.md","python-how-to/57.best-practices",[539,548,557,566,575,584],{"_path":540,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":541,"description":542,"slug":543,"parentId":529,"order":544,"_type":15,"_id":545,"_source":17,"_file":546,"_stem":547,"_extension":20},"/python-how-to/structure-code","Structure Your Code","Learn to organize Python code with proper module structure, functions, and classes","structure-code",58,"content:python-how-to:58.structure-code.md","python-how-to/58.structure-code.md","python-how-to/58.structure-code",{"_path":549,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":550,"description":551,"slug":552,"parentId":529,"order":553,"_type":15,"_id":554,"_source":17,"_file":555,"_stem":556,"_extension":20},"/python-how-to/write-clean-code","Write Clean Code","Learn to write readable, maintainable Python code with proper naming, comments, and clear logic","write-clean-code",59,"content:python-how-to:59.write-clean-code.md","python-how-to/59.write-clean-code.md","python-how-to/59.write-clean-code",{"_path":558,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":559,"description":560,"slug":561,"parentId":529,"order":562,"_type":15,"_id":563,"_source":17,"_file":564,"_stem":565,"_extension":20},"/python-how-to/optimize-performance","Optimize Performance","Learn to identify and fix performance bottlenecks in Python code for faster execution","optimize-performance",60,"content:python-how-to:60.optimize-performance.md","python-how-to/60.optimize-performance.md","python-how-to/60.optimize-performance",{"_path":567,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":568,"description":569,"slug":570,"parentId":529,"order":571,"_type":15,"_id":572,"_source":17,"_file":573,"_stem":574,"_extension":20},"/python-how-to/write-unit-tests","Write Unit Tests","Learn to create reliable unit tests to verify your Python code works correctly and catch bugs early","write-unit-tests",61,"content:python-how-to:61.write-unit-tests.md","python-how-to/61.write-unit-tests.md","python-how-to/61.write-unit-tests",{"_path":576,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":577,"description":578,"slug":579,"parentId":529,"order":580,"_type":15,"_id":581,"_source":17,"_file":582,"_stem":583,"_extension":20},"/python-how-to/document-code","Document Your Code","Learn to write clear documentation and helpful comments for your Python code","document-code",62,"content:python-how-to:62.document-code.md","python-how-to/62.document-code.md","python-how-to/62.document-code",{"_path":585,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":586,"description":587,"slug":588,"parentId":529,"order":589,"_type":15,"_id":590,"_source":17,"_file":591,"_stem":592,"_extension":20},"/python-how-to/use-type-hints","Use Type Hints","Learn to add type annotations to Python code for better clarity, tooling support, and error detection","use-type-hints",63,"content:python-how-to:63.use-type-hints.md","python-how-to/63.use-type-hints.md","python-how-to/63.use-type-hints",{"_path":290,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":594,"description":595,"slug":6,"order":596,"icon":14,"_type":15,"_id":597,"_source":17,"_file":598,"_stem":599,"_extension":20},"Python How-To Guide","Practical Python tutorials for common programming tasks. Learn step-by-step solutions for string manipulation, file operations, data processing, and more with real-world examples.",0,"content:python-how-to:index.md","python-how-to/index.md","python-how-to/index",[240],{"_path":241,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":242,"description":243,"slug":244,"parentId":213,"order":245,"body":602,"_type":15,"_id":246,"_source":17,"_file":247,"_stem":248,"_extension":20},{"type":603,"children":604,"toc":4172},"root",[605,614,629,797,804,809,911,918,1211,1439,1445,1754,2153,2159,2164,2170,2572,2578,2987,2993,3446,3452,3812,3818,4019,4025,4166],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"working-with-csv-files",[611],{"type":612,"value":613},"text","📊 Working with CSV Files",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618,620,627],{"type":612,"value":619},"CSV (Comma-Separated Values) files are a common format for data exchange. Python's ",{"type":606,"tag":621,"props":622,"children":624},"code",{"className":623},[],[625],{"type":612,"value":626},"csv",{"type":612,"value":628}," module provides powerful tools for reading and writing CSV data.",{"type":606,"tag":630,"props":631,"children":632},"code-try",{},[633],{"type":606,"tag":634,"props":635,"children":639},"pre",{"className":636,"code":637,"language":638,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","import csv\n\n# Basic CSV reading\nwith open('data.csv', 'r') as file:\n    reader = csv.reader(file)\n    for row in reader:\n        print(row)\n","python",[640],{"type":606,"tag":621,"props":641,"children":642},{"__ignoreMap":8},[643,660,668,677,733,761,784],{"type":606,"tag":644,"props":645,"children":647},"span",{"class":646,"line":12},"line",[648,654],{"type":606,"tag":644,"props":649,"children":651},{"style":650},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[652],{"type":612,"value":653},"import",{"type":606,"tag":644,"props":655,"children":657},{"style":656},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[658],{"type":612,"value":659}," csv\n",{"type":606,"tag":644,"props":661,"children":662},{"class":646,"line":27},[663],{"type":606,"tag":644,"props":664,"children":665},{"emptyLinePlaceholder":13},[666],{"type":612,"value":667},"\n",{"type":606,"tag":644,"props":669,"children":670},{"class":646,"line":36},[671],{"type":606,"tag":644,"props":672,"children":674},{"style":673},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[675],{"type":612,"value":676},"# Basic CSV reading\n",{"type":606,"tag":644,"props":678,"children":679},{"class":646,"line":45},[680,685,691,696,702,707,712,717,722,728],{"type":606,"tag":644,"props":681,"children":682},{"style":650},[683],{"type":612,"value":684},"with",{"type":606,"tag":644,"props":686,"children":688},{"style":687},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[689],{"type":612,"value":690}," open",{"type":606,"tag":644,"props":692,"children":693},{"style":656},[694],{"type":612,"value":695},"(",{"type":606,"tag":644,"props":697,"children":699},{"style":698},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[700],{"type":612,"value":701},"'data.csv'",{"type":606,"tag":644,"props":703,"children":704},{"style":656},[705],{"type":612,"value":706},", ",{"type":606,"tag":644,"props":708,"children":709},{"style":698},[710],{"type":612,"value":711},"'r'",{"type":606,"tag":644,"props":713,"children":714},{"style":656},[715],{"type":612,"value":716},") ",{"type":606,"tag":644,"props":718,"children":719},{"style":650},[720],{"type":612,"value":721},"as",{"type":606,"tag":644,"props":723,"children":725},{"style":724},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[726],{"type":612,"value":727}," file",{"type":606,"tag":644,"props":729,"children":730},{"style":656},[731],{"type":612,"value":732},":\n",{"type":606,"tag":644,"props":734,"children":735},{"class":646,"line":54},[736,741,746,751,756],{"type":606,"tag":644,"props":737,"children":738},{"style":656},[739],{"type":612,"value":740},"    reader ",{"type":606,"tag":644,"props":742,"children":743},{"style":650},[744],{"type":612,"value":745},"=",{"type":606,"tag":644,"props":747,"children":748},{"style":656},[749],{"type":612,"value":750}," csv.reader(",{"type":606,"tag":644,"props":752,"children":753},{"style":724},[754],{"type":612,"value":755},"file",{"type":606,"tag":644,"props":757,"children":758},{"style":656},[759],{"type":612,"value":760},")\n",{"type":606,"tag":644,"props":762,"children":763},{"class":646,"line":63},[764,769,774,779],{"type":606,"tag":644,"props":765,"children":766},{"style":650},[767],{"type":612,"value":768},"    for",{"type":606,"tag":644,"props":770,"children":771},{"style":656},[772],{"type":612,"value":773}," row ",{"type":606,"tag":644,"props":775,"children":776},{"style":650},[777],{"type":612,"value":778},"in",{"type":606,"tag":644,"props":780,"children":781},{"style":656},[782],{"type":612,"value":783}," reader:\n",{"type":606,"tag":644,"props":785,"children":786},{"class":646,"line":72},[787,792],{"type":606,"tag":644,"props":788,"children":789},{"style":687},[790],{"type":612,"value":791},"        print",{"type":606,"tag":644,"props":793,"children":794},{"style":656},[795],{"type":612,"value":796},"(row)\n",{"type":606,"tag":798,"props":799,"children":801},"h2",{"id":800},"csv-operations",[802],{"type":612,"value":803},"🎯 CSV Operations",{"type":606,"tag":615,"props":805,"children":806},{},[807],{"type":612,"value":808},"Python offers several approaches to work with CSV files.",{"type":606,"tag":810,"props":811,"children":815},"info-box",{"emoji":812,"title":813,"type":814},"📝","CSV Module Features","info",[816,825,852,860,885,893],{"type":606,"tag":615,"props":817,"children":818},{},[819],{"type":606,"tag":820,"props":821,"children":822},"strong",{},[823],{"type":612,"value":824},"Reader Classes:",{"type":606,"tag":826,"props":827,"children":828},"ul",{},[829,841],{"type":606,"tag":830,"props":831,"children":832},"li",{},[833,839],{"type":606,"tag":621,"props":834,"children":836},{"className":835},[],[837],{"type":612,"value":838},"csv.reader()",{"type":612,"value":840},": Read as lists",{"type":606,"tag":830,"props":842,"children":843},{},[844,850],{"type":606,"tag":621,"props":845,"children":847},{"className":846},[],[848],{"type":612,"value":849},"csv.DictReader()",{"type":612,"value":851},": Read as dictionaries",{"type":606,"tag":615,"props":853,"children":854},{},[855],{"type":606,"tag":820,"props":856,"children":857},{},[858],{"type":612,"value":859},"Writer Classes:",{"type":606,"tag":826,"props":861,"children":862},{},[863,874],{"type":606,"tag":830,"props":864,"children":865},{},[866,872],{"type":606,"tag":621,"props":867,"children":869},{"className":868},[],[870],{"type":612,"value":871},"csv.writer()",{"type":612,"value":873},": Write lists",{"type":606,"tag":830,"props":875,"children":876},{},[877,883],{"type":606,"tag":621,"props":878,"children":880},{"className":879},[],[881],{"type":612,"value":882},"csv.DictWriter()",{"type":612,"value":884},": Write dictionaries",{"type":606,"tag":615,"props":886,"children":887},{},[888],{"type":606,"tag":820,"props":889,"children":890},{},[891],{"type":612,"value":892},"Key Features:",{"type":606,"tag":826,"props":894,"children":895},{},[896,901,906],{"type":606,"tag":830,"props":897,"children":898},{},[899],{"type":612,"value":900},"Automatic delimiter detection",{"type":606,"tag":830,"props":902,"children":903},{},[904],{"type":612,"value":905},"Custom delimiters and quoting",{"type":606,"tag":830,"props":907,"children":908},{},[909],{"type":612,"value":910},"Header row handling",{"type":606,"tag":912,"props":913,"children":915},"h3",{"id":914},"reading-csv-files",[916],{"type":612,"value":917},"Reading CSV Files",{"type":606,"tag":630,"props":919,"children":920},{},[921],{"type":606,"tag":634,"props":922,"children":924},{"className":636,"code":923,"language":638,"meta":8,"style":8},"import csv\n\n# Reading CSV as lists\nprint(\"Reading as lists:\")\nwith open('students.csv', 'r') as file:\n    reader = csv.reader(file)\n    header = next(reader)  # Get header row\n    print(f\"Header: {header}\")\n    \n    for row in reader:\n        print(f\"Row: {row}\")\n\nprint(\"CSV reading as lists completed\")\n",[925],{"type":606,"tag":621,"props":926,"children":927},{"__ignoreMap":8},[928,939,946,954,975,1019,1042,1069,1115,1124,1143,1184,1191],{"type":606,"tag":644,"props":929,"children":930},{"class":646,"line":12},[931,935],{"type":606,"tag":644,"props":932,"children":933},{"style":650},[934],{"type":612,"value":653},{"type":606,"tag":644,"props":936,"children":937},{"style":656},[938],{"type":612,"value":659},{"type":606,"tag":644,"props":940,"children":941},{"class":646,"line":27},[942],{"type":606,"tag":644,"props":943,"children":944},{"emptyLinePlaceholder":13},[945],{"type":612,"value":667},{"type":606,"tag":644,"props":947,"children":948},{"class":646,"line":36},[949],{"type":606,"tag":644,"props":950,"children":951},{"style":673},[952],{"type":612,"value":953},"# Reading CSV as lists\n",{"type":606,"tag":644,"props":955,"children":956},{"class":646,"line":45},[957,962,966,971],{"type":606,"tag":644,"props":958,"children":959},{"style":687},[960],{"type":612,"value":961},"print",{"type":606,"tag":644,"props":963,"children":964},{"style":656},[965],{"type":612,"value":695},{"type":606,"tag":644,"props":967,"children":968},{"style":698},[969],{"type":612,"value":970},"\"Reading as lists:\"",{"type":606,"tag":644,"props":972,"children":973},{"style":656},[974],{"type":612,"value":760},{"type":606,"tag":644,"props":976,"children":977},{"class":646,"line":54},[978,982,986,990,995,999,1003,1007,1011,1015],{"type":606,"tag":644,"props":979,"children":980},{"style":650},[981],{"type":612,"value":684},{"type":606,"tag":644,"props":983,"children":984},{"style":687},[985],{"type":612,"value":690},{"type":606,"tag":644,"props":987,"children":988},{"style":656},[989],{"type":612,"value":695},{"type":606,"tag":644,"props":991,"children":992},{"style":698},[993],{"type":612,"value":994},"'students.csv'",{"type":606,"tag":644,"props":996,"children":997},{"style":656},[998],{"type":612,"value":706},{"type":606,"tag":644,"props":1000,"children":1001},{"style":698},[1002],{"type":612,"value":711},{"type":606,"tag":644,"props":1004,"children":1005},{"style":656},[1006],{"type":612,"value":716},{"type":606,"tag":644,"props":1008,"children":1009},{"style":650},[1010],{"type":612,"value":721},{"type":606,"tag":644,"props":1012,"children":1013},{"style":724},[1014],{"type":612,"value":727},{"type":606,"tag":644,"props":1016,"children":1017},{"style":656},[1018],{"type":612,"value":732},{"type":606,"tag":644,"props":1020,"children":1021},{"class":646,"line":63},[1022,1026,1030,1034,1038],{"type":606,"tag":644,"props":1023,"children":1024},{"style":656},[1025],{"type":612,"value":740},{"type":606,"tag":644,"props":1027,"children":1028},{"style":650},[1029],{"type":612,"value":745},{"type":606,"tag":644,"props":1031,"children":1032},{"style":656},[1033],{"type":612,"value":750},{"type":606,"tag":644,"props":1035,"children":1036},{"style":724},[1037],{"type":612,"value":755},{"type":606,"tag":644,"props":1039,"children":1040},{"style":656},[1041],{"type":612,"value":760},{"type":606,"tag":644,"props":1043,"children":1044},{"class":646,"line":72},[1045,1050,1054,1059,1064],{"type":606,"tag":644,"props":1046,"children":1047},{"style":656},[1048],{"type":612,"value":1049},"    header ",{"type":606,"tag":644,"props":1051,"children":1052},{"style":650},[1053],{"type":612,"value":745},{"type":606,"tag":644,"props":1055,"children":1056},{"style":687},[1057],{"type":612,"value":1058}," next",{"type":606,"tag":644,"props":1060,"children":1061},{"style":656},[1062],{"type":612,"value":1063},"(reader)  ",{"type":606,"tag":644,"props":1065,"children":1066},{"style":673},[1067],{"type":612,"value":1068},"# Get header row\n",{"type":606,"tag":644,"props":1070,"children":1071},{"class":646,"line":81},[1072,1077,1081,1086,1091,1096,1101,1106,1111],{"type":606,"tag":644,"props":1073,"children":1074},{"style":687},[1075],{"type":612,"value":1076},"    print",{"type":606,"tag":644,"props":1078,"children":1079},{"style":656},[1080],{"type":612,"value":695},{"type":606,"tag":644,"props":1082,"children":1083},{"style":650},[1084],{"type":612,"value":1085},"f",{"type":606,"tag":644,"props":1087,"children":1088},{"style":698},[1089],{"type":612,"value":1090},"\"Header: ",{"type":606,"tag":644,"props":1092,"children":1093},{"style":687},[1094],{"type":612,"value":1095},"{",{"type":606,"tag":644,"props":1097,"children":1098},{"style":656},[1099],{"type":612,"value":1100},"header",{"type":606,"tag":644,"props":1102,"children":1103},{"style":687},[1104],{"type":612,"value":1105},"}",{"type":606,"tag":644,"props":1107,"children":1108},{"style":698},[1109],{"type":612,"value":1110},"\"",{"type":606,"tag":644,"props":1112,"children":1113},{"style":656},[1114],{"type":612,"value":760},{"type":606,"tag":644,"props":1116,"children":1118},{"class":646,"line":1117},9,[1119],{"type":606,"tag":644,"props":1120,"children":1121},{"style":656},[1122],{"type":612,"value":1123},"    \n",{"type":606,"tag":644,"props":1125,"children":1126},{"class":646,"line":99},[1127,1131,1135,1139],{"type":606,"tag":644,"props":1128,"children":1129},{"style":650},[1130],{"type":612,"value":768},{"type":606,"tag":644,"props":1132,"children":1133},{"style":656},[1134],{"type":612,"value":773},{"type":606,"tag":644,"props":1136,"children":1137},{"style":650},[1138],{"type":612,"value":778},{"type":606,"tag":644,"props":1140,"children":1141},{"style":656},[1142],{"type":612,"value":783},{"type":606,"tag":644,"props":1144,"children":1145},{"class":646,"line":108},[1146,1150,1154,1158,1163,1167,1172,1176,1180],{"type":606,"tag":644,"props":1147,"children":1148},{"style":687},[1149],{"type":612,"value":791},{"type":606,"tag":644,"props":1151,"children":1152},{"style":656},[1153],{"type":612,"value":695},{"type":606,"tag":644,"props":1155,"children":1156},{"style":650},[1157],{"type":612,"value":1085},{"type":606,"tag":644,"props":1159,"children":1160},{"style":698},[1161],{"type":612,"value":1162},"\"Row: ",{"type":606,"tag":644,"props":1164,"children":1165},{"style":687},[1166],{"type":612,"value":1095},{"type":606,"tag":644,"props":1168,"children":1169},{"style":656},[1170],{"type":612,"value":1171},"row",{"type":606,"tag":644,"props":1173,"children":1174},{"style":687},[1175],{"type":612,"value":1105},{"type":606,"tag":644,"props":1177,"children":1178},{"style":698},[1179],{"type":612,"value":1110},{"type":606,"tag":644,"props":1181,"children":1182},{"style":656},[1183],{"type":612,"value":760},{"type":606,"tag":644,"props":1185,"children":1186},{"class":646,"line":117},[1187],{"type":606,"tag":644,"props":1188,"children":1189},{"emptyLinePlaceholder":13},[1190],{"type":612,"value":667},{"type":606,"tag":644,"props":1192,"children":1193},{"class":646,"line":126},[1194,1198,1202,1207],{"type":606,"tag":644,"props":1195,"children":1196},{"style":687},[1197],{"type":612,"value":961},{"type":606,"tag":644,"props":1199,"children":1200},{"style":656},[1201],{"type":612,"value":695},{"type":606,"tag":644,"props":1203,"children":1204},{"style":698},[1205],{"type":612,"value":1206},"\"CSV reading as lists completed\"",{"type":606,"tag":644,"props":1208,"children":1209},{"style":656},[1210],{"type":612,"value":760},{"type":606,"tag":630,"props":1212,"children":1213},{},[1214],{"type":606,"tag":634,"props":1215,"children":1217},{"className":636,"code":1216,"language":638,"meta":8,"style":8},"# Reading CSV as dictionaries\nprint(\"Reading as dictionaries:\")\nwith open('students.csv', 'r') as file:\n    reader = csv.DictReader(file)\n    for row in reader:\n        print(f\"Name: {row['name']}, Age: {row['age']}\")\n\nprint(\"CSV reading as dictionaries completed\")\n",[1218],{"type":606,"tag":621,"props":1219,"children":1220},{"__ignoreMap":8},[1221,1229,1249,1292,1316,1335,1412,1419],{"type":606,"tag":644,"props":1222,"children":1223},{"class":646,"line":12},[1224],{"type":606,"tag":644,"props":1225,"children":1226},{"style":673},[1227],{"type":612,"value":1228},"# Reading CSV as dictionaries\n",{"type":606,"tag":644,"props":1230,"children":1231},{"class":646,"line":27},[1232,1236,1240,1245],{"type":606,"tag":644,"props":1233,"children":1234},{"style":687},[1235],{"type":612,"value":961},{"type":606,"tag":644,"props":1237,"children":1238},{"style":656},[1239],{"type":612,"value":695},{"type":606,"tag":644,"props":1241,"children":1242},{"style":698},[1243],{"type":612,"value":1244},"\"Reading as dictionaries:\"",{"type":606,"tag":644,"props":1246,"children":1247},{"style":656},[1248],{"type":612,"value":760},{"type":606,"tag":644,"props":1250,"children":1251},{"class":646,"line":36},[1252,1256,1260,1264,1268,1272,1276,1280,1284,1288],{"type":606,"tag":644,"props":1253,"children":1254},{"style":650},[1255],{"type":612,"value":684},{"type":606,"tag":644,"props":1257,"children":1258},{"style":687},[1259],{"type":612,"value":690},{"type":606,"tag":644,"props":1261,"children":1262},{"style":656},[1263],{"type":612,"value":695},{"type":606,"tag":644,"props":1265,"children":1266},{"style":698},[1267],{"type":612,"value":994},{"type":606,"tag":644,"props":1269,"children":1270},{"style":656},[1271],{"type":612,"value":706},{"type":606,"tag":644,"props":1273,"children":1274},{"style":698},[1275],{"type":612,"value":711},{"type":606,"tag":644,"props":1277,"children":1278},{"style":656},[1279],{"type":612,"value":716},{"type":606,"tag":644,"props":1281,"children":1282},{"style":650},[1283],{"type":612,"value":721},{"type":606,"tag":644,"props":1285,"children":1286},{"style":724},[1287],{"type":612,"value":727},{"type":606,"tag":644,"props":1289,"children":1290},{"style":656},[1291],{"type":612,"value":732},{"type":606,"tag":644,"props":1293,"children":1294},{"class":646,"line":45},[1295,1299,1303,1308,1312],{"type":606,"tag":644,"props":1296,"children":1297},{"style":656},[1298],{"type":612,"value":740},{"type":606,"tag":644,"props":1300,"children":1301},{"style":650},[1302],{"type":612,"value":745},{"type":606,"tag":644,"props":1304,"children":1305},{"style":656},[1306],{"type":612,"value":1307}," csv.DictReader(",{"type":606,"tag":644,"props":1309,"children":1310},{"style":724},[1311],{"type":612,"value":755},{"type":606,"tag":644,"props":1313,"children":1314},{"style":656},[1315],{"type":612,"value":760},{"type":606,"tag":644,"props":1317,"children":1318},{"class":646,"line":54},[1319,1323,1327,1331],{"type":606,"tag":644,"props":1320,"children":1321},{"style":650},[1322],{"type":612,"value":768},{"type":606,"tag":644,"props":1324,"children":1325},{"style":656},[1326],{"type":612,"value":773},{"type":606,"tag":644,"props":1328,"children":1329},{"style":650},[1330],{"type":612,"value":778},{"type":606,"tag":644,"props":1332,"children":1333},{"style":656},[1334],{"type":612,"value":783},{"type":606,"tag":644,"props":1336,"children":1337},{"class":646,"line":63},[1338,1342,1346,1350,1355,1359,1364,1369,1374,1378,1383,1387,1391,1396,1400,1404,1408],{"type":606,"tag":644,"props":1339,"children":1340},{"style":687},[1341],{"type":612,"value":791},{"type":606,"tag":644,"props":1343,"children":1344},{"style":656},[1345],{"type":612,"value":695},{"type":606,"tag":644,"props":1347,"children":1348},{"style":650},[1349],{"type":612,"value":1085},{"type":606,"tag":644,"props":1351,"children":1352},{"style":698},[1353],{"type":612,"value":1354},"\"Name: ",{"type":606,"tag":644,"props":1356,"children":1357},{"style":687},[1358],{"type":612,"value":1095},{"type":606,"tag":644,"props":1360,"children":1361},{"style":656},[1362],{"type":612,"value":1363},"row[",{"type":606,"tag":644,"props":1365,"children":1366},{"style":698},[1367],{"type":612,"value":1368},"'name'",{"type":606,"tag":644,"props":1370,"children":1371},{"style":656},[1372],{"type":612,"value":1373},"]",{"type":606,"tag":644,"props":1375,"children":1376},{"style":687},[1377],{"type":612,"value":1105},{"type":606,"tag":644,"props":1379,"children":1380},{"style":698},[1381],{"type":612,"value":1382},", Age: ",{"type":606,"tag":644,"props":1384,"children":1385},{"style":687},[1386],{"type":612,"value":1095},{"type":606,"tag":644,"props":1388,"children":1389},{"style":656},[1390],{"type":612,"value":1363},{"type":606,"tag":644,"props":1392,"children":1393},{"style":698},[1394],{"type":612,"value":1395},"'age'",{"type":606,"tag":644,"props":1397,"children":1398},{"style":656},[1399],{"type":612,"value":1373},{"type":606,"tag":644,"props":1401,"children":1402},{"style":687},[1403],{"type":612,"value":1105},{"type":606,"tag":644,"props":1405,"children":1406},{"style":698},[1407],{"type":612,"value":1110},{"type":606,"tag":644,"props":1409,"children":1410},{"style":656},[1411],{"type":612,"value":760},{"type":606,"tag":644,"props":1413,"children":1414},{"class":646,"line":72},[1415],{"type":606,"tag":644,"props":1416,"children":1417},{"emptyLinePlaceholder":13},[1418],{"type":612,"value":667},{"type":606,"tag":644,"props":1420,"children":1421},{"class":646,"line":81},[1422,1426,1430,1435],{"type":606,"tag":644,"props":1423,"children":1424},{"style":687},[1425],{"type":612,"value":961},{"type":606,"tag":644,"props":1427,"children":1428},{"style":656},[1429],{"type":612,"value":695},{"type":606,"tag":644,"props":1431,"children":1432},{"style":698},[1433],{"type":612,"value":1434},"\"CSV reading as dictionaries completed\"",{"type":606,"tag":644,"props":1436,"children":1437},{"style":656},[1438],{"type":612,"value":760},{"type":606,"tag":912,"props":1440,"children":1442},{"id":1441},"writing-csv-files",[1443],{"type":612,"value":1444},"Writing CSV Files",{"type":606,"tag":630,"props":1446,"children":1447},{},[1448],{"type":606,"tag":634,"props":1449,"children":1451},{"className":636,"code":1450,"language":638,"meta":8,"style":8},"# Writing CSV from lists\nstudents_data = [\n    ['name', 'age', 'grade'],\n    ['Alice', 20, 'A'],\n    ['Bob', 19, 'B'],\n    ['Charlie', 21, 'C']\n]\n\nwith open('output.csv', 'w', newline='') as file:\n    writer = csv.writer(file)\n    writer.writerows(students_data)\n\nprint(\"CSV written from lists\")\n",[1452],{"type":606,"tag":621,"props":1453,"children":1454},{"__ignoreMap":8},[1455,1463,1480,1514,1548,1582,1617,1624,1631,1694,1719,1727,1734],{"type":606,"tag":644,"props":1456,"children":1457},{"class":646,"line":12},[1458],{"type":606,"tag":644,"props":1459,"children":1460},{"style":673},[1461],{"type":612,"value":1462},"# Writing CSV from lists\n",{"type":606,"tag":644,"props":1464,"children":1465},{"class":646,"line":27},[1466,1471,1475],{"type":606,"tag":644,"props":1467,"children":1468},{"style":656},[1469],{"type":612,"value":1470},"students_data ",{"type":606,"tag":644,"props":1472,"children":1473},{"style":650},[1474],{"type":612,"value":745},{"type":606,"tag":644,"props":1476,"children":1477},{"style":656},[1478],{"type":612,"value":1479}," [\n",{"type":606,"tag":644,"props":1481,"children":1482},{"class":646,"line":36},[1483,1488,1492,1496,1500,1504,1509],{"type":606,"tag":644,"props":1484,"children":1485},{"style":656},[1486],{"type":612,"value":1487},"    [",{"type":606,"tag":644,"props":1489,"children":1490},{"style":698},[1491],{"type":612,"value":1368},{"type":606,"tag":644,"props":1493,"children":1494},{"style":656},[1495],{"type":612,"value":706},{"type":606,"tag":644,"props":1497,"children":1498},{"style":698},[1499],{"type":612,"value":1395},{"type":606,"tag":644,"props":1501,"children":1502},{"style":656},[1503],{"type":612,"value":706},{"type":606,"tag":644,"props":1505,"children":1506},{"style":698},[1507],{"type":612,"value":1508},"'grade'",{"type":606,"tag":644,"props":1510,"children":1511},{"style":656},[1512],{"type":612,"value":1513},"],\n",{"type":606,"tag":644,"props":1515,"children":1516},{"class":646,"line":45},[1517,1521,1526,1530,1535,1539,1544],{"type":606,"tag":644,"props":1518,"children":1519},{"style":656},[1520],{"type":612,"value":1487},{"type":606,"tag":644,"props":1522,"children":1523},{"style":698},[1524],{"type":612,"value":1525},"'Alice'",{"type":606,"tag":644,"props":1527,"children":1528},{"style":656},[1529],{"type":612,"value":706},{"type":606,"tag":644,"props":1531,"children":1532},{"style":687},[1533],{"type":612,"value":1534},"20",{"type":606,"tag":644,"props":1536,"children":1537},{"style":656},[1538],{"type":612,"value":706},{"type":606,"tag":644,"props":1540,"children":1541},{"style":698},[1542],{"type":612,"value":1543},"'A'",{"type":606,"tag":644,"props":1545,"children":1546},{"style":656},[1547],{"type":612,"value":1513},{"type":606,"tag":644,"props":1549,"children":1550},{"class":646,"line":54},[1551,1555,1560,1564,1569,1573,1578],{"type":606,"tag":644,"props":1552,"children":1553},{"style":656},[1554],{"type":612,"value":1487},{"type":606,"tag":644,"props":1556,"children":1557},{"style":698},[1558],{"type":612,"value":1559},"'Bob'",{"type":606,"tag":644,"props":1561,"children":1562},{"style":656},[1563],{"type":612,"value":706},{"type":606,"tag":644,"props":1565,"children":1566},{"style":687},[1567],{"type":612,"value":1568},"19",{"type":606,"tag":644,"props":1570,"children":1571},{"style":656},[1572],{"type":612,"value":706},{"type":606,"tag":644,"props":1574,"children":1575},{"style":698},[1576],{"type":612,"value":1577},"'B'",{"type":606,"tag":644,"props":1579,"children":1580},{"style":656},[1581],{"type":612,"value":1513},{"type":606,"tag":644,"props":1583,"children":1584},{"class":646,"line":63},[1585,1589,1594,1598,1603,1607,1612],{"type":606,"tag":644,"props":1586,"children":1587},{"style":656},[1588],{"type":612,"value":1487},{"type":606,"tag":644,"props":1590,"children":1591},{"style":698},[1592],{"type":612,"value":1593},"'Charlie'",{"type":606,"tag":644,"props":1595,"children":1596},{"style":656},[1597],{"type":612,"value":706},{"type":606,"tag":644,"props":1599,"children":1600},{"style":687},[1601],{"type":612,"value":1602},"21",{"type":606,"tag":644,"props":1604,"children":1605},{"style":656},[1606],{"type":612,"value":706},{"type":606,"tag":644,"props":1608,"children":1609},{"style":698},[1610],{"type":612,"value":1611},"'C'",{"type":606,"tag":644,"props":1613,"children":1614},{"style":656},[1615],{"type":612,"value":1616},"]\n",{"type":606,"tag":644,"props":1618,"children":1619},{"class":646,"line":72},[1620],{"type":606,"tag":644,"props":1621,"children":1622},{"style":656},[1623],{"type":612,"value":1616},{"type":606,"tag":644,"props":1625,"children":1626},{"class":646,"line":81},[1627],{"type":606,"tag":644,"props":1628,"children":1629},{"emptyLinePlaceholder":13},[1630],{"type":612,"value":667},{"type":606,"tag":644,"props":1632,"children":1633},{"class":646,"line":1117},[1634,1638,1642,1646,1651,1655,1660,1664,1669,1673,1678,1682,1686,1690],{"type":606,"tag":644,"props":1635,"children":1636},{"style":650},[1637],{"type":612,"value":684},{"type":606,"tag":644,"props":1639,"children":1640},{"style":687},[1641],{"type":612,"value":690},{"type":606,"tag":644,"props":1643,"children":1644},{"style":656},[1645],{"type":612,"value":695},{"type":606,"tag":644,"props":1647,"children":1648},{"style":698},[1649],{"type":612,"value":1650},"'output.csv'",{"type":606,"tag":644,"props":1652,"children":1653},{"style":656},[1654],{"type":612,"value":706},{"type":606,"tag":644,"props":1656,"children":1657},{"style":698},[1658],{"type":612,"value":1659},"'w'",{"type":606,"tag":644,"props":1661,"children":1662},{"style":656},[1663],{"type":612,"value":706},{"type":606,"tag":644,"props":1665,"children":1666},{"style":724},[1667],{"type":612,"value":1668},"newline",{"type":606,"tag":644,"props":1670,"children":1671},{"style":650},[1672],{"type":612,"value":745},{"type":606,"tag":644,"props":1674,"children":1675},{"style":698},[1676],{"type":612,"value":1677},"''",{"type":606,"tag":644,"props":1679,"children":1680},{"style":656},[1681],{"type":612,"value":716},{"type":606,"tag":644,"props":1683,"children":1684},{"style":650},[1685],{"type":612,"value":721},{"type":606,"tag":644,"props":1687,"children":1688},{"style":724},[1689],{"type":612,"value":727},{"type":606,"tag":644,"props":1691,"children":1692},{"style":656},[1693],{"type":612,"value":732},{"type":606,"tag":644,"props":1695,"children":1696},{"class":646,"line":99},[1697,1702,1706,1711,1715],{"type":606,"tag":644,"props":1698,"children":1699},{"style":656},[1700],{"type":612,"value":1701},"    writer ",{"type":606,"tag":644,"props":1703,"children":1704},{"style":650},[1705],{"type":612,"value":745},{"type":606,"tag":644,"props":1707,"children":1708},{"style":656},[1709],{"type":612,"value":1710}," csv.writer(",{"type":606,"tag":644,"props":1712,"children":1713},{"style":724},[1714],{"type":612,"value":755},{"type":606,"tag":644,"props":1716,"children":1717},{"style":656},[1718],{"type":612,"value":760},{"type":606,"tag":644,"props":1720,"children":1721},{"class":646,"line":108},[1722],{"type":606,"tag":644,"props":1723,"children":1724},{"style":656},[1725],{"type":612,"value":1726},"    writer.writerows(students_data)\n",{"type":606,"tag":644,"props":1728,"children":1729},{"class":646,"line":117},[1730],{"type":606,"tag":644,"props":1731,"children":1732},{"emptyLinePlaceholder":13},[1733],{"type":612,"value":667},{"type":606,"tag":644,"props":1735,"children":1736},{"class":646,"line":126},[1737,1741,1745,1750],{"type":606,"tag":644,"props":1738,"children":1739},{"style":687},[1740],{"type":612,"value":961},{"type":606,"tag":644,"props":1742,"children":1743},{"style":656},[1744],{"type":612,"value":695},{"type":606,"tag":644,"props":1746,"children":1747},{"style":698},[1748],{"type":612,"value":1749},"\"CSV written from lists\"",{"type":606,"tag":644,"props":1751,"children":1752},{"style":656},[1753],{"type":612,"value":760},{"type":606,"tag":630,"props":1755,"children":1756},{},[1757],{"type":606,"tag":634,"props":1758,"children":1760},{"className":636,"code":1759,"language":638,"meta":8,"style":8},"# Writing CSV from dictionaries\nstudents_dict = [\n    {'name': 'Alice', 'age': 20, 'grade': 'A'},\n    {'name': 'Bob', 'age': 19, 'grade': 'B'},\n    {'name': 'Charlie', 'age': 21, 'grade': 'C'}\n]\n\nwith open('dict_output.csv', 'w', newline='') as file:\n    fieldnames = ['name', 'age', 'grade']\n    writer = csv.DictWriter(file, fieldnames=fieldnames)\n    writer.writeheader()\n    writer.writerows(students_dict)\n\nprint(\"CSV written from dictionaries\")\n",[1761],{"type":606,"tag":621,"props":1762,"children":1763},{"__ignoreMap":8},[1764,1772,1788,1846,1901,1957,1964,1971,2031,2072,2110,2118,2126,2133],{"type":606,"tag":644,"props":1765,"children":1766},{"class":646,"line":12},[1767],{"type":606,"tag":644,"props":1768,"children":1769},{"style":673},[1770],{"type":612,"value":1771},"# Writing CSV from dictionaries\n",{"type":606,"tag":644,"props":1773,"children":1774},{"class":646,"line":27},[1775,1780,1784],{"type":606,"tag":644,"props":1776,"children":1777},{"style":656},[1778],{"type":612,"value":1779},"students_dict ",{"type":606,"tag":644,"props":1781,"children":1782},{"style":650},[1783],{"type":612,"value":745},{"type":606,"tag":644,"props":1785,"children":1786},{"style":656},[1787],{"type":612,"value":1479},{"type":606,"tag":644,"props":1789,"children":1790},{"class":646,"line":36},[1791,1796,1800,1805,1809,1813,1817,1821,1825,1829,1833,1837,1841],{"type":606,"tag":644,"props":1792,"children":1793},{"style":656},[1794],{"type":612,"value":1795},"    {",{"type":606,"tag":644,"props":1797,"children":1798},{"style":698},[1799],{"type":612,"value":1368},{"type":606,"tag":644,"props":1801,"children":1802},{"style":656},[1803],{"type":612,"value":1804},": ",{"type":606,"tag":644,"props":1806,"children":1807},{"style":698},[1808],{"type":612,"value":1525},{"type":606,"tag":644,"props":1810,"children":1811},{"style":656},[1812],{"type":612,"value":706},{"type":606,"tag":644,"props":1814,"children":1815},{"style":698},[1816],{"type":612,"value":1395},{"type":606,"tag":644,"props":1818,"children":1819},{"style":656},[1820],{"type":612,"value":1804},{"type":606,"tag":644,"props":1822,"children":1823},{"style":687},[1824],{"type":612,"value":1534},{"type":606,"tag":644,"props":1826,"children":1827},{"style":656},[1828],{"type":612,"value":706},{"type":606,"tag":644,"props":1830,"children":1831},{"style":698},[1832],{"type":612,"value":1508},{"type":606,"tag":644,"props":1834,"children":1835},{"style":656},[1836],{"type":612,"value":1804},{"type":606,"tag":644,"props":1838,"children":1839},{"style":698},[1840],{"type":612,"value":1543},{"type":606,"tag":644,"props":1842,"children":1843},{"style":656},[1844],{"type":612,"value":1845},"},\n",{"type":606,"tag":644,"props":1847,"children":1848},{"class":646,"line":45},[1849,1853,1857,1861,1865,1869,1873,1877,1881,1885,1889,1893,1897],{"type":606,"tag":644,"props":1850,"children":1851},{"style":656},[1852],{"type":612,"value":1795},{"type":606,"tag":644,"props":1854,"children":1855},{"style":698},[1856],{"type":612,"value":1368},{"type":606,"tag":644,"props":1858,"children":1859},{"style":656},[1860],{"type":612,"value":1804},{"type":606,"tag":644,"props":1862,"children":1863},{"style":698},[1864],{"type":612,"value":1559},{"type":606,"tag":644,"props":1866,"children":1867},{"style":656},[1868],{"type":612,"value":706},{"type":606,"tag":644,"props":1870,"children":1871},{"style":698},[1872],{"type":612,"value":1395},{"type":606,"tag":644,"props":1874,"children":1875},{"style":656},[1876],{"type":612,"value":1804},{"type":606,"tag":644,"props":1878,"children":1879},{"style":687},[1880],{"type":612,"value":1568},{"type":606,"tag":644,"props":1882,"children":1883},{"style":656},[1884],{"type":612,"value":706},{"type":606,"tag":644,"props":1886,"children":1887},{"style":698},[1888],{"type":612,"value":1508},{"type":606,"tag":644,"props":1890,"children":1891},{"style":656},[1892],{"type":612,"value":1804},{"type":606,"tag":644,"props":1894,"children":1895},{"style":698},[1896],{"type":612,"value":1577},{"type":606,"tag":644,"props":1898,"children":1899},{"style":656},[1900],{"type":612,"value":1845},{"type":606,"tag":644,"props":1902,"children":1903},{"class":646,"line":54},[1904,1908,1912,1916,1920,1924,1928,1932,1936,1940,1944,1948,1952],{"type":606,"tag":644,"props":1905,"children":1906},{"style":656},[1907],{"type":612,"value":1795},{"type":606,"tag":644,"props":1909,"children":1910},{"style":698},[1911],{"type":612,"value":1368},{"type":606,"tag":644,"props":1913,"children":1914},{"style":656},[1915],{"type":612,"value":1804},{"type":606,"tag":644,"props":1917,"children":1918},{"style":698},[1919],{"type":612,"value":1593},{"type":606,"tag":644,"props":1921,"children":1922},{"style":656},[1923],{"type":612,"value":706},{"type":606,"tag":644,"props":1925,"children":1926},{"style":698},[1927],{"type":612,"value":1395},{"type":606,"tag":644,"props":1929,"children":1930},{"style":656},[1931],{"type":612,"value":1804},{"type":606,"tag":644,"props":1933,"children":1934},{"style":687},[1935],{"type":612,"value":1602},{"type":606,"tag":644,"props":1937,"children":1938},{"style":656},[1939],{"type":612,"value":706},{"type":606,"tag":644,"props":1941,"children":1942},{"style":698},[1943],{"type":612,"value":1508},{"type":606,"tag":644,"props":1945,"children":1946},{"style":656},[1947],{"type":612,"value":1804},{"type":606,"tag":644,"props":1949,"children":1950},{"style":698},[1951],{"type":612,"value":1611},{"type":606,"tag":644,"props":1953,"children":1954},{"style":656},[1955],{"type":612,"value":1956},"}\n",{"type":606,"tag":644,"props":1958,"children":1959},{"class":646,"line":63},[1960],{"type":606,"tag":644,"props":1961,"children":1962},{"style":656},[1963],{"type":612,"value":1616},{"type":606,"tag":644,"props":1965,"children":1966},{"class":646,"line":72},[1967],{"type":606,"tag":644,"props":1968,"children":1969},{"emptyLinePlaceholder":13},[1970],{"type":612,"value":667},{"type":606,"tag":644,"props":1972,"children":1973},{"class":646,"line":81},[1974,1978,1982,1986,1991,1995,1999,2003,2007,2011,2015,2019,2023,2027],{"type":606,"tag":644,"props":1975,"children":1976},{"style":650},[1977],{"type":612,"value":684},{"type":606,"tag":644,"props":1979,"children":1980},{"style":687},[1981],{"type":612,"value":690},{"type":606,"tag":644,"props":1983,"children":1984},{"style":656},[1985],{"type":612,"value":695},{"type":606,"tag":644,"props":1987,"children":1988},{"style":698},[1989],{"type":612,"value":1990},"'dict_output.csv'",{"type":606,"tag":644,"props":1992,"children":1993},{"style":656},[1994],{"type":612,"value":706},{"type":606,"tag":644,"props":1996,"children":1997},{"style":698},[1998],{"type":612,"value":1659},{"type":606,"tag":644,"props":2000,"children":2001},{"style":656},[2002],{"type":612,"value":706},{"type":606,"tag":644,"props":2004,"children":2005},{"style":724},[2006],{"type":612,"value":1668},{"type":606,"tag":644,"props":2008,"children":2009},{"style":650},[2010],{"type":612,"value":745},{"type":606,"tag":644,"props":2012,"children":2013},{"style":698},[2014],{"type":612,"value":1677},{"type":606,"tag":644,"props":2016,"children":2017},{"style":656},[2018],{"type":612,"value":716},{"type":606,"tag":644,"props":2020,"children":2021},{"style":650},[2022],{"type":612,"value":721},{"type":606,"tag":644,"props":2024,"children":2025},{"style":724},[2026],{"type":612,"value":727},{"type":606,"tag":644,"props":2028,"children":2029},{"style":656},[2030],{"type":612,"value":732},{"type":606,"tag":644,"props":2032,"children":2033},{"class":646,"line":1117},[2034,2039,2043,2048,2052,2056,2060,2064,2068],{"type":606,"tag":644,"props":2035,"children":2036},{"style":656},[2037],{"type":612,"value":2038},"    fieldnames ",{"type":606,"tag":644,"props":2040,"children":2041},{"style":650},[2042],{"type":612,"value":745},{"type":606,"tag":644,"props":2044,"children":2045},{"style":656},[2046],{"type":612,"value":2047}," [",{"type":606,"tag":644,"props":2049,"children":2050},{"style":698},[2051],{"type":612,"value":1368},{"type":606,"tag":644,"props":2053,"children":2054},{"style":656},[2055],{"type":612,"value":706},{"type":606,"tag":644,"props":2057,"children":2058},{"style":698},[2059],{"type":612,"value":1395},{"type":606,"tag":644,"props":2061,"children":2062},{"style":656},[2063],{"type":612,"value":706},{"type":606,"tag":644,"props":2065,"children":2066},{"style":698},[2067],{"type":612,"value":1508},{"type":606,"tag":644,"props":2069,"children":2070},{"style":656},[2071],{"type":612,"value":1616},{"type":606,"tag":644,"props":2073,"children":2074},{"class":646,"line":99},[2075,2079,2083,2088,2092,2096,2101,2105],{"type":606,"tag":644,"props":2076,"children":2077},{"style":656},[2078],{"type":612,"value":1701},{"type":606,"tag":644,"props":2080,"children":2081},{"style":650},[2082],{"type":612,"value":745},{"type":606,"tag":644,"props":2084,"children":2085},{"style":656},[2086],{"type":612,"value":2087}," csv.DictWriter(",{"type":606,"tag":644,"props":2089,"children":2090},{"style":724},[2091],{"type":612,"value":755},{"type":606,"tag":644,"props":2093,"children":2094},{"style":656},[2095],{"type":612,"value":706},{"type":606,"tag":644,"props":2097,"children":2098},{"style":724},[2099],{"type":612,"value":2100},"fieldnames",{"type":606,"tag":644,"props":2102,"children":2103},{"style":650},[2104],{"type":612,"value":745},{"type":606,"tag":644,"props":2106,"children":2107},{"style":656},[2108],{"type":612,"value":2109},"fieldnames)\n",{"type":606,"tag":644,"props":2111,"children":2112},{"class":646,"line":108},[2113],{"type":606,"tag":644,"props":2114,"children":2115},{"style":656},[2116],{"type":612,"value":2117},"    writer.writeheader()\n",{"type":606,"tag":644,"props":2119,"children":2120},{"class":646,"line":117},[2121],{"type":606,"tag":644,"props":2122,"children":2123},{"style":656},[2124],{"type":612,"value":2125},"    writer.writerows(students_dict)\n",{"type":606,"tag":644,"props":2127,"children":2128},{"class":646,"line":126},[2129],{"type":606,"tag":644,"props":2130,"children":2131},{"emptyLinePlaceholder":13},[2132],{"type":612,"value":667},{"type":606,"tag":644,"props":2134,"children":2135},{"class":646,"line":135},[2136,2140,2144,2149],{"type":606,"tag":644,"props":2137,"children":2138},{"style":687},[2139],{"type":612,"value":961},{"type":606,"tag":644,"props":2141,"children":2142},{"style":656},[2143],{"type":612,"value":695},{"type":606,"tag":644,"props":2145,"children":2146},{"style":698},[2147],{"type":612,"value":2148},"\"CSV written from dictionaries\"",{"type":606,"tag":644,"props":2150,"children":2151},{"style":656},[2152],{"type":612,"value":760},{"type":606,"tag":798,"props":2154,"children":2156},{"id":2155},"advanced-csv-handling",[2157],{"type":612,"value":2158},"🔍 Advanced CSV Handling",{"type":606,"tag":615,"props":2160,"children":2161},{},[2162],{"type":612,"value":2163},"Python allows more sophisticated CSV operations.",{"type":606,"tag":912,"props":2165,"children":2167},{"id":2166},"custom-delimiters-and-quoting",[2168],{"type":612,"value":2169},"Custom Delimiters and Quoting",{"type":606,"tag":630,"props":2171,"children":2172},{},[2173],{"type":606,"tag":634,"props":2174,"children":2176},{"className":636,"code":2175,"language":638,"meta":8,"style":8},"import csv\n\n# Writing with custom delimiter and quoting\nwith open('custom.csv', 'w', newline='') as file:\n    writer = csv.writer(file, delimiter=';', quotechar='\"')\n    writer.writerow(['Name', 'Description'])\n    writer.writerow(['Product A', 'A \"premium\" item'])\n    writer.writerow(['Product B', 'Contains; semicolon'])\n\n# Reading with custom settings\nwith open('custom.csv', 'r') as file:\n    reader = csv.reader(file, delimiter=';', quotechar='\"')\n    for row in reader:\n        print(row)\n\nprint(\"Custom delimiter CSV processing completed\")\n",[2177],{"type":606,"tag":621,"props":2178,"children":2179},{"__ignoreMap":8},[2180,2191,2198,2206,2266,2325,2352,2377,2402,2409,2417,2460,2515,2534,2545,2552],{"type":606,"tag":644,"props":2181,"children":2182},{"class":646,"line":12},[2183,2187],{"type":606,"tag":644,"props":2184,"children":2185},{"style":650},[2186],{"type":612,"value":653},{"type":606,"tag":644,"props":2188,"children":2189},{"style":656},[2190],{"type":612,"value":659},{"type":606,"tag":644,"props":2192,"children":2193},{"class":646,"line":27},[2194],{"type":606,"tag":644,"props":2195,"children":2196},{"emptyLinePlaceholder":13},[2197],{"type":612,"value":667},{"type":606,"tag":644,"props":2199,"children":2200},{"class":646,"line":36},[2201],{"type":606,"tag":644,"props":2202,"children":2203},{"style":673},[2204],{"type":612,"value":2205},"# Writing with custom delimiter and quoting\n",{"type":606,"tag":644,"props":2207,"children":2208},{"class":646,"line":45},[2209,2213,2217,2221,2226,2230,2234,2238,2242,2246,2250,2254,2258,2262],{"type":606,"tag":644,"props":2210,"children":2211},{"style":650},[2212],{"type":612,"value":684},{"type":606,"tag":644,"props":2214,"children":2215},{"style":687},[2216],{"type":612,"value":690},{"type":606,"tag":644,"props":2218,"children":2219},{"style":656},[2220],{"type":612,"value":695},{"type":606,"tag":644,"props":2222,"children":2223},{"style":698},[2224],{"type":612,"value":2225},"'custom.csv'",{"type":606,"tag":644,"props":2227,"children":2228},{"style":656},[2229],{"type":612,"value":706},{"type":606,"tag":644,"props":2231,"children":2232},{"style":698},[2233],{"type":612,"value":1659},{"type":606,"tag":644,"props":2235,"children":2236},{"style":656},[2237],{"type":612,"value":706},{"type":606,"tag":644,"props":2239,"children":2240},{"style":724},[2241],{"type":612,"value":1668},{"type":606,"tag":644,"props":2243,"children":2244},{"style":650},[2245],{"type":612,"value":745},{"type":606,"tag":644,"props":2247,"children":2248},{"style":698},[2249],{"type":612,"value":1677},{"type":606,"tag":644,"props":2251,"children":2252},{"style":656},[2253],{"type":612,"value":716},{"type":606,"tag":644,"props":2255,"children":2256},{"style":650},[2257],{"type":612,"value":721},{"type":606,"tag":644,"props":2259,"children":2260},{"style":724},[2261],{"type":612,"value":727},{"type":606,"tag":644,"props":2263,"children":2264},{"style":656},[2265],{"type":612,"value":732},{"type":606,"tag":644,"props":2267,"children":2268},{"class":646,"line":54},[2269,2273,2277,2281,2285,2289,2294,2298,2303,2307,2312,2316,2321],{"type":606,"tag":644,"props":2270,"children":2271},{"style":656},[2272],{"type":612,"value":1701},{"type":606,"tag":644,"props":2274,"children":2275},{"style":650},[2276],{"type":612,"value":745},{"type":606,"tag":644,"props":2278,"children":2279},{"style":656},[2280],{"type":612,"value":1710},{"type":606,"tag":644,"props":2282,"children":2283},{"style":724},[2284],{"type":612,"value":755},{"type":606,"tag":644,"props":2286,"children":2287},{"style":656},[2288],{"type":612,"value":706},{"type":606,"tag":644,"props":2290,"children":2291},{"style":724},[2292],{"type":612,"value":2293},"delimiter",{"type":606,"tag":644,"props":2295,"children":2296},{"style":650},[2297],{"type":612,"value":745},{"type":606,"tag":644,"props":2299,"children":2300},{"style":698},[2301],{"type":612,"value":2302},"';'",{"type":606,"tag":644,"props":2304,"children":2305},{"style":656},[2306],{"type":612,"value":706},{"type":606,"tag":644,"props":2308,"children":2309},{"style":724},[2310],{"type":612,"value":2311},"quotechar",{"type":606,"tag":644,"props":2313,"children":2314},{"style":650},[2315],{"type":612,"value":745},{"type":606,"tag":644,"props":2317,"children":2318},{"style":698},[2319],{"type":612,"value":2320},"'\"'",{"type":606,"tag":644,"props":2322,"children":2323},{"style":656},[2324],{"type":612,"value":760},{"type":606,"tag":644,"props":2326,"children":2327},{"class":646,"line":63},[2328,2333,2338,2342,2347],{"type":606,"tag":644,"props":2329,"children":2330},{"style":656},[2331],{"type":612,"value":2332},"    writer.writerow([",{"type":606,"tag":644,"props":2334,"children":2335},{"style":698},[2336],{"type":612,"value":2337},"'Name'",{"type":606,"tag":644,"props":2339,"children":2340},{"style":656},[2341],{"type":612,"value":706},{"type":606,"tag":644,"props":2343,"children":2344},{"style":698},[2345],{"type":612,"value":2346},"'Description'",{"type":606,"tag":644,"props":2348,"children":2349},{"style":656},[2350],{"type":612,"value":2351},"])\n",{"type":606,"tag":644,"props":2353,"children":2354},{"class":646,"line":72},[2355,2359,2364,2368,2373],{"type":606,"tag":644,"props":2356,"children":2357},{"style":656},[2358],{"type":612,"value":2332},{"type":606,"tag":644,"props":2360,"children":2361},{"style":698},[2362],{"type":612,"value":2363},"'Product A'",{"type":606,"tag":644,"props":2365,"children":2366},{"style":656},[2367],{"type":612,"value":706},{"type":606,"tag":644,"props":2369,"children":2370},{"style":698},[2371],{"type":612,"value":2372},"'A \"premium\" item'",{"type":606,"tag":644,"props":2374,"children":2375},{"style":656},[2376],{"type":612,"value":2351},{"type":606,"tag":644,"props":2378,"children":2379},{"class":646,"line":81},[2380,2384,2389,2393,2398],{"type":606,"tag":644,"props":2381,"children":2382},{"style":656},[2383],{"type":612,"value":2332},{"type":606,"tag":644,"props":2385,"children":2386},{"style":698},[2387],{"type":612,"value":2388},"'Product B'",{"type":606,"tag":644,"props":2390,"children":2391},{"style":656},[2392],{"type":612,"value":706},{"type":606,"tag":644,"props":2394,"children":2395},{"style":698},[2396],{"type":612,"value":2397},"'Contains; semicolon'",{"type":606,"tag":644,"props":2399,"children":2400},{"style":656},[2401],{"type":612,"value":2351},{"type":606,"tag":644,"props":2403,"children":2404},{"class":646,"line":1117},[2405],{"type":606,"tag":644,"props":2406,"children":2407},{"emptyLinePlaceholder":13},[2408],{"type":612,"value":667},{"type":606,"tag":644,"props":2410,"children":2411},{"class":646,"line":99},[2412],{"type":606,"tag":644,"props":2413,"children":2414},{"style":673},[2415],{"type":612,"value":2416},"# Reading with custom settings\n",{"type":606,"tag":644,"props":2418,"children":2419},{"class":646,"line":108},[2420,2424,2428,2432,2436,2440,2444,2448,2452,2456],{"type":606,"tag":644,"props":2421,"children":2422},{"style":650},[2423],{"type":612,"value":684},{"type":606,"tag":644,"props":2425,"children":2426},{"style":687},[2427],{"type":612,"value":690},{"type":606,"tag":644,"props":2429,"children":2430},{"style":656},[2431],{"type":612,"value":695},{"type":606,"tag":644,"props":2433,"children":2434},{"style":698},[2435],{"type":612,"value":2225},{"type":606,"tag":644,"props":2437,"children":2438},{"style":656},[2439],{"type":612,"value":706},{"type":606,"tag":644,"props":2441,"children":2442},{"style":698},[2443],{"type":612,"value":711},{"type":606,"tag":644,"props":2445,"children":2446},{"style":656},[2447],{"type":612,"value":716},{"type":606,"tag":644,"props":2449,"children":2450},{"style":650},[2451],{"type":612,"value":721},{"type":606,"tag":644,"props":2453,"children":2454},{"style":724},[2455],{"type":612,"value":727},{"type":606,"tag":644,"props":2457,"children":2458},{"style":656},[2459],{"type":612,"value":732},{"type":606,"tag":644,"props":2461,"children":2462},{"class":646,"line":117},[2463,2467,2471,2475,2479,2483,2487,2491,2495,2499,2503,2507,2511],{"type":606,"tag":644,"props":2464,"children":2465},{"style":656},[2466],{"type":612,"value":740},{"type":606,"tag":644,"props":2468,"children":2469},{"style":650},[2470],{"type":612,"value":745},{"type":606,"tag":644,"props":2472,"children":2473},{"style":656},[2474],{"type":612,"value":750},{"type":606,"tag":644,"props":2476,"children":2477},{"style":724},[2478],{"type":612,"value":755},{"type":606,"tag":644,"props":2480,"children":2481},{"style":656},[2482],{"type":612,"value":706},{"type":606,"tag":644,"props":2484,"children":2485},{"style":724},[2486],{"type":612,"value":2293},{"type":606,"tag":644,"props":2488,"children":2489},{"style":650},[2490],{"type":612,"value":745},{"type":606,"tag":644,"props":2492,"children":2493},{"style":698},[2494],{"type":612,"value":2302},{"type":606,"tag":644,"props":2496,"children":2497},{"style":656},[2498],{"type":612,"value":706},{"type":606,"tag":644,"props":2500,"children":2501},{"style":724},[2502],{"type":612,"value":2311},{"type":606,"tag":644,"props":2504,"children":2505},{"style":650},[2506],{"type":612,"value":745},{"type":606,"tag":644,"props":2508,"children":2509},{"style":698},[2510],{"type":612,"value":2320},{"type":606,"tag":644,"props":2512,"children":2513},{"style":656},[2514],{"type":612,"value":760},{"type":606,"tag":644,"props":2516,"children":2517},{"class":646,"line":126},[2518,2522,2526,2530],{"type":606,"tag":644,"props":2519,"children":2520},{"style":650},[2521],{"type":612,"value":768},{"type":606,"tag":644,"props":2523,"children":2524},{"style":656},[2525],{"type":612,"value":773},{"type":606,"tag":644,"props":2527,"children":2528},{"style":650},[2529],{"type":612,"value":778},{"type":606,"tag":644,"props":2531,"children":2532},{"style":656},[2533],{"type":612,"value":783},{"type":606,"tag":644,"props":2535,"children":2536},{"class":646,"line":135},[2537,2541],{"type":606,"tag":644,"props":2538,"children":2539},{"style":687},[2540],{"type":612,"value":791},{"type":606,"tag":644,"props":2542,"children":2543},{"style":656},[2544],{"type":612,"value":796},{"type":606,"tag":644,"props":2546,"children":2547},{"class":646,"line":144},[2548],{"type":606,"tag":644,"props":2549,"children":2550},{"emptyLinePlaceholder":13},[2551],{"type":612,"value":667},{"type":606,"tag":644,"props":2553,"children":2554},{"class":646,"line":153},[2555,2559,2563,2568],{"type":606,"tag":644,"props":2556,"children":2557},{"style":687},[2558],{"type":612,"value":961},{"type":606,"tag":644,"props":2560,"children":2561},{"style":656},[2562],{"type":612,"value":695},{"type":606,"tag":644,"props":2564,"children":2565},{"style":698},[2566],{"type":612,"value":2567},"\"Custom delimiter CSV processing completed\"",{"type":606,"tag":644,"props":2569,"children":2570},{"style":656},[2571],{"type":612,"value":760},{"type":606,"tag":912,"props":2573,"children":2575},{"id":2574},"large-file-processing",[2576],{"type":612,"value":2577},"Large File Processing",{"type":606,"tag":630,"props":2579,"children":2580},{},[2581],{"type":606,"tag":634,"props":2582,"children":2584},{"className":636,"code":2583,"language":638,"meta":8,"style":8},"from collections import defaultdict\n\n# Processing large CSV files efficiently\ndef process_large_csv(filename):\n    total_rows = 0\n    grade_counts = defaultdict(int)\n    \n    with open(filename, 'r') as file:\n        reader = csv.DictReader(file)\n        for row in reader:\n            total_rows += 1\n            grade_counts[row['grade']] += 1\n            \n            # Process in chunks\n            if total_rows % 1000 == 0:\n                print(f\"Processed {total_rows} rows\")\n    \n    return total_rows, dict(grade_counts)\n\n# Example usage (will work when file exists)\n# total, counts = process_large_csv('large_file.csv')\nprint(\"Large file processing function defined\")\n",[2585],{"type":606,"tag":621,"props":2586,"children":2587},{"__ignoreMap":8},[2588,2610,2617,2625,2644,2661,2687,2694,2731,2755,2775,2793,2818,2826,2834,2871,2914,2921,2944,2951,2959,2967],{"type":606,"tag":644,"props":2589,"children":2590},{"class":646,"line":12},[2591,2596,2601,2605],{"type":606,"tag":644,"props":2592,"children":2593},{"style":650},[2594],{"type":612,"value":2595},"from",{"type":606,"tag":644,"props":2597,"children":2598},{"style":656},[2599],{"type":612,"value":2600}," collections ",{"type":606,"tag":644,"props":2602,"children":2603},{"style":650},[2604],{"type":612,"value":653},{"type":606,"tag":644,"props":2606,"children":2607},{"style":656},[2608],{"type":612,"value":2609}," defaultdict\n",{"type":606,"tag":644,"props":2611,"children":2612},{"class":646,"line":27},[2613],{"type":606,"tag":644,"props":2614,"children":2615},{"emptyLinePlaceholder":13},[2616],{"type":612,"value":667},{"type":606,"tag":644,"props":2618,"children":2619},{"class":646,"line":36},[2620],{"type":606,"tag":644,"props":2621,"children":2622},{"style":673},[2623],{"type":612,"value":2624},"# Processing large CSV files efficiently\n",{"type":606,"tag":644,"props":2626,"children":2627},{"class":646,"line":45},[2628,2633,2639],{"type":606,"tag":644,"props":2629,"children":2630},{"style":650},[2631],{"type":612,"value":2632},"def",{"type":606,"tag":644,"props":2634,"children":2636},{"style":2635},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[2637],{"type":612,"value":2638}," process_large_csv",{"type":606,"tag":644,"props":2640,"children":2641},{"style":656},[2642],{"type":612,"value":2643},"(filename):\n",{"type":606,"tag":644,"props":2645,"children":2646},{"class":646,"line":54},[2647,2652,2656],{"type":606,"tag":644,"props":2648,"children":2649},{"style":656},[2650],{"type":612,"value":2651},"    total_rows ",{"type":606,"tag":644,"props":2653,"children":2654},{"style":650},[2655],{"type":612,"value":745},{"type":606,"tag":644,"props":2657,"children":2658},{"style":687},[2659],{"type":612,"value":2660}," 0\n",{"type":606,"tag":644,"props":2662,"children":2663},{"class":646,"line":63},[2664,2669,2673,2678,2683],{"type":606,"tag":644,"props":2665,"children":2666},{"style":656},[2667],{"type":612,"value":2668},"    grade_counts ",{"type":606,"tag":644,"props":2670,"children":2671},{"style":650},[2672],{"type":612,"value":745},{"type":606,"tag":644,"props":2674,"children":2675},{"style":656},[2676],{"type":612,"value":2677}," defaultdict(",{"type":606,"tag":644,"props":2679,"children":2680},{"style":687},[2681],{"type":612,"value":2682},"int",{"type":606,"tag":644,"props":2684,"children":2685},{"style":656},[2686],{"type":612,"value":760},{"type":606,"tag":644,"props":2688,"children":2689},{"class":646,"line":72},[2690],{"type":606,"tag":644,"props":2691,"children":2692},{"style":656},[2693],{"type":612,"value":1123},{"type":606,"tag":644,"props":2695,"children":2696},{"class":646,"line":81},[2697,2702,2706,2711,2715,2719,2723,2727],{"type":606,"tag":644,"props":2698,"children":2699},{"style":650},[2700],{"type":612,"value":2701},"    with",{"type":606,"tag":644,"props":2703,"children":2704},{"style":687},[2705],{"type":612,"value":690},{"type":606,"tag":644,"props":2707,"children":2708},{"style":656},[2709],{"type":612,"value":2710},"(filename, ",{"type":606,"tag":644,"props":2712,"children":2713},{"style":698},[2714],{"type":612,"value":711},{"type":606,"tag":644,"props":2716,"children":2717},{"style":656},[2718],{"type":612,"value":716},{"type":606,"tag":644,"props":2720,"children":2721},{"style":650},[2722],{"type":612,"value":721},{"type":606,"tag":644,"props":2724,"children":2725},{"style":724},[2726],{"type":612,"value":727},{"type":606,"tag":644,"props":2728,"children":2729},{"style":656},[2730],{"type":612,"value":732},{"type":606,"tag":644,"props":2732,"children":2733},{"class":646,"line":1117},[2734,2739,2743,2747,2751],{"type":606,"tag":644,"props":2735,"children":2736},{"style":656},[2737],{"type":612,"value":2738},"        reader ",{"type":606,"tag":644,"props":2740,"children":2741},{"style":650},[2742],{"type":612,"value":745},{"type":606,"tag":644,"props":2744,"children":2745},{"style":656},[2746],{"type":612,"value":1307},{"type":606,"tag":644,"props":2748,"children":2749},{"style":724},[2750],{"type":612,"value":755},{"type":606,"tag":644,"props":2752,"children":2753},{"style":656},[2754],{"type":612,"value":760},{"type":606,"tag":644,"props":2756,"children":2757},{"class":646,"line":99},[2758,2763,2767,2771],{"type":606,"tag":644,"props":2759,"children":2760},{"style":650},[2761],{"type":612,"value":2762},"        for",{"type":606,"tag":644,"props":2764,"children":2765},{"style":656},[2766],{"type":612,"value":773},{"type":606,"tag":644,"props":2768,"children":2769},{"style":650},[2770],{"type":612,"value":778},{"type":606,"tag":644,"props":2772,"children":2773},{"style":656},[2774],{"type":612,"value":783},{"type":606,"tag":644,"props":2776,"children":2777},{"class":646,"line":108},[2778,2783,2788],{"type":606,"tag":644,"props":2779,"children":2780},{"style":656},[2781],{"type":612,"value":2782},"            total_rows ",{"type":606,"tag":644,"props":2784,"children":2785},{"style":650},[2786],{"type":612,"value":2787},"+=",{"type":606,"tag":644,"props":2789,"children":2790},{"style":687},[2791],{"type":612,"value":2792}," 1\n",{"type":606,"tag":644,"props":2794,"children":2795},{"class":646,"line":117},[2796,2801,2805,2810,2814],{"type":606,"tag":644,"props":2797,"children":2798},{"style":656},[2799],{"type":612,"value":2800},"            grade_counts[row[",{"type":606,"tag":644,"props":2802,"children":2803},{"style":698},[2804],{"type":612,"value":1508},{"type":606,"tag":644,"props":2806,"children":2807},{"style":656},[2808],{"type":612,"value":2809},"]] ",{"type":606,"tag":644,"props":2811,"children":2812},{"style":650},[2813],{"type":612,"value":2787},{"type":606,"tag":644,"props":2815,"children":2816},{"style":687},[2817],{"type":612,"value":2792},{"type":606,"tag":644,"props":2819,"children":2820},{"class":646,"line":126},[2821],{"type":606,"tag":644,"props":2822,"children":2823},{"style":656},[2824],{"type":612,"value":2825},"            \n",{"type":606,"tag":644,"props":2827,"children":2828},{"class":646,"line":135},[2829],{"type":606,"tag":644,"props":2830,"children":2831},{"style":673},[2832],{"type":612,"value":2833},"            # Process in chunks\n",{"type":606,"tag":644,"props":2835,"children":2836},{"class":646,"line":144},[2837,2842,2847,2852,2857,2862,2867],{"type":606,"tag":644,"props":2838,"children":2839},{"style":650},[2840],{"type":612,"value":2841},"            if",{"type":606,"tag":644,"props":2843,"children":2844},{"style":656},[2845],{"type":612,"value":2846}," total_rows ",{"type":606,"tag":644,"props":2848,"children":2849},{"style":650},[2850],{"type":612,"value":2851},"%",{"type":606,"tag":644,"props":2853,"children":2854},{"style":687},[2855],{"type":612,"value":2856}," 1000",{"type":606,"tag":644,"props":2858,"children":2859},{"style":650},[2860],{"type":612,"value":2861}," ==",{"type":606,"tag":644,"props":2863,"children":2864},{"style":687},[2865],{"type":612,"value":2866}," 0",{"type":606,"tag":644,"props":2868,"children":2869},{"style":656},[2870],{"type":612,"value":732},{"type":606,"tag":644,"props":2872,"children":2873},{"class":646,"line":153},[2874,2879,2883,2887,2892,2896,2901,2905,2910],{"type":606,"tag":644,"props":2875,"children":2876},{"style":687},[2877],{"type":612,"value":2878},"                print",{"type":606,"tag":644,"props":2880,"children":2881},{"style":656},[2882],{"type":612,"value":695},{"type":606,"tag":644,"props":2884,"children":2885},{"style":650},[2886],{"type":612,"value":1085},{"type":606,"tag":644,"props":2888,"children":2889},{"style":698},[2890],{"type":612,"value":2891},"\"Processed ",{"type":606,"tag":644,"props":2893,"children":2894},{"style":687},[2895],{"type":612,"value":1095},{"type":606,"tag":644,"props":2897,"children":2898},{"style":656},[2899],{"type":612,"value":2900},"total_rows",{"type":606,"tag":644,"props":2902,"children":2903},{"style":687},[2904],{"type":612,"value":1105},{"type":606,"tag":644,"props":2906,"children":2907},{"style":698},[2908],{"type":612,"value":2909}," rows\"",{"type":606,"tag":644,"props":2911,"children":2912},{"style":656},[2913],{"type":612,"value":760},{"type":606,"tag":644,"props":2915,"children":2916},{"class":646,"line":163},[2917],{"type":606,"tag":644,"props":2918,"children":2919},{"style":656},[2920],{"type":612,"value":1123},{"type":606,"tag":644,"props":2922,"children":2923},{"class":646,"line":172},[2924,2929,2934,2939],{"type":606,"tag":644,"props":2925,"children":2926},{"style":650},[2927],{"type":612,"value":2928},"    return",{"type":606,"tag":644,"props":2930,"children":2931},{"style":656},[2932],{"type":612,"value":2933}," total_rows, ",{"type":606,"tag":644,"props":2935,"children":2936},{"style":687},[2937],{"type":612,"value":2938},"dict",{"type":606,"tag":644,"props":2940,"children":2941},{"style":656},[2942],{"type":612,"value":2943},"(grade_counts)\n",{"type":606,"tag":644,"props":2945,"children":2946},{"class":646,"line":181},[2947],{"type":606,"tag":644,"props":2948,"children":2949},{"emptyLinePlaceholder":13},[2950],{"type":612,"value":667},{"type":606,"tag":644,"props":2952,"children":2953},{"class":646,"line":190},[2954],{"type":606,"tag":644,"props":2955,"children":2956},{"style":673},[2957],{"type":612,"value":2958},"# Example usage (will work when file exists)\n",{"type":606,"tag":644,"props":2960,"children":2961},{"class":646,"line":199},[2962],{"type":606,"tag":644,"props":2963,"children":2964},{"style":673},[2965],{"type":612,"value":2966},"# total, counts = process_large_csv('large_file.csv')\n",{"type":606,"tag":644,"props":2968,"children":2969},{"class":646,"line":208},[2970,2974,2978,2983],{"type":606,"tag":644,"props":2971,"children":2972},{"style":687},[2973],{"type":612,"value":961},{"type":606,"tag":644,"props":2975,"children":2976},{"style":656},[2977],{"type":612,"value":695},{"type":606,"tag":644,"props":2979,"children":2980},{"style":698},[2981],{"type":612,"value":2982},"\"Large file processing function defined\"",{"type":606,"tag":644,"props":2984,"children":2985},{"style":656},[2986],{"type":612,"value":760},{"type":606,"tag":912,"props":2988,"children":2990},{"id":2989},"error-handling-and-validation",[2991],{"type":612,"value":2992},"Error Handling and Validation",{"type":606,"tag":630,"props":2994,"children":2995},{},[2996],{"type":606,"tag":634,"props":2997,"children":2999},{"className":636,"code":2998,"language":638,"meta":8,"style":8},"# Safe CSV reading with error handling\ndef safe_csv_read(filename):\n    try:\n        with open(filename, 'r') as file:\n            # Detect dialect\n            sample = file.read(1024)\n            file.seek(0)\n            dialect = csv.Sniffer().sniff(sample)\n            \n            reader = csv.reader(file, dialect)\n            data = list(reader)\n            return data\n    except FileNotFoundError:\n        print(f\"File {filename} not found\")\n        return []\n    except csv.Error as e:\n        print(f\"CSV error: {e}\")\n        return []\n\n# Test the function\ndata = safe_csv_read('data.csv')\nprint(f\"Read {len(data)} rows\")\n",[3000],{"type":606,"tag":621,"props":3001,"children":3002},{"__ignoreMap":8},[3003,3011,3027,3039,3075,3083,3113,3135,3152,3159,3184,3206,3219,3236,3278,3291,3312,3353,3364,3371,3379,3404],{"type":606,"tag":644,"props":3004,"children":3005},{"class":646,"line":12},[3006],{"type":606,"tag":644,"props":3007,"children":3008},{"style":673},[3009],{"type":612,"value":3010},"# Safe CSV reading with error handling\n",{"type":606,"tag":644,"props":3012,"children":3013},{"class":646,"line":27},[3014,3018,3023],{"type":606,"tag":644,"props":3015,"children":3016},{"style":650},[3017],{"type":612,"value":2632},{"type":606,"tag":644,"props":3019,"children":3020},{"style":2635},[3021],{"type":612,"value":3022}," safe_csv_read",{"type":606,"tag":644,"props":3024,"children":3025},{"style":656},[3026],{"type":612,"value":2643},{"type":606,"tag":644,"props":3028,"children":3029},{"class":646,"line":36},[3030,3035],{"type":606,"tag":644,"props":3031,"children":3032},{"style":650},[3033],{"type":612,"value":3034},"    try",{"type":606,"tag":644,"props":3036,"children":3037},{"style":656},[3038],{"type":612,"value":732},{"type":606,"tag":644,"props":3040,"children":3041},{"class":646,"line":45},[3042,3047,3051,3055,3059,3063,3067,3071],{"type":606,"tag":644,"props":3043,"children":3044},{"style":650},[3045],{"type":612,"value":3046},"        with",{"type":606,"tag":644,"props":3048,"children":3049},{"style":687},[3050],{"type":612,"value":690},{"type":606,"tag":644,"props":3052,"children":3053},{"style":656},[3054],{"type":612,"value":2710},{"type":606,"tag":644,"props":3056,"children":3057},{"style":698},[3058],{"type":612,"value":711},{"type":606,"tag":644,"props":3060,"children":3061},{"style":656},[3062],{"type":612,"value":716},{"type":606,"tag":644,"props":3064,"children":3065},{"style":650},[3066],{"type":612,"value":721},{"type":606,"tag":644,"props":3068,"children":3069},{"style":724},[3070],{"type":612,"value":727},{"type":606,"tag":644,"props":3072,"children":3073},{"style":656},[3074],{"type":612,"value":732},{"type":606,"tag":644,"props":3076,"children":3077},{"class":646,"line":54},[3078],{"type":606,"tag":644,"props":3079,"children":3080},{"style":673},[3081],{"type":612,"value":3082},"            # Detect dialect\n",{"type":606,"tag":644,"props":3084,"children":3085},{"class":646,"line":63},[3086,3091,3095,3099,3104,3109],{"type":606,"tag":644,"props":3087,"children":3088},{"style":656},[3089],{"type":612,"value":3090},"            sample ",{"type":606,"tag":644,"props":3092,"children":3093},{"style":650},[3094],{"type":612,"value":745},{"type":606,"tag":644,"props":3096,"children":3097},{"style":724},[3098],{"type":612,"value":727},{"type":606,"tag":644,"props":3100,"children":3101},{"style":656},[3102],{"type":612,"value":3103},".read(",{"type":606,"tag":644,"props":3105,"children":3106},{"style":687},[3107],{"type":612,"value":3108},"1024",{"type":606,"tag":644,"props":3110,"children":3111},{"style":656},[3112],{"type":612,"value":760},{"type":606,"tag":644,"props":3114,"children":3115},{"class":646,"line":72},[3116,3121,3126,3131],{"type":606,"tag":644,"props":3117,"children":3118},{"style":724},[3119],{"type":612,"value":3120},"            file",{"type":606,"tag":644,"props":3122,"children":3123},{"style":656},[3124],{"type":612,"value":3125},".seek(",{"type":606,"tag":644,"props":3127,"children":3128},{"style":687},[3129],{"type":612,"value":3130},"0",{"type":606,"tag":644,"props":3132,"children":3133},{"style":656},[3134],{"type":612,"value":760},{"type":606,"tag":644,"props":3136,"children":3137},{"class":646,"line":81},[3138,3143,3147],{"type":606,"tag":644,"props":3139,"children":3140},{"style":656},[3141],{"type":612,"value":3142},"            dialect ",{"type":606,"tag":644,"props":3144,"children":3145},{"style":650},[3146],{"type":612,"value":745},{"type":606,"tag":644,"props":3148,"children":3149},{"style":656},[3150],{"type":612,"value":3151}," csv.Sniffer().sniff(sample)\n",{"type":606,"tag":644,"props":3153,"children":3154},{"class":646,"line":1117},[3155],{"type":606,"tag":644,"props":3156,"children":3157},{"style":656},[3158],{"type":612,"value":2825},{"type":606,"tag":644,"props":3160,"children":3161},{"class":646,"line":99},[3162,3167,3171,3175,3179],{"type":606,"tag":644,"props":3163,"children":3164},{"style":656},[3165],{"type":612,"value":3166},"            reader ",{"type":606,"tag":644,"props":3168,"children":3169},{"style":650},[3170],{"type":612,"value":745},{"type":606,"tag":644,"props":3172,"children":3173},{"style":656},[3174],{"type":612,"value":750},{"type":606,"tag":644,"props":3176,"children":3177},{"style":724},[3178],{"type":612,"value":755},{"type":606,"tag":644,"props":3180,"children":3181},{"style":656},[3182],{"type":612,"value":3183},", dialect)\n",{"type":606,"tag":644,"props":3185,"children":3186},{"class":646,"line":108},[3187,3192,3196,3201],{"type":606,"tag":644,"props":3188,"children":3189},{"style":656},[3190],{"type":612,"value":3191},"            data ",{"type":606,"tag":644,"props":3193,"children":3194},{"style":650},[3195],{"type":612,"value":745},{"type":606,"tag":644,"props":3197,"children":3198},{"style":687},[3199],{"type":612,"value":3200}," list",{"type":606,"tag":644,"props":3202,"children":3203},{"style":656},[3204],{"type":612,"value":3205},"(reader)\n",{"type":606,"tag":644,"props":3207,"children":3208},{"class":646,"line":117},[3209,3214],{"type":606,"tag":644,"props":3210,"children":3211},{"style":650},[3212],{"type":612,"value":3213},"            return",{"type":606,"tag":644,"props":3215,"children":3216},{"style":656},[3217],{"type":612,"value":3218}," data\n",{"type":606,"tag":644,"props":3220,"children":3221},{"class":646,"line":126},[3222,3227,3232],{"type":606,"tag":644,"props":3223,"children":3224},{"style":650},[3225],{"type":612,"value":3226},"    except",{"type":606,"tag":644,"props":3228,"children":3229},{"style":687},[3230],{"type":612,"value":3231}," FileNotFoundError",{"type":606,"tag":644,"props":3233,"children":3234},{"style":656},[3235],{"type":612,"value":732},{"type":606,"tag":644,"props":3237,"children":3238},{"class":646,"line":135},[3239,3243,3247,3251,3256,3260,3265,3269,3274],{"type":606,"tag":644,"props":3240,"children":3241},{"style":687},[3242],{"type":612,"value":791},{"type":606,"tag":644,"props":3244,"children":3245},{"style":656},[3246],{"type":612,"value":695},{"type":606,"tag":644,"props":3248,"children":3249},{"style":650},[3250],{"type":612,"value":1085},{"type":606,"tag":644,"props":3252,"children":3253},{"style":698},[3254],{"type":612,"value":3255},"\"File ",{"type":606,"tag":644,"props":3257,"children":3258},{"style":687},[3259],{"type":612,"value":1095},{"type":606,"tag":644,"props":3261,"children":3262},{"style":656},[3263],{"type":612,"value":3264},"filename",{"type":606,"tag":644,"props":3266,"children":3267},{"style":687},[3268],{"type":612,"value":1105},{"type":606,"tag":644,"props":3270,"children":3271},{"style":698},[3272],{"type":612,"value":3273}," not found\"",{"type":606,"tag":644,"props":3275,"children":3276},{"style":656},[3277],{"type":612,"value":760},{"type":606,"tag":644,"props":3279,"children":3280},{"class":646,"line":144},[3281,3286],{"type":606,"tag":644,"props":3282,"children":3283},{"style":650},[3284],{"type":612,"value":3285},"        return",{"type":606,"tag":644,"props":3287,"children":3288},{"style":656},[3289],{"type":612,"value":3290}," []\n",{"type":606,"tag":644,"props":3292,"children":3293},{"class":646,"line":153},[3294,3298,3303,3307],{"type":606,"tag":644,"props":3295,"children":3296},{"style":650},[3297],{"type":612,"value":3226},{"type":606,"tag":644,"props":3299,"children":3300},{"style":656},[3301],{"type":612,"value":3302}," csv.Error ",{"type":606,"tag":644,"props":3304,"children":3305},{"style":650},[3306],{"type":612,"value":721},{"type":606,"tag":644,"props":3308,"children":3309},{"style":656},[3310],{"type":612,"value":3311}," e:\n",{"type":606,"tag":644,"props":3313,"children":3314},{"class":646,"line":163},[3315,3319,3323,3327,3332,3336,3341,3345,3349],{"type":606,"tag":644,"props":3316,"children":3317},{"style":687},[3318],{"type":612,"value":791},{"type":606,"tag":644,"props":3320,"children":3321},{"style":656},[3322],{"type":612,"value":695},{"type":606,"tag":644,"props":3324,"children":3325},{"style":650},[3326],{"type":612,"value":1085},{"type":606,"tag":644,"props":3328,"children":3329},{"style":698},[3330],{"type":612,"value":3331},"\"CSV error: ",{"type":606,"tag":644,"props":3333,"children":3334},{"style":687},[3335],{"type":612,"value":1095},{"type":606,"tag":644,"props":3337,"children":3338},{"style":656},[3339],{"type":612,"value":3340},"e",{"type":606,"tag":644,"props":3342,"children":3343},{"style":687},[3344],{"type":612,"value":1105},{"type":606,"tag":644,"props":3346,"children":3347},{"style":698},[3348],{"type":612,"value":1110},{"type":606,"tag":644,"props":3350,"children":3351},{"style":656},[3352],{"type":612,"value":760},{"type":606,"tag":644,"props":3354,"children":3355},{"class":646,"line":172},[3356,3360],{"type":606,"tag":644,"props":3357,"children":3358},{"style":650},[3359],{"type":612,"value":3285},{"type":606,"tag":644,"props":3361,"children":3362},{"style":656},[3363],{"type":612,"value":3290},{"type":606,"tag":644,"props":3365,"children":3366},{"class":646,"line":181},[3367],{"type":606,"tag":644,"props":3368,"children":3369},{"emptyLinePlaceholder":13},[3370],{"type":612,"value":667},{"type":606,"tag":644,"props":3372,"children":3373},{"class":646,"line":190},[3374],{"type":606,"tag":644,"props":3375,"children":3376},{"style":673},[3377],{"type":612,"value":3378},"# Test the function\n",{"type":606,"tag":644,"props":3380,"children":3381},{"class":646,"line":199},[3382,3387,3391,3396,3400],{"type":606,"tag":644,"props":3383,"children":3384},{"style":656},[3385],{"type":612,"value":3386},"data ",{"type":606,"tag":644,"props":3388,"children":3389},{"style":650},[3390],{"type":612,"value":745},{"type":606,"tag":644,"props":3392,"children":3393},{"style":656},[3394],{"type":612,"value":3395}," safe_csv_read(",{"type":606,"tag":644,"props":3397,"children":3398},{"style":698},[3399],{"type":612,"value":701},{"type":606,"tag":644,"props":3401,"children":3402},{"style":656},[3403],{"type":612,"value":760},{"type":606,"tag":644,"props":3405,"children":3406},{"class":646,"line":208},[3407,3411,3415,3419,3424,3429,3434,3438,3442],{"type":606,"tag":644,"props":3408,"children":3409},{"style":687},[3410],{"type":612,"value":961},{"type":606,"tag":644,"props":3412,"children":3413},{"style":656},[3414],{"type":612,"value":695},{"type":606,"tag":644,"props":3416,"children":3417},{"style":650},[3418],{"type":612,"value":1085},{"type":606,"tag":644,"props":3420,"children":3421},{"style":698},[3422],{"type":612,"value":3423},"\"Read ",{"type":606,"tag":644,"props":3425,"children":3426},{"style":687},[3427],{"type":612,"value":3428},"{len",{"type":606,"tag":644,"props":3430,"children":3431},{"style":656},[3432],{"type":612,"value":3433},"(data)",{"type":606,"tag":644,"props":3435,"children":3436},{"style":687},[3437],{"type":612,"value":1105},{"type":606,"tag":644,"props":3439,"children":3440},{"style":698},[3441],{"type":612,"value":2909},{"type":606,"tag":644,"props":3443,"children":3444},{"style":656},[3445],{"type":612,"value":760},{"type":606,"tag":912,"props":3447,"children":3449},{"id":3448},"format-conversion",[3450],{"type":612,"value":3451},"Format Conversion",{"type":606,"tag":630,"props":3453,"children":3454},{},[3455],{"type":606,"tag":634,"props":3456,"children":3458},{"className":636,"code":3457,"language":638,"meta":8,"style":8},"# Converting between CSV and other formats\ndef csv_to_dict_list(filename):\n    \"\"\"Convert CSV to list of dictionaries\"\"\"\n    with open(filename, 'r') as file:\n        reader = csv.DictReader(file)\n        return list(reader)\n\ndef dict_list_to_csv(data, filename):\n    \"\"\"Convert list of dictionaries to CSV\"\"\"\n    if not data:\n        return\n    \n    with open(filename, 'w', newline='') as file:\n        fieldnames = data[0].keys()\n        writer = csv.DictWriter(file, fieldnames=fieldnames)\n        writer.writeheader()\n        writer.writerows(data)\n\n# Example usage (when files exist)\n# students = csv_to_dict_list('students.csv')\n# dict_list_to_csv(students, 'backup.csv')\nprint(\"CSV conversion functions defined\")\n",[3459],{"type":606,"tag":621,"props":3460,"children":3461},{"__ignoreMap":8},[3462,3470,3486,3494,3529,3552,3567,3574,3591,3599,3617,3625,3632,3683,3709,3745,3753,3761,3768,3776,3784,3792],{"type":606,"tag":644,"props":3463,"children":3464},{"class":646,"line":12},[3465],{"type":606,"tag":644,"props":3466,"children":3467},{"style":673},[3468],{"type":612,"value":3469},"# Converting between CSV and other formats\n",{"type":606,"tag":644,"props":3471,"children":3472},{"class":646,"line":27},[3473,3477,3482],{"type":606,"tag":644,"props":3474,"children":3475},{"style":650},[3476],{"type":612,"value":2632},{"type":606,"tag":644,"props":3478,"children":3479},{"style":2635},[3480],{"type":612,"value":3481}," csv_to_dict_list",{"type":606,"tag":644,"props":3483,"children":3484},{"style":656},[3485],{"type":612,"value":2643},{"type":606,"tag":644,"props":3487,"children":3488},{"class":646,"line":36},[3489],{"type":606,"tag":644,"props":3490,"children":3491},{"style":698},[3492],{"type":612,"value":3493},"    \"\"\"Convert CSV to list of dictionaries\"\"\"\n",{"type":606,"tag":644,"props":3495,"children":3496},{"class":646,"line":45},[3497,3501,3505,3509,3513,3517,3521,3525],{"type":606,"tag":644,"props":3498,"children":3499},{"style":650},[3500],{"type":612,"value":2701},{"type":606,"tag":644,"props":3502,"children":3503},{"style":687},[3504],{"type":612,"value":690},{"type":606,"tag":644,"props":3506,"children":3507},{"style":656},[3508],{"type":612,"value":2710},{"type":606,"tag":644,"props":3510,"children":3511},{"style":698},[3512],{"type":612,"value":711},{"type":606,"tag":644,"props":3514,"children":3515},{"style":656},[3516],{"type":612,"value":716},{"type":606,"tag":644,"props":3518,"children":3519},{"style":650},[3520],{"type":612,"value":721},{"type":606,"tag":644,"props":3522,"children":3523},{"style":724},[3524],{"type":612,"value":727},{"type":606,"tag":644,"props":3526,"children":3527},{"style":656},[3528],{"type":612,"value":732},{"type":606,"tag":644,"props":3530,"children":3531},{"class":646,"line":54},[3532,3536,3540,3544,3548],{"type":606,"tag":644,"props":3533,"children":3534},{"style":656},[3535],{"type":612,"value":2738},{"type":606,"tag":644,"props":3537,"children":3538},{"style":650},[3539],{"type":612,"value":745},{"type":606,"tag":644,"props":3541,"children":3542},{"style":656},[3543],{"type":612,"value":1307},{"type":606,"tag":644,"props":3545,"children":3546},{"style":724},[3547],{"type":612,"value":755},{"type":606,"tag":644,"props":3549,"children":3550},{"style":656},[3551],{"type":612,"value":760},{"type":606,"tag":644,"props":3553,"children":3554},{"class":646,"line":63},[3555,3559,3563],{"type":606,"tag":644,"props":3556,"children":3557},{"style":650},[3558],{"type":612,"value":3285},{"type":606,"tag":644,"props":3560,"children":3561},{"style":687},[3562],{"type":612,"value":3200},{"type":606,"tag":644,"props":3564,"children":3565},{"style":656},[3566],{"type":612,"value":3205},{"type":606,"tag":644,"props":3568,"children":3569},{"class":646,"line":72},[3570],{"type":606,"tag":644,"props":3571,"children":3572},{"emptyLinePlaceholder":13},[3573],{"type":612,"value":667},{"type":606,"tag":644,"props":3575,"children":3576},{"class":646,"line":81},[3577,3581,3586],{"type":606,"tag":644,"props":3578,"children":3579},{"style":650},[3580],{"type":612,"value":2632},{"type":606,"tag":644,"props":3582,"children":3583},{"style":2635},[3584],{"type":612,"value":3585}," dict_list_to_csv",{"type":606,"tag":644,"props":3587,"children":3588},{"style":656},[3589],{"type":612,"value":3590},"(data, filename):\n",{"type":606,"tag":644,"props":3592,"children":3593},{"class":646,"line":1117},[3594],{"type":606,"tag":644,"props":3595,"children":3596},{"style":698},[3597],{"type":612,"value":3598},"    \"\"\"Convert list of dictionaries to CSV\"\"\"\n",{"type":606,"tag":644,"props":3600,"children":3601},{"class":646,"line":99},[3602,3607,3612],{"type":606,"tag":644,"props":3603,"children":3604},{"style":650},[3605],{"type":612,"value":3606},"    if",{"type":606,"tag":644,"props":3608,"children":3609},{"style":650},[3610],{"type":612,"value":3611}," not",{"type":606,"tag":644,"props":3613,"children":3614},{"style":656},[3615],{"type":612,"value":3616}," data:\n",{"type":606,"tag":644,"props":3618,"children":3619},{"class":646,"line":108},[3620],{"type":606,"tag":644,"props":3621,"children":3622},{"style":650},[3623],{"type":612,"value":3624},"        return\n",{"type":606,"tag":644,"props":3626,"children":3627},{"class":646,"line":117},[3628],{"type":606,"tag":644,"props":3629,"children":3630},{"style":656},[3631],{"type":612,"value":1123},{"type":606,"tag":644,"props":3633,"children":3634},{"class":646,"line":126},[3635,3639,3643,3647,3651,3655,3659,3663,3667,3671,3675,3679],{"type":606,"tag":644,"props":3636,"children":3637},{"style":650},[3638],{"type":612,"value":2701},{"type":606,"tag":644,"props":3640,"children":3641},{"style":687},[3642],{"type":612,"value":690},{"type":606,"tag":644,"props":3644,"children":3645},{"style":656},[3646],{"type":612,"value":2710},{"type":606,"tag":644,"props":3648,"children":3649},{"style":698},[3650],{"type":612,"value":1659},{"type":606,"tag":644,"props":3652,"children":3653},{"style":656},[3654],{"type":612,"value":706},{"type":606,"tag":644,"props":3656,"children":3657},{"style":724},[3658],{"type":612,"value":1668},{"type":606,"tag":644,"props":3660,"children":3661},{"style":650},[3662],{"type":612,"value":745},{"type":606,"tag":644,"props":3664,"children":3665},{"style":698},[3666],{"type":612,"value":1677},{"type":606,"tag":644,"props":3668,"children":3669},{"style":656},[3670],{"type":612,"value":716},{"type":606,"tag":644,"props":3672,"children":3673},{"style":650},[3674],{"type":612,"value":721},{"type":606,"tag":644,"props":3676,"children":3677},{"style":724},[3678],{"type":612,"value":727},{"type":606,"tag":644,"props":3680,"children":3681},{"style":656},[3682],{"type":612,"value":732},{"type":606,"tag":644,"props":3684,"children":3685},{"class":646,"line":135},[3686,3691,3695,3700,3704],{"type":606,"tag":644,"props":3687,"children":3688},{"style":656},[3689],{"type":612,"value":3690},"        fieldnames ",{"type":606,"tag":644,"props":3692,"children":3693},{"style":650},[3694],{"type":612,"value":745},{"type":606,"tag":644,"props":3696,"children":3697},{"style":656},[3698],{"type":612,"value":3699}," data[",{"type":606,"tag":644,"props":3701,"children":3702},{"style":687},[3703],{"type":612,"value":3130},{"type":606,"tag":644,"props":3705,"children":3706},{"style":656},[3707],{"type":612,"value":3708},"].keys()\n",{"type":606,"tag":644,"props":3710,"children":3711},{"class":646,"line":144},[3712,3717,3721,3725,3729,3733,3737,3741],{"type":606,"tag":644,"props":3713,"children":3714},{"style":656},[3715],{"type":612,"value":3716},"        writer ",{"type":606,"tag":644,"props":3718,"children":3719},{"style":650},[3720],{"type":612,"value":745},{"type":606,"tag":644,"props":3722,"children":3723},{"style":656},[3724],{"type":612,"value":2087},{"type":606,"tag":644,"props":3726,"children":3727},{"style":724},[3728],{"type":612,"value":755},{"type":606,"tag":644,"props":3730,"children":3731},{"style":656},[3732],{"type":612,"value":706},{"type":606,"tag":644,"props":3734,"children":3735},{"style":724},[3736],{"type":612,"value":2100},{"type":606,"tag":644,"props":3738,"children":3739},{"style":650},[3740],{"type":612,"value":745},{"type":606,"tag":644,"props":3742,"children":3743},{"style":656},[3744],{"type":612,"value":2109},{"type":606,"tag":644,"props":3746,"children":3747},{"class":646,"line":153},[3748],{"type":606,"tag":644,"props":3749,"children":3750},{"style":656},[3751],{"type":612,"value":3752},"        writer.writeheader()\n",{"type":606,"tag":644,"props":3754,"children":3755},{"class":646,"line":163},[3756],{"type":606,"tag":644,"props":3757,"children":3758},{"style":656},[3759],{"type":612,"value":3760},"        writer.writerows(data)\n",{"type":606,"tag":644,"props":3762,"children":3763},{"class":646,"line":172},[3764],{"type":606,"tag":644,"props":3765,"children":3766},{"emptyLinePlaceholder":13},[3767],{"type":612,"value":667},{"type":606,"tag":644,"props":3769,"children":3770},{"class":646,"line":181},[3771],{"type":606,"tag":644,"props":3772,"children":3773},{"style":673},[3774],{"type":612,"value":3775},"# Example usage (when files exist)\n",{"type":606,"tag":644,"props":3777,"children":3778},{"class":646,"line":190},[3779],{"type":606,"tag":644,"props":3780,"children":3781},{"style":673},[3782],{"type":612,"value":3783},"# students = csv_to_dict_list('students.csv')\n",{"type":606,"tag":644,"props":3785,"children":3786},{"class":646,"line":199},[3787],{"type":606,"tag":644,"props":3788,"children":3789},{"style":673},[3790],{"type":612,"value":3791},"# dict_list_to_csv(students, 'backup.csv')\n",{"type":606,"tag":644,"props":3793,"children":3794},{"class":646,"line":208},[3795,3799,3803,3808],{"type":606,"tag":644,"props":3796,"children":3797},{"style":687},[3798],{"type":612,"value":961},{"type":606,"tag":644,"props":3800,"children":3801},{"style":656},[3802],{"type":612,"value":695},{"type":606,"tag":644,"props":3804,"children":3805},{"style":698},[3806],{"type":612,"value":3807},"\"CSV conversion functions defined\"",{"type":606,"tag":644,"props":3809,"children":3810},{"style":656},[3811],{"type":612,"value":760},{"type":606,"tag":798,"props":3813,"children":3815},{"id":3814},"csv-parameters-reference-table",[3816],{"type":612,"value":3817},"📋 CSV Parameters Reference Table",{"type":606,"tag":3819,"props":3820,"children":3821},"table",{},[3822,3846],{"type":606,"tag":3823,"props":3824,"children":3825},"thead",{},[3826],{"type":606,"tag":3827,"props":3828,"children":3829},"tr",{},[3830,3836,3841],{"type":606,"tag":3831,"props":3832,"children":3833},"th",{},[3834],{"type":612,"value":3835},"Parameter",{"type":606,"tag":3831,"props":3837,"children":3838},{},[3839],{"type":612,"value":3840},"Purpose",{"type":606,"tag":3831,"props":3842,"children":3843},{},[3844],{"type":612,"value":3845},"Common Values",{"type":606,"tag":3847,"props":3848,"children":3849},"tbody",{},[3850,3889,3920,3953,3986],{"type":606,"tag":3827,"props":3851,"children":3852},{},[3853,3862,3867],{"type":606,"tag":3854,"props":3855,"children":3856},"td",{},[3857],{"type":606,"tag":621,"props":3858,"children":3860},{"className":3859},[],[3861],{"type":612,"value":2293},{"type":606,"tag":3854,"props":3863,"children":3864},{},[3865],{"type":612,"value":3866},"Field separator",{"type":606,"tag":3854,"props":3868,"children":3869},{},[3870,3876,3877,3882,3883],{"type":606,"tag":621,"props":3871,"children":3873},{"className":3872},[],[3874],{"type":612,"value":3875},"','",{"type":612,"value":706},{"type":606,"tag":621,"props":3878,"children":3880},{"className":3879},[],[3881],{"type":612,"value":2302},{"type":612,"value":706},{"type":606,"tag":621,"props":3884,"children":3886},{"className":3885},[],[3887],{"type":612,"value":3888},"'\\t'",{"type":606,"tag":3827,"props":3890,"children":3891},{},[3892,3900,3905],{"type":606,"tag":3854,"props":3893,"children":3894},{},[3895],{"type":606,"tag":621,"props":3896,"children":3898},{"className":3897},[],[3899],{"type":612,"value":2311},{"type":606,"tag":3854,"props":3901,"children":3902},{},[3903],{"type":612,"value":3904},"Quote character",{"type":606,"tag":3854,"props":3906,"children":3907},{},[3908,3913,3914],{"type":606,"tag":621,"props":3909,"children":3911},{"className":3910},[],[3912],{"type":612,"value":2320},{"type":612,"value":706},{"type":606,"tag":621,"props":3915,"children":3917},{"className":3916},[],[3918],{"type":612,"value":3919},"\"'\"",{"type":606,"tag":3827,"props":3921,"children":3922},{},[3923,3932,3937],{"type":606,"tag":3854,"props":3924,"children":3925},{},[3926],{"type":606,"tag":621,"props":3927,"children":3929},{"className":3928},[],[3930],{"type":612,"value":3931},"quoting",{"type":606,"tag":3854,"props":3933,"children":3934},{},[3935],{"type":612,"value":3936},"Quote behavior",{"type":606,"tag":3854,"props":3938,"children":3939},{},[3940,3946,3947],{"type":606,"tag":621,"props":3941,"children":3943},{"className":3942},[],[3944],{"type":612,"value":3945},"csv.QUOTE_MINIMAL",{"type":612,"value":706},{"type":606,"tag":621,"props":3948,"children":3950},{"className":3949},[],[3951],{"type":612,"value":3952},"csv.QUOTE_ALL",{"type":606,"tag":3827,"props":3954,"children":3955},{},[3956,3965,3970],{"type":606,"tag":3854,"props":3957,"children":3958},{},[3959],{"type":606,"tag":621,"props":3960,"children":3962},{"className":3961},[],[3963],{"type":612,"value":3964},"lineterminator",{"type":606,"tag":3854,"props":3966,"children":3967},{},[3968],{"type":612,"value":3969},"Line ending",{"type":606,"tag":3854,"props":3971,"children":3972},{},[3973,3979,3980],{"type":606,"tag":621,"props":3974,"children":3976},{"className":3975},[],[3977],{"type":612,"value":3978},"'\\n'",{"type":612,"value":706},{"type":606,"tag":621,"props":3981,"children":3983},{"className":3982},[],[3984],{"type":612,"value":3985},"'\\r\\n'",{"type":606,"tag":3827,"props":3987,"children":3988},{},[3989,3998,4003],{"type":606,"tag":3854,"props":3990,"children":3991},{},[3992],{"type":606,"tag":621,"props":3993,"children":3995},{"className":3994},[],[3996],{"type":612,"value":3997},"skipinitialspace",{"type":606,"tag":3854,"props":3999,"children":4000},{},[4001],{"type":612,"value":4002},"Skip spaces after delimiter",{"type":606,"tag":3854,"props":4004,"children":4005},{},[4006,4012,4013],{"type":606,"tag":621,"props":4007,"children":4009},{"className":4008},[],[4010],{"type":612,"value":4011},"True",{"type":612,"value":706},{"type":606,"tag":621,"props":4014,"children":4016},{"className":4015},[],[4017],{"type":612,"value":4018},"False",{"type":606,"tag":798,"props":4020,"children":4022},{"id":4021},"key-takeaways",[4023],{"type":612,"value":4024},"🎯 Key Takeaways",{"type":606,"tag":810,"props":4026,"children":4030},{"emoji":4027,"title":4028,"type":4029},"📚","CSV Handling Essentials","success",[4031,4039,4087,4095,4117,4125,4156],{"type":606,"tag":615,"props":4032,"children":4033},{},[4034],{"type":606,"tag":820,"props":4035,"children":4036},{},[4037],{"type":612,"value":4038},"Basic Operations:",{"type":606,"tag":826,"props":4040,"children":4041},{},[4042,4054,4065,4076],{"type":606,"tag":830,"props":4043,"children":4044},{},[4045,4047,4052],{"type":612,"value":4046},"Use ",{"type":606,"tag":621,"props":4048,"children":4050},{"className":4049},[],[4051],{"type":612,"value":838},{"type":612,"value":4053}," for simple reading",{"type":606,"tag":830,"props":4055,"children":4056},{},[4057,4058,4063],{"type":612,"value":4046},{"type":606,"tag":621,"props":4059,"children":4061},{"className":4060},[],[4062],{"type":612,"value":849},{"type":612,"value":4064}," for named columns",{"type":606,"tag":830,"props":4066,"children":4067},{},[4068,4069,4074],{"type":612,"value":4046},{"type":606,"tag":621,"props":4070,"children":4072},{"className":4071},[],[4073],{"type":612,"value":871},{"type":612,"value":4075}," for simple writing",{"type":606,"tag":830,"props":4077,"children":4078},{},[4079,4080,4085],{"type":612,"value":4046},{"type":606,"tag":621,"props":4081,"children":4083},{"className":4082},[],[4084],{"type":612,"value":882},{"type":612,"value":4086}," for structured data",{"type":606,"tag":615,"props":4088,"children":4089},{},[4090],{"type":606,"tag":820,"props":4091,"children":4092},{},[4093],{"type":612,"value":4094},"Advanced Features:",{"type":606,"tag":826,"props":4096,"children":4097},{},[4098,4102,4107,4112],{"type":606,"tag":830,"props":4099,"children":4100},{},[4101],{"type":612,"value":905},{"type":606,"tag":830,"props":4103,"children":4104},{},[4105],{"type":612,"value":4106},"Dialect detection",{"type":606,"tag":830,"props":4108,"children":4109},{},[4110],{"type":612,"value":4111},"Large file processing",{"type":606,"tag":830,"props":4113,"children":4114},{},[4115],{"type":612,"value":4116},"Error handling",{"type":606,"tag":615,"props":4118,"children":4119},{},[4120],{"type":606,"tag":820,"props":4121,"children":4122},{},[4123],{"type":612,"value":4124},"Best Practices:",{"type":606,"tag":826,"props":4126,"children":4127},{},[4128,4141,4146,4151],{"type":606,"tag":830,"props":4129,"children":4130},{},[4131,4133,4139],{"type":612,"value":4132},"Always use ",{"type":606,"tag":621,"props":4134,"children":4136},{"className":4135},[],[4137],{"type":612,"value":4138},"newline=''",{"type":612,"value":4140}," when writing",{"type":606,"tag":830,"props":4142,"children":4143},{},[4144],{"type":612,"value":4145},"Handle encoding issues",{"type":606,"tag":830,"props":4147,"children":4148},{},[4149],{"type":612,"value":4150},"Validate data before processing",{"type":606,"tag":830,"props":4152,"children":4153},{},[4154],{"type":612,"value":4155},"Use appropriate reader/writer for your needs",{"type":606,"tag":615,"props":4157,"children":4158},{},[4159,4164],{"type":606,"tag":820,"props":4160,"children":4161},{},[4162],{"type":612,"value":4163},"Remember:",{"type":612,"value":4165}," CSV files can have different formats - always check the delimiter and structure!",{"type":606,"tag":4167,"props":4168,"children":4169},"style",{},[4170],{"type":612,"value":4171},"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":8,"searchDepth":36,"depth":36,"links":4173},[4174,4178,4184,4185],{"id":800,"depth":27,"text":803,"children":4175},[4176,4177],{"id":914,"depth":36,"text":917},{"id":1441,"depth":36,"text":1444},{"id":2155,"depth":27,"text":2158,"children":4179},[4180,4181,4182,4183],{"id":2166,"depth":36,"text":2169},{"id":2574,"depth":36,"text":2577},{"id":2989,"depth":36,"text":2992},{"id":3448,"depth":36,"text":3451},{"id":3814,"depth":27,"text":3817},{"id":4021,"depth":27,"text":4024},1782373756747]