mirror of
https://github.com/koodiklinikka/palkkakysely.git
synced 2026-02-27 02:57:20 +00:00
Allow parametrizing paths
This commit is contained in:
@@ -3,6 +3,8 @@ import re
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
from pulkka.config import DATA_DIR
|
||||
|
||||
COLUMN_MAP = {
|
||||
"Missä kaupungissa työpaikkasi pääasiallinen toimisto sijaitsee?": "Kaupunki",
|
||||
"Työaika (jos työsuhteessa)": "Työaika",
|
||||
@@ -61,7 +63,7 @@ def map_ika(d):
|
||||
|
||||
def read_data() -> pd.DataFrame:
|
||||
df: pd.DataFrame = pd.read_excel(
|
||||
"data/results.xlsx",
|
||||
DATA_DIR / "results.xlsx",
|
||||
skiprows=[1], # Google Sheets exports one empty row
|
||||
)
|
||||
df.rename(columns=COLUMN_MAP, inplace=True)
|
||||
|
||||
Reference in New Issue
Block a user