TypeError:字节索引必须是整数或切片,而不是列表

时间:2019-05-02 19:19:14

标签: python

我是新来的 尝试调用一些excel数据进行预处理

with open('/content/gdrive/My Drive/LSTMSERVICE/ServiceData.csv', 'rb') 
as f:
  data = f.read()
#data = pd.read_csv('/content/gdrive/My Drive/LSTMALTEC/AltecData.csv')
# Keeping only the neccessary columns

data = data[['SR_NOTE_CORRECTION','TimeToFix']]
#data.shape()
TypeError                                 Traceback (most recent call last)
<ipython-input-15-fae20c25c953> in <module>()
      4 # Keeping only the neccessary columns
      5 
----> 6 data = data[['SR_NOTE_CORRECTION','TimeToFix']]
      7 #data.shape()

TypeError: byte indices must be integers or slices, not list

0 个答案:

没有答案