numpy2 Flashcards

1
Q

get absolute values of the column

A

np.absolute(df[‘col’]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

transform an array back after it had been log transformed

A

np.exp(arr)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

change the formatting of np arrays to 2 digits

A

np.set_printoptions(formatter={‘float’: lambda x: “{0:0.2f}”.format(x)})

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

remove formatting of display

A

np.set_printoptions(formatter=None)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly