Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

15. Identify the rescue from without in The Empire Strikes Back.

Answered: 1 week ago