From d6b72187ad3ad53d1b77e7e13a4659b6311de0e4 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sat, 19 Oct 2024 11:46:55 -0500 Subject: fix pylint issues --- sampling/sample.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sampling/sample.py') diff --git a/sampling/sample.py b/sampling/sample.py index a2435d8..f8ea211 100644 --- a/sampling/sample.py +++ b/sampling/sample.py @@ -1,8 +1,12 @@ +""" +Creates a sample from a CSV or Excel file based on user-defined SAMPLE_SIZE. +""" + # Import packages import pandas as pd # Define the sample size -sample_size = 25 +SAMPLE_SIZE = 25 # Import the data to a pandas DataFrame df = pd.read_csv("FILENAME_GOES_HERE.csv") @@ -15,8 +19,8 @@ df = pd.read_csv("FILENAME_GOES_HERE.csv") print("Dataframe size (rows, columns): ", df.shape) # Sample -sample = df.sample(sample_size) -print("Sample size: ", sample_size) +sample = df.sample(SAMPLE_SIZE) +print("Sample size: ", SAMPLE_SIZE) print("Sample:\n", sample) # ALTERNATIVE: Replacement Samples -- cgit v1.2.3-70-g09d2