.apply 행-열단위
행/열단위로 처리
def applymap_allCell(x): result = [] base = x[-1] print(base) print(len(x)) for num, i in enumerate(x) : if(num == len(x)-1): result.append( 'background-color: blue' ) else: if(i < base ): result.append( 'background-color: red' ) else: result.append( 'background-color: green' ) return result data.style.apply( applymap_allCell ) |