For any and all questions relating to Challenge 7 post away!
Okay, I got the answer, but I cannot comprehend how the max number of games played is anything but 38. Can someone please explain. Also the spelling and grammatical errors in these challenges are really bothering me as they stack up day by day.
Great challenge! great puzzle while working with data!
If you make the playoffs, you make it into the ‘after season’ and you play more games than in other seasons.
The pandas will iterate through all the seasons, some seasons could have more then 38 games played and max will return the maximum value.
To show this, just return the series and not append .max() i.e
This question was straightforward, assuming you use the variables already declared.
An example of how to find the min game with red cards you might go:
games_with_red_cards = df['GWRC'] print(games_with_red_cards.min())
Also, a quick review of what the functions provided do.
series.max() #outputs max value series.min() #outputs min value series.mean() #outputs average series.median() #outputs the middle of a sorted list of values. If the length is even, return the average of the middle-est values ie. 3 4 5 6 returns 4.5. If the length is odd, return the middle value: 3 4 5 returns 4 series.mode() #outputs the most common value
I thought the same thing for a moment. The table shown in the challenge is only part of the data set. I used the print() function to confirm that there are many more rows of data.
Trust the functions!
Thank you for the replies. Is there a way to go back to a completed challenge to play with it more? Or are you stuck once the solution is showing
There are no playoffs in La Liga. Those years with more matches were unique because there were 22 teams playing instead of the regular 20.
For a while I thought “1 season” meant the first season and was very confused. Turns out 1. and 4. asks for the max and min out of all seasons.
I will be moderating this forum till 10 AM EST.
Feel free to keep the conversation around the challenge alive.
Fun challenge! I enjoy the direction we are taking with moving onto pandas.
How To See The Entire Data Set
Use Print() Method
Carousel21 mentioned that you can see the entire dataset by using the
print() method. E.g. by doing something like:
Use Head() Method
Another way is to pass in the total number of rows (or a larger number than the total) into the head function. E.g. by writing one of the below
instead of just
to get all 33 rows. The reason that
df.head() gives only the first 5 rows (row “0” to row “4”) is because 5 is the default number of rows for the
Head() Function Documentation
Here’s the documentation that explains how the head() function works:
This is absolutely correct!
When you don’t know sports and English isn’t your primary language all the abreviations of the table mean nothing.
MP W D L GF GA GD
Is D for Defeat and L for Losses, doesn’t make sense, if it’s both the same.
I think it could be D for Draw
Hi all, I will be moderating the forum for the next 2 hours. Please let me know if you face any barriers in attempting to complete todays challenge. Also, please remember to not share any answers on this forum.
MP - Matches Played
W - Won
D - Draw
L - Lost
GF - Goals For
GA - Goals Against
GD - Goal Difference (GF - GA)
I’ve been using replit to run Python and
import pandas as pd is returning an error.
ModuleNotFoundError: No module named 'pandas'. Is there anything I can do there or does this challenge have to be done on Jupyter?