load data small verbosity change
This commit is contained in:
1 parent
e9fdfcd2c0
commit
fc9f13399a
1 file changed
+5
-3
+5
-3
@@ -60,11 +60,13 @@ def date_combine(data: pd.DataFrame):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def validate_view(data: pd.DataFrame):
|
def validate_view(data: pd.DataFrame, verbose=False):
|
||||||
|
if verbose:
|
||||||
print(f"Shape with N/A values: {data.shape}")
|
print(f"Shape with N/A values: {data.shape}")
|
||||||
isn = data.isnull().sum().iloc[0]
|
isn = data.isnull().sum().iloc[0]
|
||||||
print(f"Count of N/A values: {isn}")
|
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
|
||||||
|
if verbose:
|
||||||
isn = data.isnull().sum().iloc[0]
|
isn = data.isnull().sum().iloc[0]
|
||||||
print(f"Count after drop: {isn}")
|
print(f"Count after drop: {isn}")
|
||||||
print(data.describe())
|
print(data.describe())
|
||||||
@@ -72,8 +74,8 @@ def validate_view(data: pd.DataFrame):
|
|||||||
|
|
||||||
|
|
||||||
# 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
|
||||||
Reference in new issue
Block a user