Analyzing Police Activity with pandas
Kevin Markham
Founder, Data School
ri.dtypes
stop_date object
stop_time object
driver_gender object
... ...
stop_duration object
drugs_related_stop bool
district object
object: Python strings (or other Python objects)bool: True and False valuesint, float, datetime, categoryint, float: enables mathematical operationsdatetime: enables date-based attributes and methodscategory: uses less memory and runs fasterbool: enables logical and mathematical operationsapple
date time price
0 2/13/18 16:00 164.34
1 2/14/18 16:00 167.37
2 2/15/18 16:00 172.99
apple.price.dtype
dtype('O')
apple['price'] =
apple.price.astype('float')
apple.price.dtype
dtype('float64')
apple.priceapple['price']Analyzing Police Activity with pandas