You can't have it as a number format and do what you want to do. you have to transform the numbers into strings. You can do it as follows
df=pd.DataFrame({'Numbers':[1,2,2,-1,3,-4]})
Numbers
0 1
1 2
2 2
3 -1
4 3
5 -4
#function to color the values that starts with parenthesis
def color_parenthesis_red(val):
color = 'red' if val.startswith('(') else 'black'
return 'color: %s' % color
#transform values into string and add parenthesis when they are negative
df['Numbers']=df['Numbers'].astype(str).apply(lambda x: f"({x})" if int(x)<0 else x)
df.style.applymap(color_negative_red)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…