Agentic AI

Python for data and apps

NumPy, pandas and plotting, SQLite, logging, and small web apps with Flask and Streamlit.

Python's libraries for data and small apps: NumPy arrays and pandas tables, charts with Matplotlib and Seaborn, a SQLite database and logging, then web apps with Flask and Streamlit. Run the notebook cells in order; the Flask and Streamlit lessons run scripts from a terminal. Try each practice task before you open its solution.

Lessons

  1. 1NumPy arraysCreate arrays, read their shape, compute on whole arrays, slice rows and columns, and pick values with a condition.
  2. 2pandas: Series and DataFramesBuild Series and DataFrames, read and change rows and columns with loc, iloc, at and iat, and load a CSV file.
  3. 3Cleaning and summarising dataFind and fill missing values, rename columns and fix types, filter and sort rows, summarise groups with groupby, and join tables with merge.
  4. 4Reading and writing dataRead JSON text, a CSV file from a URL, tables from a web page and an Excel workbook, and write DataFrames back to JSON, CSV, Excel and pickle.
  5. 5Plotting with MatplotlibLine plots and their styles, several plots in one figure, bar charts, histograms, scatter plots and pie charts, and plotting a DataFrame.
  6. 6Statistical plots with SeabornScatter and line plots, bar, box and violin plots per category, histograms and density curves, a pairplot and a correlation heatmap.
  7. 7SQLite databasesCreate a table, insert, query, update and delete rows, commit transactions, pass values safely with placeholders, and close the connection.
  8. 8LoggingLog levels, basicConfig with a format and a log file, named loggers with their own levels, and one logging setup shared by every module.
  9. 9Flask: routes and templatesA first Flask app, routes, the development server and debug mode, HTML responses and templates from a templates folder.
  10. 10Flask: forms, URL variables and JinjaHandle GET and POST, read form fields safely, take typed values from the URL, fill templates with {{ }}, {% if %} and {% for %}, and redirect after a form.
  11. 11Flask: a JSON APIBuild a to-do API with GET, POST, PUT and DELETE routes, return JSON with jsonify, read JSON bodies with request.json, and call it from Python with requests.
  12. 12Streamlit appsRun a Streamlit app, show text, tables and charts, take input with widgets, and understand why the whole script reruns on every change.