ntbloom / gamewinner

college bball bracket predictor -- bring your own algo
GNU General Public License v3.0
1 stars 1 forks source link

Data refactor ideas #23

Open seth127 opened 1 year ago

seth127 commented 1 year ago

Example: Want to do things like this:

class Doubletime(IStrategy):
    """

    """

    @property
    def name(self) -> str:
        return "Doubletime"

    def prepare(self, teams: dict[str, Team]) -> None:
        # without pandas refactor, we want to be able to do this
        self.em_props = EvanMiyaStrategy.load_data(teams)
        self.espn_props = ESPNStrategy.load_data(teams)

        # if we refactor to pandas, it will be more like this
        self.data = pd.join(
            EvanMiyaStrategy.load_data(teams),
            ESPNStrategy.load_data(teams),
            by = "team"
        )