#!/usr/bin/env python # coding: utf-8 # Global Shark Bite Database # from: https://www.sharks.org/global-shark-attack-file # # In[2]: #import the pandas library import pandas as pd #read the data df = pd.read_csv('Global_Shark.csv') df[:50] # In[3]: df.dtypes # How many bites occurred in Florida and the activity involved sharks? # In[4]: florida = df.loc[ (df.Area == "Florida") & (df.Activity.str.contains("sharks", na=False, case=False))] florida # In[5]: df.loc[1160] # In[18]: counts = df.Activity.value_counts() counts[0:20].plot(kind="pie")