KeyError:“ ['Hours','Game']不在索引中”

时间:2019-10-03 03:59:36

标签: python python-3.x

选择列的小时数和游戏时出错

我尝试了不同的代码,但是没有一个起作用。

import pandas as pd
import numpy as np

# upload the dataset to spyder
data = pd.read_csv("C:/Users/User/Documents/FYP II/gamedataset.csv")

# Data selection on columns needed for data mining

collect =  data[['Game','Genre','price','Hours','Day.period','Age','Gender','Violence.Rate','Cause.gaming','CID.Rating',]]

我希望收集的数据集能够显示

我得到:

KeyError: "['Hours', 'Game'] not in index

enter image description here

0 个答案:

没有答案