Skip to content

Commit

Permalink
Fjernet en funk
Browse files Browse the repository at this point in the history
  • Loading branch information
EdvardGarmannslund committed Feb 12, 2024
1 parent ed81588 commit 8951f52
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/ssb_konjunk/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,3 @@ def example_function(number1: int, number2: int) -> str:
return f"{number1} is less than {number2}"

return f"{number1} is greater than or equal to {number2}"


def remove_dot_nace(df: pd.DataFrame, column_name: str) -> pd.DataFrame:
"""Function to remove dot from nace. Vof uses for example 47.111 where as som bases have 47111, so its sometimes nessecary to remove the dot.
Parameters
----------
df (pd.DataFrame): Pandas df to work on.
column_name (str): String of column name for containing nace with dot.
Returns:
-------
df (pd.DataFrame): Pandas df without dot in nace column.
"""
df = df.copy()
df[column_name] = df[column_name].str.replace(r"^(..).(.*)$", r"\1\2", regex=True)
return df

0 comments on commit 8951f52

Please sign in to comment.