0
私はこのようになりますいくつかのデータを分析するJupyterノートブックを作ってるんだ:Jupyterノート - Pythonのコード
私は、この情報を見つけるために持っている:
この私が試したことですが、それは動作していないと私はパートbを行う方法で完全な損失になっています。
# Import relevant packages/modules
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
# Import relevant csv data file
data = pd.read_csv("C:/Users/Hanna/Desktop/Sheridan College/Statistics for Data Science/Assignment 1/MATH37198_Assignment1_Individual/IGN_game_ratings.csv")
# Part a: Determine the z-score of "Super Mario Kart" and print out result
superMarioKart_zscore = data[data['Game']=='Super Mario Kart'] ['Score'].stats.zscore()
print("Z-score of Super Mario Kart: ", superMarioKart_zscore)
# Part b: The top 20 (most common) platforms
# Part c: The average score of all the Shooter games
averageShooterScore = data[data['Group']=='Game']['Score'].mean()
# Print output
print("The average score of all the Shooter games is: ", averageShooterScore)
# Part d: The top two platforms witht the most perfect scores (10)
# Part e: The probability of a game randomly selected that is an RPG
# First find the number of games in the list that is an RPG
numOfRPGGames = 0
for game in data['Game']:
if data['Genre'] == 'RPG':
numOfRPGGames += 1
# Divide this by the total number of games to find the probablility of selecting one
print("The probability of selecting a game that is an RPG is: ", numOFRPGGames/totalNumGames)
# Part f: The probability of a game randomly selected with a score less than 5
# First find the number of games in the list with a score less than 5 using a for loop:
numScoresLessThan5 = 0
for game in data['Game']:
if data['Score'] < 5:
numScoresLessThan5 += 1
# Divide this by the total number of games to find the probablility of selecting one
print("The probability of selecting a game with a score less than 5 is: ", numScoresLessThan5/totalNumGames)
あなたは、ダウン個別の質問にこの質問を壊したくてそうした方が良い答えを得られるでしょう。特定の質問にまだ集中していない場合は、[MCVE](https://stackoverflow.com/help/mcve)を見てください。何を試してみましたか、それがなぜ機能していないのか、出力を期待しているのですか?することが。 – johnchase