19.1. Data and PythonΒΆ
Although SQL gives us powerful tools for querying data that is stored in a database, programmers often need to work with data in other languages. If our data is coming from somewhere like a file or a web site, it is not in a database, so there is nothing to issue SQL instructions to. Or maybe we need to manipulate the data using some complex logic - we want to find telephone numbers in a wide range of formats like β5031231234β or β503 123-1234β or β(503) 123 1234β and turn them into something standard like β503-123-1234β. SQL excels at basic filtering and aggregation, but it can be difficult to express more complex algorithms in it.
For situations like these, programmers will use Python or some other general purpose programming language to work with their data. In this chapter we will look at how that is done.