import pandas as pd | |
def convert_column_names(value): | |
value = value.lower() | |
value = value.replace(" ", "_") | |
return value | |
def check_object(obj): | |
if obj is None: | |
raise ValueError('Return of yfinance download is None') | |
elif isinstance(obj, pd.DataFrame): | |
if obj.empty: | |
raise ValueError('DataFrame is empty') | |
else: | |
raise ValueError(f'Return of yfinance download is neither a Dataframe nor None {type(obj)}') | |