script:
import os from io import StringIO import pandas as pd def load_data(data): if isinstance(data, pd.DataFrame): return data elif isinstance(data, bytes): return pd.read_csv(StringIO(str(data, 'utf-8')), encoding='utf-8', sep=',') elif len(data) <= 260 and os.path.exists(str(data)): return pd.read_csv(data, encoding='utf-8', sep=',') elif isinstance(data, str): return pd.read_csv(StringIO(data), encoding='utf-8', sep=',')
No hay comentarios:
Publicar un comentario