audit-labs/audit-tools

A collection of scripts, queries, and other goodies you can use in an audit. audit automation compliance evidence scripts

Commit 955baddc3e

955baddc3e95f708b8cb1ed63983b8992146836e

parent: c490e30a67

Unsigned

cmc <hello@cleberg.net> · 2024-10-19 16:46 UTC

fix pylint issues

Layout: unified · split

sampling/sample.py +7 −3
@@ -1,8 +1,12 @@
1"""
2Creates a sample from a CSV or Excel file based on user-defined SAMPLE_SIZE.
3"""
4
15# Import packages
26import pandas as pd
37
48# Define the sample size
5sample_size = 25
9SAMPLE_SIZE = 25
610
711# Import the data to a pandas DataFrame
812df = pd.read_csv("FILENAME_GOES_HERE.csv")
@@ -15,8 +19,8 @@ df = pd.read_csv("FILENAME_GOES_HERE.csv")
1519print("Dataframe size (rows, columns): ", df.shape)
1620
1721# Sample
18sample = df.sample(sample_size)
19print("Sample size: ", sample_size)
22sample = df.sample(SAMPLE_SIZE)
23print("Sample size: ", SAMPLE_SIZE)
2024print("Sample:\n", sample)
2125
2226# ALTERNATIVE: Replacement Samples