简体   繁体   中英

Pandas: get value from specific row and column by name and year

there is a DataFrame of cast which contains title, year, name, character, n.. etc.

在此处输入图像描述

  1. How many leading (n=1) roles were available to actors, and how many to actresses, in each year of the 1950s?

  2. List the 10 actors/actresses that have the most leading roles (n=1) since the 1990's.

  3. List, in order by year, each of the films in which Frank Oz has played more than 1 role.

The questions above this line unfortunately I did not succeed.

I tried some functions in pandas but, no one fit to these questions

I would be delighted if someone could help

You can try using loc() method. Below link gives the complete discription https://www.geeksforgeeks.org/python-pandas-extracting-rows-using-loc/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM