Early Release of Data Science for Crime Analysis with Python Book
I have been asked by many people over the past year “what resource do you recommend to get started in python”. To fill that gap, I am developing a book aimed specifically for crime analysts – Data Science for Crime Analysis with Python. Check out the CRIME De-Coder store to purchase an epub or paperback copy of the book.
Keep reading to see details on why I am writing this book and a preview of the first two chapters.
Why I don’t have a current recommendation
There are many free, online resources for python. I don’t recommend them though for beginner crime analysts or current graduate students in criminal justice.
For example, I think the W3 school resources are good once you know what you are looking for. The other day I was looking up class inheritance, and I think the article does a very nice job.
Many online tutorials have the what I call the "Hello World" problem – there are a series of steps you need to do before you can even run a simple hello world program. The W3 resources are good for refreshers or people who have already crossed that hurdle. Most beginners though don’t even know where to start.
The second issue with many beginner resources is "you don’t know what you don’t know". When you are a very new beginner to the topic, you need outside guidance as to what to focus your time on. The first book on python I picked up in grad school was Magnus Hetland’s Beginning Python. It is not a bad book, but it is encyclopedic. Nearly 50% of the book is on topical material beginner data analysts don’t need to know (it simultaneously does not cover the “Hello World” problem either). It also lacks realistic complete project examples. The majority of current beginner resources are both too broad and to narrow for those in data analysis fields looking to get started in python.
The final issue I have with many beginner resources is that they do not cover things essential to be able to effectively deploy code in a realistic environment. OK so you wrote some python functions, how do you run the code? How do you organize the code? How do you set up a python environment? Most graduate students with a masters in data science only know how to start up a Jupyter notebook (or even worse, just run a Google Collab notebook), and are woefully unprepared to contribute to a professional coding environment.
I know why many resources avoid these topics – they are very difficult to articulate in a coherent way. It takes a million screenshots, detailed instructions, and discussion of system differences that can potentially cause hiccups for beginners. These skills are not writing python code directly, but are part of the necessary foundation to be able to effectively use code to make your job as a crime analyst easier.
Early Release of my Python Book
So, to aid in my courses I am developing for crime analysts, I have started creating a book, Data Science for Crime Analysis with Python. To get a feel for the content of the book, I have released the preface and Chapters 1 & 2:
If on mobile, you can read that at this link.
The book is intended to solve the basics for what you need to focus on, as well as the greater project management stuff. For a rundown of the topical material in the book:
- Getting started
- How to download python, and run simple scripts from the command line
- overview of basic python objects (strings, numbers, lists, dictionaries)
- operations on those objects (conditionals, loops)
- creating your own functions
- Intro to Data Analysis
- using numpy and pandas to work with tabular data
- an intro to using SQL to query databases
- making graphs with matplotlib
- using Jupyter notebooks to create reports
- project organization & automating workflows
For those interested in a pre-release copy, see my CRIME De-Coder store. Since I get asked for help getting started so frequently, I will offer to those interested $20 to get a current, in development copy. And will provide the updated chapters as I finish them (expect to be finished in the early 2024). One can see the current development of the book in the table of contents released above.
The finalized book is out now, but with self-publishing I can update as often as I want. So any feedback (or suggestions for future books) is appreciated. For educators interested in adopting this book for your courses feel free to get in touch as well, as I can offer discounts for larger purchases.