Skip to content

Commit

Permalink
fix pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pmayd committed Jan 30, 2024
1 parent ec458d3 commit d590647
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pystatis/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pandas as pd

import pystatis.db as db
from pystatis import db
from pystatis.http_helper import load_data


Expand Down Expand Up @@ -58,18 +58,18 @@ def get_data(self, area: str = "all", prettify: bool = True, **kwargs):
self.metadata = metadata

@staticmethod
def prettify_table(data: pd.DataFrame, db: str) -> pd.DataFrame:
def prettify_table(data: pd.DataFrame, db_name: str) -> pd.DataFrame:
"""Reformat the data into a more readable table
Args:
data (pd.DataFrame): A pandas dataframe created from raw_data
db (str): The name of the database.
db_name (str): The name of the database.
Returns:
pd.DataFrame: Formatted dataframe that omits all unnecessary Code columns
and includes informative columns names
"""
match db:
match db_name:
case "genesis":
pretty_data = Table.parse_genesis_table(data)
case "zensus":
Expand All @@ -83,6 +83,7 @@ def prettify_table(data: pd.DataFrame, db: str) -> pd.DataFrame:

@staticmethod
def parse_genesis_table(data: pd.DataFrame) -> pd.DataFrame:
"""Parse GENESIS table ffcsv format into a more readable format"""
# Extracts time column with name from first element of Zeit_Label column
time = pd.DataFrame({data["Zeit_Label"].iloc[0]: data["Zeit"]})

Expand All @@ -103,6 +104,7 @@ def parse_genesis_table(data: pd.DataFrame) -> pd.DataFrame:

@staticmethod
def parse_zensus_table(data: pd.DataFrame) -> pd.DataFrame:
"""Parse Zensus table ffcsv format into a more readable format"""
# Extracts time column with name from first element of Zeit_Label column
time = pd.DataFrame({data["time_label"].iloc[0]: data["time"]})

Expand All @@ -122,4 +124,5 @@ def parse_zensus_table(data: pd.DataFrame) -> pd.DataFrame:

@staticmethod
def parse_regio_table(data: pd.DataFrame) -> pd.DataFrame:
"""Parse Regionalstatistik table ffcsv format into a more readable format"""
pass

0 comments on commit d590647

Please sign in to comment.