Python Pandas: Get index from column value -
very simple question: have pandas dataframe. 1 of columns looks this.
date 2016-04-15 2016-04-14 2016-04-13 2016-04-12 2016-04-11 2016-04-08
how index of particular value assuming values unique.
for example, "2016-04-13" return 2
use df.index.get_loc('2016-04-14')
integer location requested label. return 1
intital starts 0
. can add 1 index value 2
Comments
Post a Comment