Question: The attribute ` shape ` tells you how many rows and columns are in a DataFrame. ( An attribute, or a property, is not a

The attribute `shape` tells you how many rows and columns are in a DataFrame. (An attribute, or a property, is not a method and is not called using parentheses.)
imdb_by_name.shape
Like an array, you can get the first element of the shape using `[0]`, and the second element using `[1]`. For instance, the number of rows in `imdb_by_name` is:
imdb_by_name.shape[0]
We can use this to answer "How many movies are from the 20th century?":
imdb_by_name[imdb_by_name.get('Year')<=2000].shape[0]
**Question 4.4.** Use `shape`(and arithmetic) to find the *proportion* of movies in the dataset from the 20th century, and the proportion from the 21st century.
proportion_in_20th_century = imdb_by_name[imdb_by_name.get('Year')<=2000].shape
proportion_in_20th_century

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!