File size: 484 Bytes
25e7dcb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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)}')
|