January 24th, 2016, 3:32 pm
Say I have the following data in a pandas.DataFrame object.What is a pythonic way to slice this dataframe to the first index where there is a data available in every column? (ie 24/01/2015)(Notice I don't want to get rid of rows where there is at leat 1 NA in nearest dates.)It is probably basic, but I couldn't come up with an elegant solution to be honest.Date, m1, m2, m3, m420/01/15, NA, NA, 400, NA21/01/15, NA, NA, 401, NA22/01/15, NA, 202, 402, NA23/01/15, NA, 203, 403, 10324/01/15, 100, 204, 404, 10425/01/15, 101, 205, 405, 10526/01/15, 102, 206, 406, 10627/01/15, 103, 207, 407, 10728/01/15, 104, 208, 408, 10829/01/15, NA, NA, NA, NA30/01/15, 106, 210, NA, 11031/01/15, 107, 211, 411, 11101/02/15, 108, 212, 412, 11202/02/15, 109, 213, 413, 11303/02/15, 110, 214, 414, 11404/02/15, 111, 215, 415, 115
Last edited by
tags on January 23rd, 2016, 11:00 pm, edited 1 time in total.