Finding the percentile rank of a value in a dataset. Noob needs comments on approach

Thanks so much for taking the time @bkamins I’m going to claim “close but no cigar” on my code attempt :slight_smile:

Why is

julia> 100 * count(<(df_symbol.close[end]), df_symbol.close) / nrow(df_symbol)
72.83464566929133

faster than

percent_below = ( ( nrow(filter(row -> row.close < last(df_symbol).close,df_symbol)  /nrow(df_symbol))*100

thanks again for taking the time to help a noob