Code Clinic - The Build - Book 5: Pandas DataFrames
One patient chart is a table, not a list. Pandas starts there, and so does this book, setting the DataFrame against the NumPy array so you know which tool suits which job: arrays for one column of numbers, DataFrames for many columns of mixed text and numbers. You build a DataFrame, then learn the small set of commands that let you look at it properly and check what you have before trusting anything you compute from it. Adding a calculated column comes next, so a derived value sits alongside the data it came from. Filtering rows follows, keeping only the records that meet a condition you set. Then groupby, which folds a long table down into a short summary with one row per group and answers questions such as how many results each test produced. The closing chapter feeds parsed HL7 records into a DataFrame, turning a stack of messages into a table you can question. Healthcare data work happens in tables, and this is the tool for them.
Seventeen A4 pages, in full colour. Written in short sentences and plain English, for readers whose first language is not English and clearer for everyone else because of it.
Every code example in this book was run before the page was printed, so the output you read is the output you get. Instant PDF download. By M.R. Sterling.