Pandas取多列pandas.core.indexing.IndexingError: Too many indexers错误

错误原因,多列用’ [ ] '括起来
错误示范:

print(CNC_Production.loc[:, 'StartTime', 'EndTime', 'dataTime', 'UpdateTime'])

正确示范:

print(CNC_Production.loc[:, ['StartTime', 'EndTime', 'dataTime', 'UpdateTime']])

你可能感兴趣的:(python)