<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Using OMDB api to find data about TV shows
Step1:  We're using two params. t (for title) and Season. Change values as you wish 
Step2:  Now let's take a look at what data we have
Step3:  Okay! As we can see, data are indexed by Episodes. What do we have about the first episode?
Step4:  So now we know which attributes each episode has. imdbRating is quite interesting, let's work on that. If we want to find out the rating for the seventh episode, all we gotta do is
Step5:  Since we want to analyze data statistically, let's create a list and keep all ratings grouped
Step6:  What rating can be considered the mode for that season?
Step7:  How many episodes have been rated like this?
<ASSISTANT_TASK:>
Python Code:
import json
import urllib.request as request
Explanation: Using OMDB api to find data about TV shows
End of explanation
url = 'http://www.omdbapi.com/?t=Scandal&Season=3'
content = request.urlopen(url).read()
data = json.loads(content.decode('UTF-8'))
Explanation: We're using two params. t (for title) and Season. Change values as you wish :)
End of explanation
print(data)
Explanation: Now let's take a look at what data we have
End of explanation
print(data['Episodes'][0])
Explanation: Okay! As we can see, data are indexed by Episodes. What do we have about the first episode?
End of explanation
print(data['Episodes'][6]['imdbRating'])
Explanation: So now we know which attributes each episode has. imdbRating is quite interesting, let's work on that. If we want to find out the rating for the seventh episode, all we gotta do is:
End of explanation
ratings = []
for episode in data['Episodes']:
    ratings.append(episode['imdbRating'])
print(ratings)
from scipy import stats
Explanation: Since we want to analyze data statistically, let's create a list and keep all ratings grouped
End of explanation
mode = stats.mode(ratings)
print(mode)
print(mode[0][0])
Explanation: What rating can be considered the mode for that season?
End of explanation
print(mode[1][0])
Explanation: How many episodes have been rated like this?
End of explanation
<END_TASK>