Skip to Content
Numerical Computing with Python
book

Numerical Computing with Python

by Pratap Dangeti, Allen Yu, Claire Chung, Aldrin Yim
December 2018
Beginner to intermediate
682 pages
18h 1m
English
Packt Publishing
Content preview from Numerical Computing with Python

How to do it...

  1. Read the movie dataset, set the movie title as the index, and select all the values in the actor_1_facebook_likes column that are not missing:
>>> movie = pd.read_csv('data/movie.csv', index_col='movie_title')>>> fb_likes = movie['actor_1_facebook_likes'].dropna()>>> fb_likes.head()movie_title
Avatar                                         1000.0
Pirates of the Caribbean: At World's End      40000.0
Spectre                                       11000.0
The Dark Knight Rises                         27000.0
Star Wars: Episode VII - The Force Awakens      131.0
Name: actor_1_facebook_likes, dtype: float64
  1. Let's use the describe method to get a sense of the distribution:
>>> fb_likes.describe(percentiles=[.1, .25, .5, .75, .9]) \            .astype(int)count 4909 mean 6494 std 15106 min 0 10% 240 25% 607 50% 982 75% 11000 90% 18000 max 640000 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Numerical Computing with NumPy

Mastering Numerical Computing with NumPy

Umit Mert Cakmak, Tiago Antao, Mert Cuhadaroglu

Publisher Resources

ISBN: 9781789953633OtherOtherErrata Page