Python每日一记99>>>TypeError: Index(...) must be called with a collection of some kind, 1 was passed错误解决

今天实践中突然遇到问题,简单记录一下:
Python每日一记99>>>TypeError: Index(...) must be called with a collection of some kind, 1 was passed错误解决_第1张图片
其实,index对象包括index和columns,必须要是集合类型的,可以是{},[],,也就是说,上述案例也可以columns={1},但是不能是元祖columns=(1)。
Python每日一记99>>>TypeError: Index(...) must be called with a collection of some kind, 1 was passed错误解决_第2张图片

你可能感兴趣的:(Python每日一记99>>>TypeError: Index(...) must be called with a collection of some kind, 1 was passed错误解决)