To create the desired DataFrame, you will need the following information from the Survivor Dataset: season, season_name, winner_id, and full_name.
Here's the code to create the DataFrame sorted by season, with the specified columns:
```python
import pandas as pd
# Load the Survivor Dataset
survivor_data = pd.read_csv('survivor_data.csv')
# Filter the DataFrame to include only the winners who received unanimous jury votes
unanimous_winners = survivor_data[survivor_data['jury_votes'] == survivor_data['players'].max()]
# Create the desired DataFrame with the specified columns
Q12 = unanimous_winners[['season', 'season_name', 'winner_id', 'full_name']].sort_values('season').reset_index(drop=True)
# Show the DataFrame
print(Q12)
```
Make sure to replace `'survivor_data.csv'` with the actual filename/path of your Survivor Dataset.
Let's see how many winners ended up getting unanimous jury votes to win the game. Create a Dataframe that shows the survivors that got unanimous jury votes with these columns in the final output: season, season_name, winner_id, full_name. The DataFrame should be sorted by season and the index should go from 0 to n-1. Save this as Q12.
1 answer