Data Science MODULE 8 CODE Flashcards

1
Q

Code for comparing the mean of a certain column, while grouping by another?
Hoe sal jy dan die een in n veranderlike sit?

A

Df.groupby(‘Preowned’)[‘claim’].mean().round(2)

Veranderlike = selfde as hierbo, gevolg deur [0] of [1] of watter groep dan ookal

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

Hoe assign jy x labels, as jy n np range het?

A

Plt.xticks(np.arange(2),(“label1”,”label2”))

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