Conversely, if you have lists and dicts in Python, you can serialize them to be stored as text, which means you can port your data objects in such a way that someone else can deserialize and import them for their own programs.īasically, all of what we learn here are the steps needed to turn raw text into data objects, and as far as we’re concerned, it’s just more libraries and functions to remember. If you can open a text file for reading, you can convert it into data via csv‘s methods. The csv library is Python’s built-in, no-fuss way of turning raw text into a list of lists, or list of dicts. But when there is structure, then we can turn text into data objects – particularly, lists and dictionaries – that we can use in our programs. ![]() It needs to be structured text – text without structure is just noise. ![]() ![]() However, it’s not just raw text that we want. What is deserialization and serialization ¶īefore moving on to the specifics of CSV, it’s important to see the big picture.Īs I’ve said from the very beginning, virtually all of the important data we deal with comes as plain text, whether it is:
0 Comments
Leave a Reply. |