load data small verbosity change

This commit is contained in:
lda committed 2025-05-07 00:23:12 +07:00
1 parent 6c632c9131
commit 2b408ceeab
1 file changed
+11 -9
+11 -9
View File
@@ -60,20 +60,22 @@ def date_combine(data: pd.DataFrame):
return data return data
def validate_view(data: pd.DataFrame): def validate_view(data: pd.DataFrame, verbose=False):
print(f"Shape with N/A values: {data.shape}") if verbose:
isn = data.isnull().sum().iloc[0] print(f"Shape with N/A values: {data.shape}")
print(f"Count of N/A values: {isn}") isn = data.isnull().sum().iloc[0]
print(f"Count of N/A values: {isn}")
data = data.dropna() # Drop the rows with missing values data = data.dropna() # Drop the rows with missing values
isn = data.isnull().sum().iloc[0] if verbose:
print(f"Count after drop: {isn}") isn = data.isnull().sum().iloc[0]
print(data.describe()) print(f"Count after drop: {isn}")
print(data.describe())
return data return data
# if __name__ == "__main__": # if __name__ == "__main__":
def load_this_data(filename): def load_this_data(filename, verbose=False):
d = load_data(filename) d = load_data(filename)
d = date_combine(d) d = date_combine(d)
d = validate_view(d) d = validate_view(d, verbose)
return d return d