data analysis tricks in pandas code example
Example: 10 Python Pandas tips to make data analysis faster
import pandas as pddef color_negative_red(val): color = 'red' if val < 0 else 'black' return 'color: %s' % colordf = pd.DataFrame(dict(col_1=[1.53,-2.5,3.53], col_2=[-4.1,5.9,0]) )df.style.applymap(color_negative_red)