Lesson 5 of 38 · Written learning
Arrays, APIs, and version control
Connect numerical data, web requests, and software history.
NumPy arrays store numerical values in a regular shape. An array with shape `(3, 4)` has three rows and four columns. Vectorized operations apply to whole arrays and are often clearer and faster than writing a Python loop for every number. Always check shape and data type before combining arrays.
Software can ask software for data
An HTTP API exposes a documented request-and-response contract. A request can have a method, a path, headers, and data; a response has a status and may contain JSON. Check for errors before treating a response as valid. Store credentials in environment variables or a secrets manager, not in source code. Git commits preserve useful history; dependencies should be recorded so another environment can recreate the setup.
- Inspect an array's shape before matrix multiplication.
- Handle network failures and non-success status codes explicitly.
- Never commit a real API key; rotate one immediately if it is exposed.
- Use a small `.gitignore` for local environments, notebooks with secrets, and generated files.
Return to the Python and software foundations stage · Suggested timing is flexible; move at your own pace.