0

I am trying to create a Class called 'Settings' that can load an excel file, and create a dictionary called 'data' that returns the data from the individual sheets ('the key') of my excel file as a dataframe (the 'value'). I have laid out my proposed steps below but I would appreciate any guidance on how to construct my class using methods and instantiation. Thank you


import pandas as pd

class Settings():
    
#METHOD TO LOAD AN EXCEL FILE
    def load(self):
        self.load = load

#METHOD TO RETURN THE DATA FROM THE LOADED EXCEL INTO DICTIONARIES    
    def data(self):
        self.data = data 

#METHOD TO FILTER SOME OF THE DATA
    def filter_data(self):
        self.filter_data = filter_data

I am also unsure of how to build in the built-in Python operator pd.read_excel into my class or one of the methods

1 Answers1

1

You might want to look into openpyxl (reads Excel 2010 xlsx/xlsm) or xlrd (reads historical xls format) to read your Excel files with Python. There are more alternatives out there, check www.python-excel.org.

yvesonline
  • 4,609
  • 2
  • 21
  • 32