piper.factory.sample_matrix

piper.factory.sample_matrix(size: Tuple = (5, 5), loc: int = 10, scale: int = 10, lowercase_cols: bool = True, round: int = 3, seed: int = 42)pandas.core.frame.DataFrame[source]

Generate sample data for given size (tuple)

Draw random samples from a normal (Gaussian) distribution. (Uses np.random.normal)

Examples

df = sample_matrix()
head(df, output=print)

        a       b       c       d       e
0  14.967   8.617  16.477  25.230   7.658
1   7.659  25.792  17.674   5.305  15.426
2   5.366   5.343  12.420  -9.133  -7.249
3   4.377  -0.128  13.142   0.920  -4.123
4  24.656   7.742  10.675  -4.247   4.556
Parameters
  • size – tuple - (row, column) size required.

  • loc – float or array_like of floats. Mean (“centre”) of the distribution.

  • scale – float or array_like of floats. Standard deviation (spread or “width”) of the distribution. Must be non-negative.

  • lowercase_cols – Alphabetical column names are lowercase by default.

Returns

Return type

a pandas DataFrame