Your Cart
Loading

Code Clinic - HL7 Lab - Book 5: Slicing

On Sale
$10.00
$10.00
Added to cart

Indexing gives one item, slicing gives a whole range. The square brackets take a start and a stop, and the first thing this book settles is the stop everyone trips over, the one that is not included, so a slice from zero to three hands you three items and not four. Once that is clear the shortcuts follow. Leave the start out and Python begins at the beginning, leave the stop out and it runs to the end, and use a negative number to count in from the back so the last few characters of a field are one short expression away. A step lets you take every second item, and a step of minus one reverses the whole thing. One chapter explains what a slice really is, a brand new list rather than a window onto the old one, which matters the moment you change what you sliced. Then the payoff: slicing a string turns 19950310 into a year, a month and a day you can print as a real date of birth, and slicing a list of fields pulls one related group of HL7 values out in a single move.


Eighteen A4 pages, in full color. 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.


You will get a PDF (815KB) file