Which contestant(s) played a perfect game? A perfect game is considered when the contestant:

didn't receive any tribal council votes all season (this is different than Q10 since some players played multiple times. They got voted out in one season so they would not show in Q10 but they came back for another season and didn't receive any tribal council votes)
won the game
got unanimous jury votes (see question 12)
Save this DataFrame as Q19 with the following columns: season_name, season, castaway_id, full_name, tribal_council_votes, jury_votes. The DataFrame should be sorted by season and the index should be 0 to n-1.python code

1 answer

The Python code to create the Q19 DataFrame with the required columns and sorting is as follows:

```python
import pandas as pd

# Assuming you have a DataFrame named 'df' with all the relevant data

# Filtering the contestants who didn't receive any tribal council votes all season
no_votes_df = df[df['tribal_council_votes'] == 0]

# Filtering the contestants who won the game
winners_df = no_votes_df[no_votes_df['won'] == True]

# Filtering the contestants who got unanimous jury votes
unanimous_votes_df = winners_df[winners_df['jury_votes'] == df['jury_votes'].max()]

# Sorting the DataFrame by season
Q19 = unanimous_votes_df.sort_values('season')

# Resetting the index of the DataFrame
Q19.reset_index(drop=True, inplace=True)

# Printing the Q19 DataFrame
print(Q19)
```

Just replace `'df'` with the name of your DataFrame containing the relevant data.