To obtain 10 records at random, from your DataFrame 'df' data, you would use

df.sample(10) df.random(10) df.head(10) df.tail(10) 'head' or 'tail' will give you the first 10 or last 10 records and hence is not at random. But 'sample' will provide 10 records at random. There is no function called 'random'

The 'corr' function applied on a dataframe, derives correlation coefficient values of all numerical values of the dataframe. Non-numerical columns are ignored

True False Yes, true. Be careful about the numerical value in a column though. If the column has a zip code or lat/lon location values, then also it derives correlation with the numberical values of those columns, which makes no sense in many situations. It may not be a bad idea to hand pick the columns for which you want to derive the correlations.

Exercise

results matching ""

    No results matching ""