Back to marketplace

Pandas Pt 1 - Cont'd (UCSD)

No description yet. This curated deck is ready for daily study.

Total cards: 7•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (7)

#1
Front (Question)

basic descriptive statistics functions for all columns on a datframe df

Back (Answer)

df.describe(), df.corr(), df.mean(), df.median(), df.mode(), df. min(), df.max() , df.std()

#2
Front (Question)

use axis to get statistical values for the columns or the rows (mean as example)

Back (Answer)

df.mean(axis = 1) ## 0 index, 1 columns

#3
Front (Question)

check if any element in a dataframe or series is `non-zero or non-empty (but mostly useful w/ a boolean column)

Back (Answer)

df.any()

#4
Front (Question)

check if ALL element in a dataframe or series is `non-zero or non-empty (but mostly useful w/ a boolean column)

Back (Answer)

df.all()

#5
Front (Question)

use describe on a column of df_var called ‘ratings’

Back (Answer)

df[‘ratings’].describe()

#6
Front (Question)

Create a series with Boolean values if the rating column from ratings df is > 5, then use any() to test for true on the series

Back (Answer)

filter_1 = ratings[‘rating’] > 5 ## not sure if this is a series, or 1 col df filter_1.any()

#7
Front (Question)

Get the mean value from ‘rating’ col for all rows that have movieId of 1, from dataframe ratings

Back (Answer)

ratings[‘rating’][ratings.movieId==1].mean()