.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/mdcev_no_outside_good/process_data.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_mdcev_no_outside_good_process_data.py: File process_data.py Michel Bierlaire, EPFL Fri Jul 25 2025, 17:07:29 Import and process the data to be used in Biogeme .. GENERATED FROM PYTHON SOURCE LINES 9-58 .. code-block:: Python import pandas as pd from biogeme.database import Database from biogeme.expressions import Variable # % # Read the data file df = pd.read_csv('data.csv') # % # Convert it to a Biogeme database. database = Database('mdcev_example', df) # % # Associate each column with a Biogeme variable. PersonID = Variable('PersonID') weight = Variable('weight') hhsize = Variable('hhsize') childnum = Variable('childnum') faminc = Variable('faminc') faminc25K = Variable('faminc25K') income = Variable('income') employed = Variable('employed') fulltime = Variable('fulltime') spousepr = Variable('spousepr') spousemp = Variable('spousemp') male = Variable('male') married = Variable('married') age = Variable('age') age2 = Variable('age2') age15_40 = Variable('age15_40') age41_60 = Variable('age41_60') age61_85 = Variable('age61_85') bachigher = Variable('bachigher') white = Variable('white') metro = Variable('metro') diaryday = Variable('diaryday') Sunday = Variable('Sunday') holiday = Variable('holiday') weekearn = Variable('weekearn') weekwordur = Variable('weekwordur') hhchild = Variable('hhchild') ohhchild = Variable('ohhchild') t1 = Variable('t1') t2 = Variable('t2') t3 = Variable('t3') t4 = Variable('t4') number_chosen = Variable('number_chosen') .. _sphx_glr_download_auto_examples_mdcev_no_outside_good_process_data.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: process_data.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: process_data.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: process_data.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_