move mem logs to debug
This commit is contained in:
parent
06a2957837
commit
e46a57bbd0
@ -1352,8 +1352,8 @@ class FreqaiDataKitchen:
|
|||||||
"""
|
"""
|
||||||
Ensure all values are float32
|
Ensure all values are float32
|
||||||
"""
|
"""
|
||||||
start_mem = df.memory_usage().sum() / 1024**2
|
logger.debug(f"Memory usage of dataframe is "
|
||||||
print("Memory usage of dataframe is {:.2f} MB".format(start_mem))
|
f"{df.memory_usage().sum() / 1024**2:.2f} MB")
|
||||||
|
|
||||||
df_dtypes = df.dtypes
|
df_dtypes = df.dtypes
|
||||||
for column, dtype in df_dtypes.items():
|
for column, dtype in df_dtypes.items():
|
||||||
@ -1365,8 +1365,7 @@ class FreqaiDataKitchen:
|
|||||||
df_dtypes[column] = np.int32
|
df_dtypes[column] = np.int32
|
||||||
df = df.astype(df_dtypes)
|
df = df.astype(df_dtypes)
|
||||||
|
|
||||||
end_mem = df.memory_usage().sum() / 1024**2
|
logger.debug(f"Memory usage after optimization is: "
|
||||||
print("Memory usage after optimization is: {:.2f} MB".format(end_mem))
|
f"{df.memory_usage().sum() / 1024**2:.2f} MB")
|
||||||
print("Decreased by {:.1f}%".format(100 * (start_mem - end_mem) / start_mem))
|
|
||||||
|
|
||||||
return df
|
return df
|
||||||
|
Loading…
Reference in New Issue
Block a user