CST383 - Week 4

CST383 - Week 4

    This week, we worked more on plotting data, this time creating more complicated plots involving two or more variables. We used pd.crosstab() to create grouped bar plots for two variables, while for three or more we use sns.barplot(). 
    I had some trouble understanding why some of my plots are not plotting at all (loading infinitely) while others are able to plot. I tried a few ways to plot them, including normalizing the data, using different aggregations like sum(), and limiting the amount of data that was plotted using top 10 values [:10]. I will have to review the homework once it is graded to understand how best to work through these problems.
    I also learned more about P notation for joint probability: use "and", or a ",", or a "^". Such as, what is the probability for a and b: P(a and b), or P(a, b), or P(a ^ b). For OR, use "or" or a "v". 
    For conditional probabilities like "for a given b", P(a | b), which is NOT the same as (a || b) in code. For a dataframe df and columns 'a' and 'b', to show the probability that a > 0 given b <= 1, you write:
(df[df['b'] <= 1]['a'] > 150).mean()


Comments

Popular posts from this blog

CST300 - Week 4

CST334 - Week 6

CST334 - Week 5