Introduction to Data Analysis in Python

In [1]:
import pandas as pd

tips = pd.read_csv("https://milliams.com/courses/data_analysis_python/tips.csv")
In [2]:
tips["bill_per_person"] = tips["total_bill"] / tips["size"]
tips
Out[2]:
total_bill tip day time size bill_per_person
0 16.99 0.71 Sun Dinner 2 8.495000
1 10.34 1.16 Sun Dinner 3 3.446667
2 21.01 2.45 Sun Dinner 3 7.003333
3 23.68 2.32 Sun Dinner 2 11.840000
4 24.59 2.53 Sun Dinner 4 6.147500
... ... ... ... ... ... ...
239 29.03 4.14 Sat Dinner 3 9.676667
240 27.18 1.40 Sat Dinner 2 13.590000
241 22.67 1.40 Sat Dinner 2 11.335000
242 17.82 1.22 Sat Dinner 2 8.910000
243 18.78 2.10 Thur Dinner 2 9.390000

244 rows × 6 columns