pandas sample seed

>>> df.sample(frac=0.5, replace=True, random_state=1)
      num_legs  num_wings  num_specimen_seen
dog          4          0                  2
fish         0          0                  8

Here is what the above code is Doing:
1. We’re using the sample method on our DataFrame, which returns a new DataFrame with a random sample of the original DataFrame’s rows.
2. We’re using the frac parameter to tell sample that we want a fraction of the original DataFrame’s rows.
3. We’re using the replace parameter to tell sample that we want to sample with replacement.
4. We’re using the random_state parameter to tell sample that we want to use a specific random seed.
5. We’re using the num_legs and num_wings columns to create a new DataFrame with just two columns.