Skip to content

Commit

Permalink
Data refresh for eurostat physical activity
Browse files Browse the repository at this point in the history
  • Loading branch information
HarishC727 committed Nov 21, 2023
1 parent 1a2fd81 commit 8f4732e
Show file tree
Hide file tree
Showing 22 changed files with 232,183 additions and 7,411 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
_COMMON_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(1, _COMMON_PATH)
# pylint: disable=wrong-import-position
from process import EuroStatAlcoholConsumption
from alcohol_consumption.process import EuroStatAlcoholConsumption
from common.unitest_common_methods import CommonTestClass
# pylint: enable=wrong-import-position

Expand Down
2 changes: 1 addition & 1 deletion scripts/eurostat/health_determinants/bmi/process_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
_COMMON_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(1, _COMMON_PATH)
# pylint: disable=wrong-import-position
from process import EuroStatBMI
from bmi.process import EuroStatBMI
from common.unitest_common_methods import CommonTestClass
# pylint: enable=wrong-import-position

Expand Down
2 changes: 2 additions & 0 deletions scripts/eurostat/health_determinants/common/euro_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ def generate_csv(self) -> pd.DataFrame:
df = self._parse_file(file_name, df, self._import_name)
df['SV'] = df['SV'].str.replace('_Total', '')
df['SV'] = df['SV'].str.replace('_TOTAL', '')
replace_val = [': ', ': u']
df['observation'] = df['observation'].replace(replace_val, '')
dfs.append(df)
final_df = pd.concat(dfs, axis=0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,17 @@
_C_BIRTH = {
'EU28_FOR': 'ForeignBornWithinEU28',
'NEU28_FOR': 'ForeignBornOutsideEU28',
'EU27_2020_FOR': 'ForeignBornWithinEU27',
'NEU27_2020_FOR': 'ForeignBornOutsideEU27',
'FOR': 'ForeignBorn',
'NAT': 'Native'
}

_CITIZEN = {
'EU28_FOR': 'WithinEU28AndNotACitizen',
'NEU28_FOR': 'CitizenOutsideEU28',
'EU27_2020_FOR': 'WithinEU27AndNotACitizen',
'NEU27_2020_FOR': 'CitizenOutsideEU27',
'FOR': 'NotACitizen',
'NAT': 'Citizen'
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/eurostat/health_determinants/common/sv_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@

"hlth_ehis_pe6e": "'Percent_' + 'AtLeast30MinutesPerDay'" + \
"+'_WalkingOrCycling_' + 'PhysicalActivity' + '_In_Count_Person_'" + \
"+'df['isced11'] + '_' + df['sex']'"
"+df['isced11'] + '_' + df['sex']"

},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
_COMMON_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(1, _COMMON_PATH)
# pylint: disable=wrong-import-position
from process import EuroStatFruitsVegetables
from fruits_vegetables.process import EuroStatFruitsVegetables
from common.unitest_common_methods import CommonTestClass
# pylint: enable=wrong-import-position

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _sv_name_correction(self, sv_name: str) -> str:

# Defining Output Files
data_file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"output")
"output_files")

csv_name = "eurostat_population_physicalactivity.csv"
mcf_name = "eurostat_population_physicalactivity.mcf"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
_COMMON_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(1, _COMMON_PATH)
# pylint: disable=wrong-import-position
from process import EuroStatPhysicalActivity
from physical_activity.process import EuroStatPhysicalActivity
from common.unitest_common_methods import CommonTestClass
# pylint: enable=wrong-import-position

Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 8f4732e

Please sign in to comment.