Dual behavior []indf[]
- If you are not using
:inside [], then the values inside it will be considered columns. : [], .
?
, . , x, y df[x:y] x d[x] x, y df[[x,y]] ().
:
df = pd.DataFrame(data = [[1,2,3], [1,2,3], [1,2,3]],
index = ['A','B','C'], columns = ['A','B','C'])
print df
:
A B C
A 1 2 3
B 1 2 3
C 1 2 3
, df['B'], :
, , df['B'] , 'B', , .
df['2017-01-02']?
'2017-01-02', , .
df.loc['2017-01-02']?
.loc[] df.loc[row,column], , , , df.loc[row]