“Панды сдвигают столбцы вниз до значения” Ответ

Панды сдвигают столбцы вниз до значения

#We create a shift down method so that we can have all the preious summed values in the bottom index and hence
#deleting them would be easy 
def shift_down(data):
    i=0
    while(i<len(data.columns)):
        while(pd.isnull(data.iloc[len(data.index)-1,i])==True):
            data.iloc[:,i] = data.iloc[:, i].shift(1)
        i+=1
    return data
M.U

Панды сдвигают столбцы до значения

#We create a function to shift up the data of each column up until the first actual number
def shift_up(data):
    i=0
    while(i<len(data.columns)):
        while(pd.isnull(data.iloc[0,i])==True):
            data.iloc[:,i]=data.iloc[:,i].shift(-1)
        i+=1
    return data
M.U

Ответы похожие на “Панды сдвигают столбцы вниз до значения”

Вопросы похожие на “Панды сдвигают столбцы вниз до значения”

Больше похожих ответов на “Панды сдвигают столбцы вниз до значения” по Python

Смотреть популярные ответы по языку