Can column and row have the same index? Will it impact retrieval of data?
Something on the lines-
df = DataFrame([1,2,3,4],index=['a','b','c','d'],columns=['a'])
In this case if we use df['a'], what value would be retrieved? I believe we don't specify while selection whether index is for a row or a column in the syntax.
Let's try it....
In [2]:
from pandas import DataFrame
df = DataFrame([1,2,3,4],index=['a','b','c','d'],columns=['a'])
In [3]:
df
Out[3]:
In [4]:
# column a
df['a']
Out[4]:
In [5]:
# index a
# http://pandas.pydata.org/pandas-docs/stable/indexing.html#different-choices-for-indexing-loc-iloc-and-ix
df.ix['a']
Out[5]:
In [6]:
# index b
df.ix['b']
Out[6]:
In [7]:
# column b -- doesn't exist
df['b']