Tilburg Thesis_Malawi School Dropout/src/thesis_utils_visualize.py
def highlight_abs_min(data, color='steelblue'):
    '''
    highlight the maximum in a Series or DataFrame
    '''
    attr = 'background-color: {}'.format(color)
    if data.ndim == 1:  # Series from .apply(axis=0) or axis=1
        is_abs_min = (data.abs() == data.abs().min())
        return [attr if v else '' for v in is_abs_min]
    else:  # from .apply(axis=None)
        is_abs_min = data.abs() == data.abs().min().min()
        return pd.DataFrame(np.where(is_abs_min, attr, ''),
                            index=data.index, columns=data.columns)

    highlight the maximum in a Series or DataFrame
    
highlight the maximum in a Series or DataFrame
highlight the maximum in a Series or DataFrame
def highlight_abs_min(data, color='steelblue'):
    attr = 'background-color: {}'.format(color)
    if data.ndim == 1:  
        is_abs_min = (data.abs() == data.abs().min())
        return [attr if v else '' for v in is_abs_min]
    else:  
        is_abs_min = data.abs() == data.abs().min().min()
        return pd.DataFrame(np.where(is_abs_min, attr, ''),
                            index=data.index, columns=data.columns)
def highlight_abs_min ( data , color = 'steelblue' ) : attr = 'background-color: {}' . format ( color ) if data . ndim == 1 : is_abs_min = ( data . abs ( ) == data . abs ( ) . min ( ) ) return [ attr if v else '' for v in is_abs_min ] else : is_abs_min = data . abs ( ) == data . abs ( ) . min ( ) . min ( ) return pd . DataFrame ( np . where ( is_abs_min , attr , '' ) , index = data . index , columns = data . columns )
highlight the maximum in a Series or DataFrame
highlight the maximum in a Series or DataFrame
'''
    highlight the maximum in a Series or DataFrame
    ''' # Series from .apply(axis=0) or axis=1 # from .apply(axis=None)
data
color