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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -