Open
Description
Describe the bug
When creating a DataFrame
by providing an Object
, if one of the columns is called 'index,' then 'df.indexwill point to that column instead of the actual
DataFrame` index. This caused very hard-to-decipher errors when I was working with a table I did not know contained such a column.
To Reproduce
let obj = {
foo: [1,2,3,4,5],
bar: [5,6,7,8,9],
index: ['a','b','c','d','e']
}
df = new DataFrame(obj).setIndex('foo')
df.index.includes(1) //Throws error
Expected behavior
df.index
should give the index of df
. Failing that, a warning that I've created a DataFrame
with a column named index.