data_loader_excel.py 527 B

123456789101112131415161718192021222324252627
  1. # -*- coding: utf-8 -*-
  2. """
  3. @author: yq
  4. @time: 2024/10/31
  5. @desc:
  6. """
  7. import pandas as pd
  8. from commom import get_logger
  9. from .data_loader_base import DataLoaderBase
  10. logger = get_logger()
  11. class DataLoaderExcel(DataLoaderBase):
  12. def __init__(self, ):
  13. pass
  14. def get_connect(self):
  15. pass
  16. def close_connect(self):
  17. pass
  18. def get_data(self, file_path: str, sheet_name: str = 0) -> pd.DataFrame:
  19. df = pd.read_excel(file_path, sheet_name=sheet_name, index_col=False)
  20. return df