diff --git a/data/external/etc/.gitkeep b/data/external/etc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data_model/data_model.py b/data_model/data_model.py index 24dba76..3fb575d 100644 --- a/data_model/data_model.py +++ b/data_model/data_model.py @@ -1216,6 +1216,13 @@ class Employee(Respondent): Factor affecting the Mode choice of the employee """ + alt_commute_mode_other: NoneOrNanString[str] = Field( + ..., description = "Other mode used by the employee to commute to the airport in the past 30 days." + ) + """ + Other mode used by the employee to commute to the airport in the past 30 days + """ + commute_mode_decision_other: NoneOrNanString[str] = Field( ..., description = "(Other) Factor affecting the Mode choice of the employee" ) @@ -1725,6 +1732,13 @@ def is_final_destination(cls): True if the respondent used a personal electric scooter for their trip to SDIA in the last 12 months """ + sdia_accessmode_split_other: NoneOrNanString[str] = Field( + ..., description = "Other mode the respondent used for their trip to SDIA in the last 12 months" + ) + """ + Other mode the respondent used for their trip to SDIA in the last 12 months. + """ + # sdia_accessmode_decision: NoneOrNan[e.ModeDecision] = Field( ..., description = "Factor which affects mode choice, for respondents who do not always used the same mode" @@ -1887,6 +1901,13 @@ def is_final_destination(cls): True if the respondent did not use transit because they prefer other mode(s) """ + reasons_no_transit_other: NoneOrNanString[str] = Field( + ..., description = "Other reason why the respondent did not use transit" + ) + """ + Other reason why the respondent did not use transit. + """ + general_use_transit_resident: NoneOrNan[e.TransitUseFrequency] = Field( ..., description = "General transit use frequency by residents of San Diego region in San Diego region" ) @@ -2083,6 +2104,13 @@ def is_final_destination(cls): True if the visitor used their personal e-scooter during their visit to the San Diego Region. """ + general_modes_used_visitor_other: NoneOrNanString[str] = Field( + ..., description = "Other mode used by the visitor during their visit to the San Diego Region." + ) + """ + Other mode used by the visitor during their visit to the San Diego Region. + """ + non_sdia_flight_frequency: NoneOrNan[e.OtherFlightAndTransitUseFrequency] = Field( ..., description = "Respondent's number of flights from airport other than SDIA in the past 12 months" ) diff --git a/data_model/data_model_v2.py b/data_model/data_model_v2.py deleted file mode 100644 index 9d980e8..0000000 --- a/data_model/data_model_v2.py +++ /dev/null @@ -1,2136 +0,0 @@ -""" -Data Model for the SDIA Survey -""" - -from datetime import datetime -from math import isnan -from typing import Annotated, Any, ClassVar, Literal, Optional, TypeVar, Union, List - -from pydantic import (BaseModel, BeforeValidator, Field, computed_field, - field_validator, model_validator) -from pydantic_extra_types.coordinate import Coordinate, Latitude, Longitude - -import enums as e -import re - - -def coerce_nan_to_none(x: Any, field_name: str) -> Any: - try: - if isinstance(x, (float, int)) and isnan(x): - return None - except TypeError as e: - # Print or log the problematic field and its value - print(f"Error in field '{field_name}' with value: {x}") - raise e # Re-raise the exception for debugging - return x - - -def coerce_nan_string_to_none(x: Any) -> Any: - if x != x: - return None - return x - - -T = TypeVar("T") - -NoneOrNan = Annotated[Optional[T], BeforeValidator(coerce_nan_to_none)] -NoneOrNanString = Annotated[Optional[T], BeforeValidator(coerce_nan_string_to_none)] - - -class PydanticModel(BaseModel): - """ - Base class for all Pydantic models, create in case future modifications are helpful - """ - @model_validator(mode="before") - def convert_datetime(cls, values): - # List of fields to validate - fields_to_check = ['taxi_fhv_fare', 'taxi_fhv_wait', 'parking_cost'] - - for field in fields_to_check: - value = values.get(field) - if isinstance(value, datetime): - values[field] = value.strftime('%Y-%m-%d %H:%M:%S') #change to pass through the data model anyway - values['valid_record'] = False - values['validation_severity'] = "Low" - values['validation_error'] = f"{field} is datetime" - - return values - -class Lat(BaseModel): - lat: Latitude - """Latitude""" - -class Lng(BaseModel): - lng: Longitude - """Longitude""" - -class Coord(BaseModel): - coord: Coordinate - -class Trip(PydanticModel): - """ - Data model for a trip taken by a respondent. - """ - - inbound_or_outbound: NoneOrNan[e.InboundOutbound] = Field( - ..., - description="Whether the trip is inbound to the airport or outbound from the airport", - ) - """ - Whether the trip is inbound to the airport or outbound from the airport. - """ - - origin_activity_type: NoneOrNanString[e.ActivityType] = Field( - ..., description="Activity type at the origin of the trip to the airport" - ) - """ - Activity type at the origin of the trip to the airport. - """ - - origin_activity_type_other: NoneOrNanString[str] = Field( - ..., description="Activity type at the origin of the trip to the airport" - ) - """ - Activity type at the origin of the trip to the airport. - - """ - origin_name: NoneOrNanString[str] = Field( - ..., description="Place name of the origin of the trip to the airport" - ) - """ - Place name of the origin of the trip to the airport. - """ - - origin_city: NoneOrNanString[str] = Field( - ..., description="City of the origin address for the trip to the airport" - ) - """ - City of the origin address for the trip to the airport. - """ - - origin_state: NoneOrNanString[str] = Field( - ..., description="State of the origin address for the trip to the airport" - ) - """ - State of the origin address for the trip to the airport. - """ - - origin_zip: NoneOrNanString[Union[str, int]] = Field( - ..., description="ZIP code of the origin address for the trip to the airport" - ) - """ - ZIP code of the origin address for the trip to the airport. - """ - - origin_latitude: NoneOrNanString[Latitude] = Field( - ..., description="Latitude coordinate of the origin address for the trip to the airport" - ) - """ - Latitude coordinate of the origin address for the trip to the airport. - """ - - origin_longitude: NoneOrNanString[Longitude] = Field( - ..., description="Longitude coordinate of the origin address for the trip to the airport" - ) - """ - Longitude coordinate of the origin address for the trip to the airport. - """ - - destination_activity_type: NoneOrNanString[e.ActivityType] = Field( - ..., - description="Activity type at the destination of the trip from the airport", - ) - """ - Activity type at the destination of the trip from the airport. - """ - - destination_activity_type_other: NoneOrNanString[str] = Field( - ..., - description="Activity type (other) at the destination of the trip from the airport", - ) - """ - Activity type (other) at the destination of the trip from the airport. - """ - - @computed_field( - return_type = e.ActivityType, - description="Activity type prior to traveling to the airport (for inbound) or activity traveling to do next (for outbound).", - ) - @property - def non_airport_activity_type(cls): - """ - Activity type prior to traveling to the airport (for inbound) or activity traveling to do next (for outbound). - """ - if cls.inbound_or_outbound == e.InboundOutbound.INBOUND_TO_AIRPORT: - return cls.origin_activity_type - return cls.destination_activity_type - - destination_name: NoneOrNanString[str] = Field( - ..., description="Place name of the destination from the airport" - ) - """ - Place name of the destination from the airport. - """ - - destination_city: NoneOrNanString[str] = Field( - ..., description="City of the destination address from the airport" - ) - """ - City of the destination address from the airport. - """ - - destination_state: NoneOrNanString[str] = Field( - ..., description="State of the destination address from the airport" - ) - """ - State of the destination address from the airport. - """ - - destination_zip: NoneOrNanString[Union[str, int]] = Field( - ..., description="ZIP code of the destination address from the airport" - ) - """ - ZIP code of the destination address from the airport. - """ - - destination_latitude: NoneOrNanString[Latitude] = Field( - ..., description="Latitude coordinate of the destination address from the airport" - ) - """ - Latitude coordinate of the destination address from the airport. - """ - - destination_longitude: NoneOrNanString[Longitude] = Field( - ..., description="Longitude coordinate of the destination address from the airport" - ) - """ - Longitude coordinate of the destination address from the airport. - """ - - main_transit_mode: NoneOrNanString[e.TravelMode] = Field( - ..., description = "Main Transit mode to/from airport" - ) - """ - Main Transit mode to/from airport. - """ - - main_mode: NoneOrNanString[e.TravelMode] = Field( - ..., description = "Main Mode to/from airport" - ) - """ - Main Mode to/from airport. - """ - - main_mode_other: NoneOrNanString[str] = Field( - ..., description = "Name of the other Main Mode to/from airport" - ) - """ - Name of the other Main Mode to/from airport. - """ - - shared_van_other: NoneOrNanString[str] = Field( - ..., description = "Name of the other shared van service used by respondent" - ) - """ - Name of the other shared van service used by respondent. - """ - - trip_start_time: NoneOrNan[e.DepartTime] = Field( - ..., description="Start time of the trip" - ) - """ - Start time of the trip. - """ - - trip_arrival_time: NoneOrNan[e.DepartTime] = Field( - ..., description="Arrival time of the trip" - ) - """ - Arrival time of the trip. - """ - - number_transit_vehicles_to_airport: NoneOrNanString[e.NumTransfers] = Field( - ..., description = "Number of transit transfers for the inbound trip to the airport" - ) - """ - Number of transit transfers for the inbound trip to the airport - """ - - to_airport_transit_route_1: NoneOrNanString[str] = Field( - ..., description="Name of the First Transit Route to the airport" - ) - """ - Name of the First Transit Route to the airport - """ - - to_airport_transit_route_1_other: NoneOrNanString[str] = Field( - ..., description="Other First Transit Route to the airport" - ) - """ - Other First Transit Route to the airport - """ - - to_airport_transit_route_2: NoneOrNanString[str] = Field( - ..., description="Name of the Second Transit Route to the airport" - ) - """ - Name of the Second Transit Route to the airport - """ - - to_airport_transit_route_2_other: NoneOrNanString[str] = Field( - ..., description="Other Second Transit Route to the airport" - ) - """ - Other Second Transit Route to the airport - """ - - to_airport_transit_route_3: NoneOrNanString[str] = Field( - ..., description="Name of the Third Transit Route to the airport" - ) - """ - Name of the Third Transit Route to the airport - """ - - to_airport_transit_route_3_other: NoneOrNanString[str] = Field( - ..., description="Other Third Transit Route to the airport" - ) - """ - Other Third Transit Route to the airport - """ - - to_airport_transit_route_4: NoneOrNanString[str] = Field( - ..., description="Name of the Fourth Transit Route to the airport" - ) - """ - Name of the Fourth Transit Route to the airport - """ - - to_airport_transit_route_4_other: NoneOrNanString[str] = Field( - ..., description="Other Fourth Transit Route to the airport" - ) - """ - Other Fourth Transit Route to the airport - """ - - access_mode: NoneOrNanString[e.TravelMode] = Field( - ..., description = "Access mode to first transit vehicle for inbound trip to the airport" - ) - """ - Access mode to first transit vehicle for inbound trip to the airport. - """ - - access_mode_other: NoneOrNanString[str] = Field( - ..., description = "Other Access mode to first transit vehicle for inbound trip to the airport" - ) - """ - Other Access mode to first transit vehicle for inbound trip to the airport. - """ - - taxi_fhv_fare: NoneOrNanString[Union[str,float]] = Field( - ..., description = "Taxi or for-hire vehicle fare" - ) - """ - Taxi or for-hire vehicle fare. - """ - - taxi_fhv_wait: NoneOrNanString[Union[str,float]] = Field( - ..., description = "Wait time for taxi or for-hire vehicle" - ) - """ - Wait time for taxi or for-hire vehicle. - """ - - parking_location: NoneOrNanString[e.ParkingLocation] = Field( - ..., description = "Name of respondent's parking location. " - ) - """ - Name of respondent's parking location. - """ - - parking_location_other: NoneOrNanString[str] = Field( - ..., description = "Name of respondent's (other) parking location. " - ) - """ - Name of respondent's (other) parking location. - """ - - parking_cost: NoneOrNanString[Union[str,float]] = Field( - ..., description = "Amount respondent paid to park" - ) - """ - Amount respondent paid to park. - """ - - @computed_field( - return_type = float, - description = "Numeric value of the taxi fare", - ) - @property - def taxi_fhv_fare_numeric(cls): - """ - Numeric Value of Taxi Fare - """ - if isinstance(cls.taxi_fhv_fare, str): - numeric_value = re.findall(r"[-+]?\d*\.?\d+|\d+", cls.taxi_fhv_fare) - return numeric_value[0] if numeric_value else None - return cls.taxi_fhv_fare - - @computed_field( - return_type = float, - description = "Numeric value of the taxi Wait Time", - ) - @property - def taxi_fhv_wait_numeric(cls): - """ - Numeric Value of Taxi Wait Time - """ - if isinstance(cls.taxi_fhv_wait, str): - numeric_value = re.findall(r"[-+]?\d*\.?\d+|\d+", cls.taxi_fhv_wait) - return numeric_value[0] if numeric_value else None - return cls.taxi_fhv_wait - - @computed_field( - return_type = float, - description = "Numeric value of parking cost", - ) - @property - def parking_cost_numeric(cls): - """ - Numeric Value of parking cost - """ - if isinstance(cls.parking_cost, str): - numeric_value = re.findall(r"[-+]?\d*\.?\d+|\d+", cls.parking_cost) - return numeric_value[0] if numeric_value else None - return cls.parking_cost - - - # @model_validator(mode="before") - # def convert_datetime(cls, values): - # # List of fields to validate - # fields_to_check = ['taxi_fhv_fare', 'taxi_fhv_wait', 'parking_cost'] - - # for field in fields_to_check: - # value = values.get(field) - # if isinstance(value, datetime): - # # Option 1: Convert datetime to float (timestamp) - # # values[field] = value.timestamp() - - # # Option 2: Convert datetime to a formatted string - # values[field] = value.strftime('%Y-%m-%d %H:%M:%S') - # values['valid_record'] = False - # values['validation_severity'] = "Low" - # values['validation_error'] = field + f"{field} is datetime" - - # return values - - - parking_cost_frequency: NoneOrNan[e.ParkingCostFrequency] = Field( - ..., description = "Frequency of reported parking cost (e.g., one-time, per hour, per day, per month)" - ) - """ - Frequency of reported parking cost (e.g., one-time, per hour, per day, per month) - """ - - parking_cost_frequency_other: NoneOrNanString[Union[str, int]] = Field( - ..., description = "Other frequency of reported parking cost" - ) - """ - Other frequency of reported parking cost - """ - - reimbursement: NoneOrNan[e.ParkingReimbursement] = Field( - ..., description = "Whether or not ground access cost will be reimbursed by employer or other non-household member" - ) - """ - Whether or not ground access cost will be reimbursed by employer or other non-household member. - """ - number_transit_vehicles_from_airport: NoneOrNanString[e.NumTransfers] = Field( - ..., description = "Number of transit transfers for the inbound trip" - ) - """ - Number of transit transfers for the inbound trip. - """ - - from_airport_transit_route_1: NoneOrNanString[str] = Field( - ..., description="Name of the First Transit Route from the airport" - ) - """ - Name of the First Transit Route from the airport - """ - - from_airport_transit_route_1_other: NoneOrNanString[str] = Field( - ..., description="Other First Transit Route from the airport" - ) - """ - Other First Transit Route from the airport - """ - - from_airport_transit_route_2: NoneOrNanString[str] = Field( - ..., description="Name of the Second Transit Route from the airport" - ) - """ - Name of the Second Transit Route from the airport - """ - - from_airport_transit_route_2_other: NoneOrNanString[str] = Field( - ..., description="Other Second Transit Route from the airport" - ) - """ - Other Second Transit Route from the airport - """ - - from_airport_transit_route_3: NoneOrNanString[str] = Field( - ..., description="Name of the Third Transit Route from the airport" - ) - """ - Name of the Third Transit Route from the airport - """ - - from_airport_transit_route_3_other: NoneOrNanString[str] = Field( - ..., description="Other Third Transit Route from the airport" - ) - """ - Other Third Transit Route from the airport - """ - - from_airport_transit_route_4: NoneOrNanString[str] = Field( - ..., description="Name of the Fourth Transit Route from the airport" - ) - """ - Name of the Fourth Transit Route from the airport - """ - - from_airport_transit_route_4_other: NoneOrNanString[str] = Field( - ..., description="Other Fourth Transit Route from the airport" - ) - """ - Other Fourth Transit Route from the airport - """ - - egress_mode: NoneOrNanString[e.TravelMode] = Field( - ..., description = "Egress mode from last transit vehicle for outbound trip" - ) - """ - Egress mode from last transit vehicle for outbound trip. - """ - - egress_mode_other: NoneOrNanString[str] = Field( - ..., description = "Other Egress mode from last transit vehicle for outbound trip" - ) - """ - Other Egress mode from last transit vehicle for outbound trip. - """ - - transit_boarding_stop_name: NoneOrNanString[str] = Field( - ..., description = "Name of the stop where respondent boarded the main transit mode" - ) - """ - Name of the stop where respondent boarded the main transit mode - """ - - transit_boarding_latitude: NoneOrNanString[Latitude] = Field( - ..., description = "Latitude of the stop where respondent boarded the main transit mode" - ) - """ - Latitude of the stop where respondent boarded the main transit mode - """ - - transit_boarding_longitude: NoneOrNanString[Longitude] = Field( - ..., description = "Longitude of the stop where respondent boarded the main transit mode" - ) - """ - Longitude of the stop where respondent boarded the main transit mode - """ - - transit_alighting_stop_name: NoneOrNanString[str] = Field( - ..., description = "Name of the stop where respondent got off the main transit mode" - ) - """ - Name of the stop where respondent got off the main transit mode - """ - - transit_alighting_latitude: NoneOrNanString[Latitude] = Field( - ..., description = "Latitude of the stop where respondent got off the main transit mode" - ) - """ - Latitude of the stop where respondent got off the main transit mode - """ - - transit_alighting_longitude: NoneOrNanString[Longitude] = Field( - ..., description = "Longitude of the stop where respondent got off the main transit mode" - ) - """ - Longitude of the stop where respondent boarded the main transit mode - """ - - car_available: NoneOrNanString[e.CarAvailability] = Field( - ..., description = "Status of car availability for the trip to the airport" - ) - """ - Status of car availability for the trip to the airport - """ - - car_available_other: NoneOrNanString[str] = Field( - ..., description = "Status of car availability (other than listed) for the trip to the airport" - ) - """ - Status of car availability (other than listed) for the trip to the airport - """ - - -class Respondent(PydanticModel): - """ - Data model for a survey respondent. It includes attributes common to air passengers and employees. - """ - - respondentid: Union[int,str] = Field( - ..., description="Unique identifier for the respondent") - """ - Unique identifier for the respondent. - """ - - is_completed: bool = Field( - ..., description = "True if the record is complete" - ) - """ - True if the record is complete - """ - - is_pilot: bool = Field( - ..., description = "True if the record was collected during the pilot survey" - ) - """ - True if the record was collected during the pilot survey - """ - - record_type_synthetic: bool = Field( - ..., description = "True if the record is synthetically generated" - ) - """ - True if the record is synthetically generated - """ - - - date_completed: NoneOrNanString[datetime] = Field( - ..., description = "Date and time when respondent completed the survey" - ) - """ - Date and time when respondent completed the survey - """ - - submit: NoneOrNanString[bool] = Field( - ..., description = "True if the record is to be used for submittal" - ) - - """ - True if the record is to be used for submittal - """ - - interview_location: NoneOrNan[e.InterviewLocation] = Field( - ..., description = "Location where respondent was intercepted") - """ - Location where respondent was intercepted. - """ - - interview_location_other: NoneOrNanString[str] = Field( - ..., description = "Other Location where respondent was intercepted") - """ - Other Location where respondent was intercepted - """ - - marketsegment: NoneOrNan[e.Type] = Field( - ..., description="Type of respondent, either passenger, employee, or other" - ) - """ - Type of respondent, either passenger, employee, or other. - """ - - is_qualified_age: NoneOrNanString[bool] = Field( - ..., - description="Whether the respondent is of a qualified age to participate in the survey", - ) - """ - Whether the respondent is of a qualified age to participate in the survey. - """ - - # is_qualified_not_connecting: NoneOrNanString[bool] = Field( - # ..., - # description="Whether the respondent is traveling to the airport and therefore qualified to participate in the survey", - # ) - # """ - # Whether the respondent is traveling to the airport and therefore - # """ - - resident_visitor_general: NoneOrNan[e.ResidentVisitorGeneral] = Field( - ..., - description="Whether a resident or a visitor of the San deigo airport service area", - ) - """ - Whether a resident or a visitor of the San deigo airport service area. - """ - - resident_visitor_followup: NoneOrNanString[e.ResidentVisitorFollowup] = Field( - ..., - description="If neither a resident or a visitor, whether the respondent is visiting San Diego", - ) - """ - If neither a resident or a visitor, whether the respondent is visiting San Diego. - """ - - resident_visitor_arriving: NoneOrNanString[bool] = Field( - ..., description = "True if respondent lives outside San Diego Region and is going home by ground transportation" - ) - - """ - True if respondent lives outside San Diego Region and is going home by ground transportation - """ - resident_visitor: NoneOrNan[e.ResidentVisitor] = Field( - ..., - description="Where the respondent resides in the airport service area most of the year", - ) - """ - Where the respondent resides in the airport service area most of the year. - """ - - country_of_residence: NoneOrNan[e.Country] = Field( - ..., - description="Country of residence for international vistors", - ) - """ - Country of residence for international vistors. - """ - - state_of_residence: NoneOrNan[e.State] = Field( - ..., - description="State of residence for US and Mexico residents", - ) - """ - State of residence for US and Mexico residents. - """ - - #Add new here - # home_location_address: NoneOrNanString[str] = Field( - # ..., description = "Street Address of the home location of the respondent" - # ) - # """ - # Street Address of the home location of the respondent - # """ - - home_location_city: NoneOrNanString[str] = Field( - ..., description = "City of the home location of the respondent" - ) - """ - City of the home location of the respondent - """ - - home_location_state: NoneOrNanString[str] = Field( - ..., description = "State of the home location of the respondent" - ) - """ - State of the home location of the respondent - """ - - home_location_zip: NoneOrNanString[Union[str,int]] = Field( - ..., description = "ZIP of the home location of the respondent" - ) - """ - ZIP of the home location of the respondent - """ - - home_location_latitude: NoneOrNanString[Latitude] = Field( - ..., description = "Latitude of the home location of the respondent" - ) - """ - Latitude of the home location of the respondent - """ - - home_location_longitude: NoneOrNanString[Longitude]= Field( - ..., description = "Longitude of the home location of the respondent" - ) - """ - Longitude of the home location of the respondent - """ - - age: NoneOrNan[e.Age] = Field(..., description="Age category of the respondent") - """ - Age category of the respondent. - """ - - gender: NoneOrNan[e.Gender] = Field(..., description="Gender of the respondent") - """ - Gender of the respondent. - """ - - gender_other: NoneOrNanString[str] = Field( - ..., description = "Gender of the respondent (not listed)" - ) - """ - Gender of the respondent (not listed) - """ - - race_aian: NoneOrNanString[bool] = Field( - ..., - description="Does the respondent identify as American Indian or Alaska Native?", - ) - """ - Does the respondent identify as American Indian or Alaska Native? - """ - - race_asian: NoneOrNanString[bool] = Field(..., description="Does the respondent identify as Asian?") - """ - Does the respondent identify as Asian? - """ - - race_black: NoneOrNanString[bool] = Field( - ..., description="Does the respondent identify as Black or African American?" - ) - """ - Does the respondent identify as Black or African American? - """ - - race_hispanic: NoneOrNanString[bool] = Field( - ..., description="Does the respondent identify as Hispanic or Latino?" - ) - """ - Does the respondent identify as Hispanic or Latino? - """ - - race_middle_eastern: NoneOrNanString[bool] = Field( - ..., description="Does the respondent identify as Middle Eastern?" - ) - """ - Does the respondent identify as Middle Eastern? - """ - - race_hp: NoneOrNanString[bool] = Field( - ..., - description="Does the respondent identify as Native Hawaiian or Other Pacific Islander?", - ) - """ - Does the respondent identify as Native Hawaiian or Other Pacific Islander? - """ - - race_white: NoneOrNanString[bool] = Field(..., description="Does the respondent identify as White?") - """ - Does the respondent identify as White? - """ - - race_unknown: NoneOrNanString[bool] = Field( - ..., description="Does the respondent identify as an unknown" - ) - """ - Does the respondent identify as an unknown race/ethnicity? - """ - - race_other: NoneOrNanString[str] = Field( - ..., - description="If the respondent enters a race/ethnicicy not listed above, this field will be populated", - ) - """ - If the respondent enters a race/ethnicity not listed above, this field will be populated. - """ - - number_persons_in_household: NoneOrNan[e.HouseholdSize] = Field( - ..., description="Number of persons in the respondent's household" - ) - """ - Number of persons in the respondent's household. - """ - - number_vehicles: NoneOrNan[e.HouseholdVehicles] = Field( - ..., description="Number of vehicles in the respondent's household" - ) - """ - Number of vehicles in the respondent's household. - """ - - household_income: NoneOrNan[e.HouseholdIncome] = Field( - ..., description="Income range of the respondent's household" - ) - """ - Income range of the respondent's household. - """ - - is_income_below_poverty: NoneOrNanString[e.YesNoType] = Field( - ..., description="Is the respondent's household income below poverty?", - ) - """ - Is the respondent's household income below poverty? - """ - - number_workers: NoneOrNan[e.HouseholdWorkers] = Field( - ..., description="Number of workers in the respondent's household" - ) - """ - Number of workers in the respondent's household. - """ - - sp_invitation: NoneOrNanString[e.YesNoType] = Field( - ..., description = "Whether the respondent chose to participate in the SP Survey" - ) - - """ - Whether the respondent chose to participate in the SP Survey - """ - - stay_informed: NoneOrNanString[e.YesNoType] = Field( - ..., description = "Whether the respondent chose to Stay Informed about the project" - ) - - """ - Whether the respondent chose to Stay Informed about the project - """ - - survey_language: NoneOrNanString[e.SurveyLanguage] = Field( - ..., description = "Language of the Survey" - ) - """ - Language of the Survey - """ - - survey_language_other: NoneOrNanString[str] = Field( - ..., description = "Other (not listed) language of the survey" - ) - """ - Other (not listed) language of the survey - """ - # other_home_language: NoneOrNanString[bool] = Field( - # ..., description = "Does the respondent speak a language other than English at home?", - # ) - # """ - # Does the respondent speak a language other than English at home? - # """ - - # english_proficiency: NoneOrNan[e.EnglishProficiency] = Field( - # ..., description="Respondent's level of English proficiency" - # ) - # """ - # Respondent's level of English proficiency. - # """ - - trip: Trip = Field(..., description="Details of the trip taken by the respondent") - """ - Details of the trip taken by the respondent. - """ - - valid_record: bool = Field( - default=True, description="Indicates if the record is valid") - """ - Indicates if the record is valid - """ - - validation_error: str = Field( - default="", description="Holds validation error messages") - """ - Holds the validation error message - """ - - validation_severity: str = Field( - default = "", description = "Holds the severity of the validation error" - ) - """ - Holds the severity of the validation error - """ - - weight: float = Field( - ..., description = 'Expansion Factor of the observation' - ) - """ - Expansion Factor of the observation - """ - - @model_validator(mode="after") - def prefer_not_disclose_is_unique(cls, values): - race_unknown = values.race_unknown - race_aian = values.race_aian - race_asian = values.race_asian - race_black = values.race_black - race_hispanic = values.race_hispanic - race_middle_eastern = values.race_middle_eastern - race_white = values.race_white - if race_unknown and ( - race_aian - or race_asian - or race_black - or race_hispanic - or race_middle_eastern - or race_white - ): - #values.race_unknown = False - values.valid_record= False - values.validation_error = "Prefer Not to disclose cannot be combined with any other race" - values.validation_severity = "Low" - return values - - v - -class Employee(Respondent): - """ - Data model for an employee respondent. It includes attributes specific to employees. - """ - - # shift_start_location: NoneOrNan[Coord] = Field( - # ..., description = "Longitude and Latitude of building where the employee starts their shift" - # ) - # """ - # Longitude and Latitude of building where the employee starts their shift. - # """ - - shift_start_airport_building: NoneOrNanString[e.SanBuildings] = Field( - ..., description = "Name of building where employee starts their shift" - ) - """ - Name of building where employee starts their shift. - """ - - shift_start_airport_building_other: NoneOrNanString[str] = Field( - ..., description = "Name of building (not listed) where employee starts their shift" - ) - """ - Name of building (not listed) where employee starts their shift. - """ - - employer: NoneOrNanString[e.Employers] = Field( - ..., description = "Name of respondent's employer" - ) - """ - Name of respondent's employer. - """ - - employer_other: NoneOrNanString[str] = Field( - ..., description = "Name (not listed) of respondent's employer" - ) - """ - Name (not listed) of respondent's employer. - """ - - - occupation: NoneOrNanString[e.Occupations] = Field( - ..., description = "Occupation of the employee" - ) - """ - Occupation of the employee. - """ - - occupation_other: NoneOrNanString[str] = Field( - ..., description = "Occupation (other, not listed) of the employee" - ) - """ - Occupation (other, not listed) of the employee - """ - - number_hours_worked: NoneOrNan[e.HoursWorked] = Field( - ..., description = "Number of hours respondent worked in the past 7 days" - ) - """ - Number of hours respondent worked in the past 7 days. - """ - - number_commute_days: NoneOrNan[e.CommuteDays] = Field( - ..., description = "Number of days respondent commuted to the airport in the past 7 days" - ) - """ - Number of days respondent commuted to the airport in the past 7 days. - """ - - shift_start_time: NoneOrNan[e.DepartTime] = Field( - ..., description = "Time when the employee's shift starts" - ) - """ - Time when the employee's shift starts. - """ - - shift_end_time: NoneOrNan[e.DepartTime] = Field( - ..., description = "Time when the employee's shift ends" - ) - """ - Time when the employee's shift ends. - """ -# Add New Here - - reverse_commute_mode: NoneOrNan[e.TravelMode] = Field( - ..., description = "Reverse commute mode for the employee" - ) - """ - Reverse commute mode for the employee - """ - - reverse_commute_mode_other: NoneOrNanString[str] = Field( - ..., description = "Reverse commute mode for the employee (other, not listed)" - ) - """ - Reverse commute mode for the employee (other, not listed) - """ - - same_commute_mode: NoneOrNanString[e.YesNoType] = Field( - ..., description = "True if the employee always used the same travel mode to commute in the last 30 days" - ) - """ - True if the employee always used the same travel mode to commute in the last 30 days - """ - - same_commute_mode_other: NoneOrNanString[str] = Field( - ..., description = "Other Response to employee's travel mode to commute in the last 30 days" - ) - """ - Other Response to employee's travel mode to commute in the last 30 days - """ - - alt_commute_mode_taxi: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used Taxi as a mode to commute to the airport in the past 30 days" - ) - """ - True if the employee used Taxi as a mode to commute to the airport in the past 30 days. - """ - - alt_commute_mode_uber_lyft: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used Uber or Lyft as a mode to commute to the airport in the past 30 days" - ) - """ - True if the employee used Uber or Lyft as a mode to commute to the airport in the past 30 days. - """ - - alt_commute_mode_car_black: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used a black car service as a mode to commute to the airport in the past 30 days" - ) - """ - True if the employee used a black car service as a mode to commute to the airport in the past 30 days. - """ - - alt_commute_mode_picked_by_family_friend: NoneOrNanString[bool] = Field( - ..., description = "True if the employee was picked up by a family member or friend to commute to the airport in the past 30 days" - ) - """ - True if the employee was picked up by a family member or friend to commute to the airport in the past 30 days. - """ - - alt_commute_mode_parked_vehicle_and_drive_alone: NoneOrNanString[bool] = Field( - ..., description = "True if the employee drove alone and parked their vehicle while commuting to the airport in the past 30 days" - ) - """ - True if the employee drove alone and parked their vehicle while commuting to the airport in the past 30 days. - """ - - alt_commute_mode_parked_vehicle_and_drive_with_others: NoneOrNanString[bool] = Field( - ..., description = "True if the employee drove with others and parked their vehicle while commuting to the airport in the past 30 days" - ) - """ - True if the employee drove with others and parked their vehicle while commuting to the airport in the past 30 days. - """ - - alt_commute_mode_parked_vehicle_and_ride_with_other_travelers: NoneOrNanString[bool] = Field( - ..., description = "True if the employee rode with other travelers and parked their vehicle while commuting to the airport in the past 30 days" - ) - """ - True if the employee rode with other travelers and parked their vehicle while commuting to the airport in the past 30 days. - """ - - alt_commute_mode_mts_route_992: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used MTS Route 992 to commute to the airport in the past 30 days" - ) - """ - True if the employee used MTS Route 992 to commute to the airport in the past 30 days. - """ - - alt_commute_mode_airport_flyer_shuttle: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used the Airport Flyer Shuttle to commute to the airport in the past 30 days" - ) - """ - True if the employee used the Airport Flyer Shuttle to commute to the airport in the past 30 days. - """ - - alt_commute_mode_other_public_transit: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used other public transit services to commute to the airport in the past 30 days" - ) - """ - True if the employee used other public transit services to commute to the airport in the past 30 days. - """ - - alt_commute_mode_other_shared_van: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used another type of shared van service to commute to the airport in the past 30 days" - ) - """ - True if the employee used another type of shared van service to commute to the airport in the past 30 days. - """ - - alt_commute_mode_walk: NoneOrNanString[bool] = Field( - ..., description = "True if the employee walked as a mode to commute to the airport in the past 30 days" - ) - """ - True if the employee walked as a mode to commute to the airport in the past 30 days. - """ - - alt_commute_mode_wheelchair: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used a wheelchair to commute to the airport in the past 30 days" - ) - """ - True if the employee used a wheelchair to commute to the airport in the past 30 days. - """ - - alt_commute_mode_bicycle_electric_bikeshare: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used an electric bicycle through a bikeshare service to commute to the airport in the past 30 days" - ) - """ - True if the employee used an electric bicycle through a bikeshare service to commute to the airport in the past 30 days. - """ - - alt_commute_mode_bicycle_non_electric_bikeshare: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used a non-electric bicycle through a bikeshare service to commute to the airport in the past 30 days" - ) - """ - True if the employee used a non-electric bicycle through a bikeshare service to commute to the airport in the past 30 days. - """ - - alt_commute_mode_bicycle_personal_electric_bicycle: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used their personal electric bicycle to commute to the airport in the past 30 days" - ) - """ - True if the employee used their personal electric bicycle to commute to the airport in the past 30 days. - """ - - alt_commute_mode_bicycle_personal_non_electric_bicycle: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used their personal non-electric bicycle to commute to the airport in the past 30 days" - ) - """ - True if the employee used their personal non-electric bicycle to commute to the airport in the past 30 days. - """ - - alt_commute_mode_e_scooter_shared: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used a shared e-scooter to commute to the airport in the past 30 days" - ) - """ - True if the employee used a shared e-scooter to commute to the airport in the past 30 days. - """ - - alt_commute_mode_e_scooter_personal: NoneOrNanString[bool] = Field( - ..., description = "True if the employee used their personal e-scooter to commute to the airport in the past 30 days" - ) - """ - True if the employee used their personal e-scooter to commute to the airport in the past 30 days. - """ - - alt_commute_mode_other: NoneOrNanString[str] = Field( - ..., description = "Other mode used by the employee to commute to the airport in the past 30 days." - ) - """ - Other mode used by the employee to commute to the airport in the past 30 days - """ - - commute_mode_decision: NoneOrNanString[e.ModeDecision] = Field( - ..., description = "Factor affecting the Mode choice of the employee" - ) - """ - Factor affecting the Mode choice of the employee - """ - - commute_mode_decision_other: NoneOrNanString[str] = Field( - ..., description = "(Other) Factor affecting the Mode choice of the employee" - ) - """ - (Other) Factor affecting the Mode choice of the employee - """ - - # past_commute_modes: List[NoneOrNan[e.TravelMode]] = Field( - # ..., description = "Modes used to commute to SDIA in the past 12 months" - # ) - # """ - # Modes used to commute to SDIA in the past 12 months. - # """ - - # alternative_commute_modes: List[NoneOrNan[e.TravelMode]] = Field( - # ..., description = "Modes used to travel to SDIA in the past 30 days" - # ) - # """ - # Modes used to travel to SDIA in the past 30 days. - # """ - - # commute_mode_decision: List[NoneOrNan[e.CommuteModeDecision]] = Field( - # ..., description = "Factors affecting mode choice, for respondents who do not always use the same mode" - # ) - # """ - # Factors affecting mode choice, for respondents who do not always use the same mode. - # """ - - employee_parking: NoneOrNanString[bool] = Field( - ..., description = "Whether the respondent has access to employee parking" - ) - """ - Whether the respondent has access to employee parking. - """ - - - -class AirPassenger(Respondent): - """ - Data model for an air passenger respondent. It includes attributes specific to air passengers. - """ - - passenger_type: NoneOrNanString[e.PassengerType] = Field( - ..., description = "Type of Passenger: Arriving, Departing or Connecting" - ) - """ - Type of Passenger: Arriving, Departing or Connecting - """ - - previous_or_next_airport: NoneOrNanString[str] = Field( - ..., description = "Where is the respondent flying from/flying to" - ) - """ - Where is the respondent flying from/flying to. - """ - - - # @model_validator(mode="before") - # def validate_airport(cls, values): - # # List of fields to validate - # fields_to_check = ['previous_or_next_airport'] - - # for field in fields_to_check: - # value = values.get(field) - # if not isinstance(value, str): - # values[field] = str(value) - # values['valid_record'] = False - # values['validation_severity'] = "Low" - # values['validation_error'] = f"{field} is not string" - - # return values - - airline: NoneOrNanString[e.Airline] = Field( - ..., description = "Airline of the respondent's flight" - ) - """ - Airline of the respondent's flight. - """ - - airline_other: NoneOrNanString[str] = Field( - ..., description = "Other (not listed) airline of the respondent's flight" - ) - """ - Other (not listed) airline of the respondent's flight. - """ - - flight_number: NoneOrNanString[Union[str, int]] = Field( - ..., description = "Flight number of the respondent's flight" - ) - """ - Flight number of the respondent's flight. - """ - - not_using_connecting: NoneOrNanString[bool] = Field( - ..., description = "True if the passenger did not use/is not using any connecting flights in their journey" - ) - """ - True if the passenger did not use/is not using any connecting flights in their journey - """ - - @computed_field( - return_type = e.Terminal, - description = "Airport Terminal for Air Passenger", - ) - @property - def airport_terminal(cls): - """ - Airport Terminal for Air Passenger - """ - if cls.interview_location == e.InterviewLocation.TERMINAL_1: - return e.Terminal.TERMINAL_1 - if cls.interview_location == e.InterviewLocation.TERMINAL_2: - return e.Terminal.TERMINAL_2 - - #Deriving using Airline if location is not a terminal - if cls.airline in range(1,14): - return e.Terminal.TERMINAL_2 - elif cls.airline in [14,15,16,17]: - return e.Terminal.TERMINAL_1 - else: - return e.Terminal.UNKNOWN - - flight_purpose: NoneOrNanString[e.FlightPurpose] = Field( - ..., description = "Purpose of the respondent's flight" - ) - """ - Purpose of the respondent's flight. - """ - - flight_purpose_other: NoneOrNanString[str] = Field( - ..., description = "Other (not listed) purpose of the respondent's flight" - ) - """ - Other (not listed) purpose of the respondent's flight - """ - - checked_bags: NoneOrNan[e.CheckedBags] = Field( - ..., description = "Number of checked bags" - ) - """ - Number of checked bags. - """ - - carryon_bags: NoneOrNan[e.CarryOns] = Field( - ..., description = "Number of carry-on bags" - ) - """ - Number of carry-on bags. - """ - - party_size_flight: NoneOrNanString[e.PartySize] = Field( - ..., description = "Number of people flying with the respondent (count excludes the respondent)" - ) - """ - Number of people flying with the respondent (count excludes the respondent) - """ - - party_size_ground_access_same: NoneOrNanString[bool] = Field( - ..., description = "Whether flying party all traveled to airport together" - ) - """ - Whether flying party all traveled to airport together - """ - - party_size_ground_access: NoneOrNanString[e.PartySize] = Field( - ..., description = "Size of ground access travel party (count excludes the respondent)" - ) - """ - Size of ground access travel party (count excludes the respondent) - """ - - party_includes_child_aged00to05: NoneOrNanString[bool] = Field( - ..., description = "True if the traveling party includes a child aged zero to two" - ) - """ - True if the traveling party includes a child aged zero to two. - """ - - party_includes_child_aged06to17: NoneOrNanString[bool] = Field( - ..., description = "True if the traveling party includes a child aged three to nine" - ) - """ - True if the traveling party includes a child aged three to nine. - """ - - party_includes_coworker: NoneOrNanString[bool] = Field( - ..., description = "True if the traveling party includes a coworker" - ) - """ - True if the traveling party includes a coworker. - """ - - party_includes_friend_relative: NoneOrNanString[bool] = Field( - ..., description = "True if the traveling party includes a friend or relative" - ) - """ - True if the traveling party includes a friend or relative. - """ - - party_includes_mobility_impaired: NoneOrNanString[bool] = Field( - ..., description = "True if the traveling party includes a mobility impaired person" - ) - """ - True if the traveling party includes a mobility impaired person - """ - - -#Add here - sdia_flight_frequency: NoneOrNan[e.SanFlightFrequency] = Field( - ..., description = "Respondent's number of flights from SDIA in the past 12 months" - ) - """ - Respondent's number of flights from SDIA in the past 12 months. - """ - - sdia_previous_accessmode: NoneOrNan[e.SanFlightFrequency] = Field( - ..., description = "Number of times respondent used revealed access modes for other SDIA airport access trips in the past 12 months" - ) - """ - Number of times respondent used revealed access modes for other SDIA airport access trips in the past 12 months. - """ - -#Distribution of all modes: - sdia_accessmode_split_taxi: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used taxi as a mode for his trip to SDIA in the last 12 months") - """ - True if the respondent used taxi as a mode for his trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_uber_lyft: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used Uber or Lyft as a mode for their trip to SDIA in the last 12 months") - """ - True if the respondent used Uber or Lyft as a mode for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_car_black: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used a black car or luxury service for their trip to SDIA in the last 12 months") - """ - True if the respondent used a black car or luxury service for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_dropped_off_by_family_friend: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent was dropped off by a family member or friend for their trip to SDIA in the last 12 months") - """ - True if the respondent was dropped off by a family member or friend for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_drove_alone_and_parked: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent drove alone and parked at SDIA in the last 12 months") - """ - True if the respondent drove alone and parked at SDIA in the last 12 months - """ - - sdia_accessmode_split_drove_with_others_and_parked: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent drove with others and parked at SDIA in the last 12 months") - """ - True if the respondent drove with others and parked at SDIA in the last 12 months - """ - - sdia_accessmode_split_rode_with_other_travelers_and_parked: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent rode with other travelers and parked at SDIA in the last 12 months") - """ - True if the respondent rode with other travelers and parked at SDIA in the last 12 months - """ - - sdia_accessmode_split_mts992: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used MTS992 for their trip to SDIA in the last 12 months") - """ - True if the respondent used MTS992 for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_flyer_shuttle: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used the Flyer Shuttle for their trip to SDIA in the last 12 months") - """ - True if the respondent used the Flyer Shuttle for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_other_public_transit: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used another form of public transit for their trip to SDIA in the last 12 months") - """ - True if the respondent used another form of public transit for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_rental_car_dropped_off: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used a rental car and was dropped off at SDIA in the last 12 months") - """ - True if the respondent used a rental car and was dropped off at SDIA in the last 12 months - """ - - sdia_accessmode_split_rental_car_parked: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent parked a rental car at SDIA in the last 12 months") - """ - True if the respondent parked a rental car at SDIA in the last 12 months - """ - - sdia_accessmode_split_chartered_tour_bus: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used a chartered tour bus for their trip to SDIA in the last 12 months") - """ - True if the respondent used a chartered tour bus for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_hotel_shuttle_van: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used a hotel shuttle van for their trip to SDIA in the last 12 months") - """ - True if the respondent used a hotel shuttle van for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_employee_shuttle: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used an employee shuttle for their trip to SDIA in the last 12 months") - """ - True if the respondent used an employee shuttle for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_other_shared_van: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used another type of shared van service for their trip to SDIA in the last 12 months") - """ - True if the respondent used another type of shared van service for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_walk: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent walked to SDIA in the last 12 months") - """ - True if the respondent walked to SDIA in the last 12 months - """ - - sdia_accessmode_split_wheelchair: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used a wheelchair for their trip to SDIA in the last 12 months") - """ - True if the respondent used a wheelchair for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_bicycle_electric_bikeshare: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used an electric bikeshare for their trip to SDIA in the last 12 months") - """ - True if the respondent used an electric bikeshare for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_bicycle_non_electric_bikeshare: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used a non-electric bikeshare for their trip to SDIA in the last 12 months") - """ - True if the respondent used a non-electric bikeshare for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_bicycle_personal_electric_bicycle: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used a personal electric bicycle for their trip to SDIA in the last 12 months") - """ - True if the respondent used a personal electric bicycle for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_bicycle_personal_non_electric_bicycle: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used a personal non-electric bicycle for their trip to SDIA in the last 12 months") - """ - True if the respondent used a personal non-electric bicycle for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_e_scooter_shared: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used a shared electric scooter for their trip to SDIA in the last 12 months") - """ - True if the respondent used a shared electric scooter for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_e_scooter_personal: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent used a personal electric scooter for their trip to SDIA in the last 12 months") - """ - True if the respondent used a personal electric scooter for their trip to SDIA in the last 12 months - """ - - sdia_accessmode_split_other: NoneOrNanString[str] = Field( - ..., description = "Other mode the respondent used for their trip to SDIA in the last 12 months" - ) - """ - Other mode the respondent used for their trip to SDIA in the last 12 months. - """ - - sdia_accessmode_decision: NoneOrNan[e.ModeDecision] = Field( - ..., description = "Factor which affects mode choice, for respondents who do not always used the same mode" - ) - """ - Factor which affects mode choice, for respondents who do not always used the same mode. - """ - - reverse_mode: NoneOrNan[e.TravelMode] = Field( - ..., description = "Mode that was used in the reverse direction" - ) - """ - Mode that was used in the reverse direction. - """ - pass - - reverse_mode_predicted: NoneOrNan[e.TravelMode] = Field( - ..., description = "Mode that will be used in the reverse direction" - ) - """ - Mode that will be used in the reverse direction. - """ - - reverse_mode_predicted_other: NoneOrNanString[str] = Field( - ..., description = "Mode (not listed) which will be used in the reverse direction" - ) - """ - Mode (not listed) which will be used in the reverse direction - """ - - sdia_transit_awareness: NoneOrNanString[e.YesNoType] = Field( - ..., description = "Whether respondent is aware that buses are serving SDIA" - ) - """ - Whether respondent is aware that buses are serving SDIA - """ -#Reasons to not use transit - reasons_no_transit_not_convenient: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because it is not convenient" - ) - """ - True if the respondent did not use transit because it is not convenient. - """ - - reasons_no_transit_too_complicated: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because it too complicated" - ) - """ - True if the respondent did not use transit because it is too complicated. - """ - - reasons_no_transit_dont_know_how: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because they don't know how" - ) - """ - True if the respondent did not use transit because they don't know how. - """ - - reasons_no_transit_no_good_options: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because there are no good options" - ) - """ - True if the respondent did not use transit because there are no good options - """ - - reasons_no_transit_not_flexible: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because it is not flexible" - ) - """ - True if the respondent did not use transit because it is not flexible. - """ - - reasons_no_transit_not_reliable: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because it is not reliable" - ) - """ - True if the respondent did not use transit because it is not reliable. - """ - - reasons_no_transit_not_safe: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because it is not safe" - ) - """ - True if the respondent did not use transit because it is not safe. - """ - - reasons_no_transit_ride_too_long: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because it takes too long" - ) - """ - True if the respondent did not use transit because it takes too long - """ - - reasons_no_transit_wait_too_long: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because the wait time is too long" - ) - """ - True if the respondent did not use transit because the wait time is too long - """ - - reasons_no_transit_does_not_run_when_needed: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because of it's schedule" - ) - """ - True if the respondent did not use transit because of it's schedule - """ - - reasons_no_transit_too_many_transfers: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because it requries too many transfers" - ) - """ - True if the respondent did not use transit because it requires too many transfers - """ - - reasons_no_transit_stop_too_far: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because the stop is too far" - ) - """ - True if the respondent did not use transit because the stop is too far - """ - - reasons_no_transit_not_economical: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because it is not economical" - ) - """ - True if the respondent did not use transit because it is not economical - """ - - reasons_no_transit_dislike_crowded_trains_buses: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because they don't like crowded trains and buses" - ) - """ - True if the respondent did not use transit because they don't like crowded trains and buses. - """ - - reasons_no_transit_too_much_walking_stairs: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because it involves too much walking and/or stairs" - ) - """ - True if the respondent did not use transit because it too much walking and/or stairs - """ - - reasons_no_transit_dislike_public_transport: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because they don't like public transport" - ) - """ - True if the respondent did not use transit because they don't like public transport - """ - - reasons_no_transit_dislike_public_transport_with_luggage: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because they don't like public transport with luggage" - ) - """ - True if the respondent did not use transit because they don't like public transport with luggage - """ - - reasons_no_transit_prefer_other_mode: NoneOrNanString[bool] = Field( - ..., description = "True if the respondent did not use transit because they prefer other modes(s)" - ) - """ - True if the respondent did not use transit because they prefer other mode(s) - """ - - reasons_no_transit_other: NoneOrNanString[str] = Field( - ..., description = "Other reason why the respondent did not use transit" - ) - """ - Other reason why the respondent did not use transit. - """ - - non_sdia_flight_frequency: NoneOrNan[e.OtherFlightAndTransitUseFrequency] = Field( - ..., description = "Respondent's number of flights from airport other than SDIA in the past 12 months" - ) - """ - Respondent's number of flights from airport other than SDIA in the past 12 months. - """ - - other_airport_accessmode: NoneOrNanString[e.TravelMode] = Field( - ..., description = "Travel mode used to access other airports" - ) - """ - Travel mode used to access other airports - """ - - airport_access_transit_use_elsewhere: NoneOrNanString[e.OtherFlightAndTransitUseFrequency] = Field( - ..., description = "Frequency of Transit use by respondent to access other airports" - ) - """ - Frequency of Transit use by respondent to access other airports. - """ - - airportaccesstransitname: NoneOrNanString[str] = Field( - ..., description = "Names of airports accessed by transit" - ) - """ - Names of airports accessed by transit. - """ - -class ArrivingAirPassenger(AirPassenger): - """ - Data model for an arriving air passenger. It includes attributes specific to arriving air passengers. - """ - - @computed_field( - return_type = str, - description = "Previous flight origin for an arriving passenger", - ) - @property - def previous_flight_origin(cls): - """ - Previous flight origin for an arriving passenger - """ - if cls.passenger_type == e.PassengerType.ARRIVING: - return cls.previous_or_next_airport - - @computed_field( - return_type = bool, - description = "True if the previous flight origin was original and not a layover", - ) - @property - def is_original_origin(cls): - """ - True if the previous flight origin was original and not a layover - """ - return cls.not_using_connecting - - flight_arrival_time: NoneOrNan[e.DepartTime] = Field( - ..., description = "Time of flight arrival" - ) - """ - Time of flight arrival. - """ - - original_flight_origin: NoneOrNanString[str] = Field( - ..., description = "Original origin for arriving passengers" - ) - """ - Original origin for arriving passengers. - """ - -class DepartingAirPassenger(AirPassenger): - """ - Data model for an arriving air passenger. It includes attributes specific to arriving air passengers. - """ - - @computed_field( - return_type = str, - description = "Next Flight Destination for a departing passenger", - ) - @property - def next_flight_destination(cls): - """ - Next Flight Destination for a departing passenger - """ - return cls.previous_or_next_airport - - @computed_field( - return_type = bool, - description = "True if the next flight destination is final and not a layover", - ) - @property - def is_final_destination(cls): - """ - True if the next flight destination is final and not a layover - """ - if cls.passenger_type == e.PassengerType.DEPARTING: - return cls.not_using_connecting - - final_flight_destination: NoneOrNanString[str] = Field( - ..., description = "Final destination of the flight for departing passengers" - ) - """ - Final destination of the flight for departing passengers. - """ - - flight_departure_time: NoneOrNan[e.DepartTime] = Field( - ..., description = "Time of flight departure" - ) - """ - Time of flight departure. - """ - -class Resident(): - """ - Data Model for a Air Passenger who is a resident of the San Deigo Region. - """ - - nights_away: NoneOrNan[e.TravelDuration] = Field( - ..., description = "Number of nights the departing air passengers will be away" - ) - """ - Number of nights the departing air passengers will be away. - """ - - general_use_transit_resident: NoneOrNan[e.TransitUseFrequency] = Field( - ..., description = "General transit use frequency by residents of San Diego region in San Diego region" - ) - """ - General transit use frequency by residents of San Diego region in San Diego region. - """ - pass - -class Visitor(): - """ - Data Model for a Air Passenger who is a visitor of the San Deigo Region. - """ - - convention_center: NoneOrNanString[e.YesNoType] = Field( - ..., description = "Whether the visitor went/going to convention center" - ) - """ - Whether the visitor went/going to convention center. - """ - - convention_center_activity: NoneOrNanString[e.ConventionCenterActivity] = Field( - ..., description = "Type of activity that the respondent conducted at the convention center" - ) - """ - Type of activity that the respondent conducted at the convention center. - """ - - convention_center_activity_other: NoneOrNanString[str] = Field( - ..., description = "Type of activity (not listed) that the respondent conducted at the convention center" - ) - """ - Type of activity (not listed) that the respondent conducted at the convention center. - """ - - nights_visited: NoneOrNan[e.TravelDuration] = Field( - ..., description = "Number of nights the arriving air passengers will be in the San Diego Region" - ) - """ - Number of nights the arriving air passengers will be in the San Diego Region. - """ - - general_use_transit_visitor_home: NoneOrNan[e.TransitUseFrequency] = Field( - ..., description = "General transit use frequency by visitors of San Diego region when home" - ) - """ - General transit use frequency by visitors of San Diego region when home. - """ - - general_modes_used_visitor_taxi: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used Taxi as a mode during their visit to the San Diego Region" - ) - """ - True if the visitor used Taxi as a mode during their visit to the San Diego Region. - """ - - general_modes_used_visitor_uber_lyft: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used Uber or Lyft as a mode during their visit to the San Diego Region" - ) - """ - True if the visitor used Uber or Lyft as a mode during their visit to the San Diego Region. - """ - - general_modes_used_visitor_car_black: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used a black car service as a mode during their visit to the San Diego Region" - ) - """ - True if the visitor used a black car service as a mode during their visit to the San Diego Region. - """ - - general_modes_used_visitor_dropped_off_by_family_friend: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor was dropped off by a family member or friend during their visit to the San Diego Region" - ) - """ - True if the visitor was dropped off by a family member or friend during their visit to the San Diego Region. - """ - - general_modes_used_visitor_drove_alone_and_parked: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor drove alone and parked during their visit to the San Diego Region" - ) - """ - True if the visitor drove alone and parked during their visit to the San Diego Region. - """ - - general_modes_used_visitor_drove_with_others_and_parked: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor drove with others and parked during their visit to the San Diego Region" - ) - """ - True if the visitor drove with others and parked during their visit to the San Diego Region. - """ - - general_modes_used_visitor_rode_with_other_travelers_and_parked: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor rode with other travelers and parked during their visit to the San Diego Region" - ) - """ - True if the visitor rode with other travelers and parked during their visit to the San Diego Region. - """ - - general_modes_used_visitor_coaster: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used the Coaster train during their visit to the San Diego Region" - ) - """ - True if the visitor used the Coaster train during their visit to the San Diego Region. - """ - - general_modes_used_visitor_mts_red_trolley: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used the MTS Red Trolley during their visit to the San Diego Region" - ) - """ - True if the visitor used the MTS Red Trolley during their visit to the San Diego Region. - """ - - general_modes_used_visitor_other_public_bus: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used other public bus services during their visit to the San Diego Region" - ) - """ - True if the visitor used other public bus services during their visit to the San Diego Region. - """ - - general_modes_used_visitor_other_public_transit: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used other public transit services during their visit to the San Diego Region" - ) - """ - True if the visitor used other public transit services during their visit to the San Diego Region. - """ - - general_modes_used_visitor_rental_car_dropped_off: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used a rental car and was dropped off during their visit to the San Diego Region" - ) - """ - True if the visitor used a rental car and was dropped off during their visit to the San Diego Region. - """ - - general_modes_used_visitor_rental_car_parked: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used a rental car and parked during their visit to the San Diego Region" - ) - """ - True if the visitor used a rental car and parked during their visit to the San Diego Region. - """ - - general_modes_used_visitor_chartered_tour_bus: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used a chartered tour bus during their visit to the San Diego Region" - ) - """ - True if the visitor used a chartered tour bus during their visit to the San Diego Region. - """ - - general_modes_used_visitor_hotel_shuttle_van: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used a hotel shuttle or van during their visit to the San Diego Region" - ) - """ - True if the visitor used a hotel shuttle or van during their visit to the San Diego Region. - """ - - general_modes_used_visitor_employee_shuttle: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used an employee shuttle during their visit to the San Diego Region" - ) - """ - True if the visitor used an employee shuttle during their visit to the San Diego Region. - """ - - general_modes_used_visitor_other_shared_van: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used another type of shared van service during their visit to the San Diego Region" - ) - """ - True if the visitor used another type of shared van service during their visit to the San Diego Region. - """ - - general_modes_used_visitor_walk: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor walked as a mode during their visit to the San Diego Region" - ) - """ - True if the visitor walked as a mode during their visit to the San Diego Region. - """ - - general_modes_used_visitor_wheelchair: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used a wheelchair during their visit to the San Diego Region" - ) - """ - True if the visitor used a wheelchair during their visit to the San Diego Region. - """ - - general_modes_used_visitor_bicycle_electric_bikeshare: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used an electric bicycle through a bikeshare service during their visit to the San Diego Region" - ) - """ - True if the visitor used an electric bicycle through a bikeshare service during their visit to the San Diego Region. - """ - - general_modes_used_visitor_bicycle_non_electric_bikeshare: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used a non-electric bicycle through a bikeshare service during their visit to the San Diego Region" - ) - """ - True if the visitor used a non-electric bicycle through a bikeshare service during their visit to the San Diego Region. - """ - - general_modes_used_visitor_bicycle_personal_electric_bicycle: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used their personal electric bicycle during their visit to the San Diego Region" - ) - """ - True if the visitor used their personal electric bicycle during their visit to the San Diego Region. - """ - - general_modes_used_visitor_bicycle_personal_non_electric_bicycle: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used their personal non-electric bicycle during their visit to the San Diego Region" - ) - """ - True if the visitor used their personal non-electric bicycle during their visit to the San Diego Region. - """ - - general_modes_used_visitor_e_scooter_shared: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used a shared e-scooter during their visit to the San Diego Region" - ) - """ - True if the visitor used a shared e-scooter during their visit to the San Diego Region. - """ - - general_modes_used_visitor_e_scooter_personal: NoneOrNanString[bool] = Field( - ..., description = "True if the visitor used their personal e-scooter during their visit to the San Diego Region" - ) - """ - True if the visitor used their personal e-scooter during their visit to the San Diego Region. - """ - - general_modes_used_visitor_other: NoneOrNanString[str] = Field( - ..., description = "Other mode used by the visitor during their visit to the San Diego Region." - ) - """ - Other mode used by the visitor during their visit to the San Diego Region. - """ - pass - - - -class DepartingPassengerResident(DepartingAirPassenger, Resident): - pass - -class DepartingPassengerVisitor(DepartingAirPassenger, Visitor): - pass - -class ArrivingPassengerResident(ArrivingAirPassenger, Resident): - pass - -class ArrivingPassengerVisitor(ArrivingAirPassenger, Visitor): - pass diff --git a/docs/Survey_Documentation_10_16.docx b/docs/Survey_Documentation_10_16.docx deleted file mode 100644 index dcb6e69..0000000 Binary files a/docs/Survey_Documentation_10_16.docx and /dev/null differ diff --git a/docs/draft_RP_questionnaire_2024_09_09.xlsx b/docs/draft_RP_questionnaire_2024_09_09.xlsx deleted file mode 100644 index 4e9f5aa..0000000 Binary files a/docs/draft_RP_questionnaire_2024_09_09.xlsx and /dev/null differ diff --git a/notebooks/data-model-development-helper.ipynb b/notebooks/01-make-clean-data-from-raw-data.ipynb similarity index 66% rename from notebooks/data-model-development-helper.ipynb rename to notebooks/01-make-clean-data-from-raw-data.ipynb index 4a7c487..9d73acf 100644 --- a/notebooks/data-model-development-helper.ipynb +++ b/notebooks/01-make-clean-data-from-raw-data.ipynb @@ -21,7 +21,7 @@ "import pandas as pd\n", "import numpy as np\n", "from pydantic import ValidationError\n", - "import data_model_v2\n", + "import data_model\n", "import enums as e\n", "from utils import extract_base_type, add_enum_label_columns, add_list_objects, add_synthetic_records\n", "import datetime" @@ -33,9 +33,9 @@ "metadata": {}, "outputs": [], "source": [ - "importlib.reload(data_model_v2)\n", + "importlib.reload(data_model)\n", "importlib.reload(e)\n", - "from data_model_v2 import Respondent, Employee, AirPassenger, Trip, DepartingPassengerResident, DepartingPassengerVisitor, ArrivingPassengerResident, ArrivingPassengerVisitor" + "from data_model import Respondent, Employee, AirPassenger, Trip" ] }, { @@ -72,9 +72,9 @@ "name": "stderr", "output_type": "stream", "text": [ - "C:\\Users\\USVV724227\\AppData\\Local\\Temp\\ipykernel_31468\\3592152132.py:10: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "C:\\Users\\USVV724227\\AppData\\Local\\Temp\\ipykernel_27016\\3592152132.py:10: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " in_df_complete['is_completed'] = 1\n", - "C:\\Users\\USVV724227\\AppData\\Local\\Temp\\ipykernel_31468\\3592152132.py:13: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "C:\\Users\\USVV724227\\AppData\\Local\\Temp\\ipykernel_27016\\3592152132.py:13: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " in_df_complete['weight'] = 1\n" ] } @@ -792,7 +792,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "C:\\Users\\USVV724227\\AppData\\Local\\Temp\\ipykernel_31468\\2868064111.py:4: FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`\n", + "C:\\Users\\USVV724227\\AppData\\Local\\Temp\\ipykernel_27016\\2868064111.py:4: FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`\n", " clean_df.replace('-oth-', 98, inplace=True)\n" ] } @@ -1104,27 +1104,27 @@ " \n", " \n", " \n", - " nights_away\n", - " resident_visitor_arriving\n", - " reasons_no_transit_not_flexible\n", - " origin_latitude\n", - " sdia_accessmode_split_dropped_off_by_family_friend\n", - " reasons_no_transit_no_good_options\n", + " employee_parking\n", + " alt_commute_mode_bicycle_electric_bikeshare\n", + " resident_visitor\n", + " race_hp\n", + " general_modes_used_visitor_rental_car_dropped_off\n", + " from_airport_transit_route_2\n", " general_modes_used_visitor_chartered_tour_bus\n", - " main_mode\n", - " origin_state\n", - " reasons_no_transit_too_much_walking_stairs\n", + " home_location_zip\n", + " from_airport_transit_route_1_other\n", + " record_type_synthetic\n", " ...\n", - " party_includes_coworker\n", - " general_modes_used_visitor_employee_shuttle\n", - " general_modes_used_visitor_bicycle_non_electric_bikeshare\n", - " sdia_accessmode_split_chartered_tour_bus\n", - " origin_name\n", - " transit_alighting_longitude\n", - " to_airport_transit_route_1_other\n", - " original_flight_origin\n", - " reasons_no_transit_dislike_public_transport\n", - " reasons_no_transit_dislike_crowded_trains_buses\n", + " parking_cost_frequency_other\n", + " submit\n", + " sdia_accessmode_split_uber_lyft\n", + " race_other\n", + " sdia_accessmode_split_mts992\n", + " to_airport_transit_route_3_other\n", + " destination_city\n", + " reasons_no_transit_ride_too_long\n", + " sdia_accessmode_split_other\n", + " general_modes_used_visitor_bicycle_electric_bikeshare\n", " \n", " \n", " \n", @@ -1132,121 +1132,121 @@ " 0\n", " NaN\n", " NaN\n", + " 8.0\n", " No\n", - " 33.064257\n", - " NaN\n", " No\n", + " NaN\n", " No\n", - " 10.0\n", - " CA\n", - " No\n", + " None\n", + " NaN\n", + " 0\n", " ...\n", - " Yes\n", - " No\n", - " No\n", " NaN\n", + " YES\n", " NaN\n", - " None\n", " NaN\n", " NaN\n", - " No\n", + " NaN\n", + " San Diego\n", + " NaN\n", + " NaN\n", " No\n", " \n", " \n", " 1\n", - " 9.0\n", " NaN\n", - " No\n", - " 32.724246\n", - " Yes\n", - " No\n", " NaN\n", - " 10.0\n", - " CA\n", - " No\n", - " ...\n", + " 1.0\n", " No\n", " NaN\n", " NaN\n", - " No\n", " NaN\n", " None\n", " NaN\n", + " 0\n", + " ...\n", + " NaN\n", + " YES\n", + " Yes\n", " NaN\n", " No\n", - " No\n", - " \n", - " \n", - " 2\n", " NaN\n", + " San Diego\n", " NaN\n", " NaN\n", - " 32.726445\n", " NaN\n", + " \n", + " \n", + " 2\n", " NaN\n", - " No\n", - " 16.0\n", - " CA\n", " NaN\n", - " ...\n", + " 8.0\n", " No\n", " No\n", + " NaN\n", " No\n", " NaN\n", " NaN\n", - " -117.20227\n", + " 0\n", + " ...\n", + " NaN\n", + " NO\n", + " NaN\n", + " NaN\n", " NaN\n", " NaN\n", " NaN\n", " NaN\n", + " NaN\n", + " No\n", " \n", " \n", " 3\n", - " 6.0\n", " NaN\n", " NaN\n", - " 33.161455\n", + " 1.0\n", + " No\n", " NaN\n", " NaN\n", " NaN\n", - " 16.0\n", - " CA\n", + " None\n", " NaN\n", + " 0\n", " ...\n", " NaN\n", + " YES\n", " NaN\n", " NaN\n", " NaN\n", " NaN\n", - " -117.197943\n", - " NaN\n", + " San Diego\n", " NaN\n", " NaN\n", " NaN\n", " \n", " \n", " 4\n", - " 7.0\n", " NaN\n", - " No\n", - " 32.724312\n", " NaN\n", + " 1.0\n", " No\n", " NaN\n", - " 10.0\n", - " CA\n", - " No\n", + " NaN\n", + " NaN\n", + " None\n", + " NaN\n", + " 0\n", " ...\n", - " No\n", " NaN\n", + " YES\n", " NaN\n", " NaN\n", " NaN\n", - " None\n", + " NaN\n", + " San Diego\n", + " NaN\n", " NaN\n", " NaN\n", - " No\n", - " No\n", " \n", " \n", "\n", @@ -1254,82 +1254,68 @@ "" ], "text/plain": [ - " nights_away resident_visitor_arriving reasons_no_transit_not_flexible \\\n", - "0 NaN NaN No \n", - "1 9.0 NaN No \n", - "2 NaN NaN NaN \n", - "3 6.0 NaN NaN \n", - "4 7.0 NaN No \n", - "\n", - " origin_latitude sdia_accessmode_split_dropped_off_by_family_friend \\\n", - "0 33.064257 NaN \n", - "1 32.724246 Yes \n", - "2 32.726445 NaN \n", - "3 33.161455 NaN \n", - "4 32.724312 NaN \n", - "\n", - " reasons_no_transit_no_good_options \\\n", - "0 No \n", - "1 No \n", - "2 NaN \n", - "3 NaN \n", - "4 No \n", + " employee_parking alt_commute_mode_bicycle_electric_bikeshare \\\n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 NaN NaN \n", + "3 NaN NaN \n", + "4 NaN NaN \n", "\n", - " general_modes_used_visitor_chartered_tour_bus main_mode origin_state \\\n", - "0 No 10.0 CA \n", - "1 NaN 10.0 CA \n", - "2 No 16.0 CA \n", - "3 NaN 16.0 CA \n", - "4 NaN 10.0 CA \n", + " resident_visitor race_hp general_modes_used_visitor_rental_car_dropped_off \\\n", + "0 8.0 No No \n", + "1 1.0 No NaN \n", + "2 8.0 No No \n", + "3 1.0 No NaN \n", + "4 1.0 No NaN \n", "\n", - " reasons_no_transit_too_much_walking_stairs ... party_includes_coworker \\\n", - "0 No ... Yes \n", - "1 No ... No \n", - "2 NaN ... No \n", - "3 NaN ... NaN \n", - "4 No ... No \n", + " from_airport_transit_route_2 general_modes_used_visitor_chartered_tour_bus \\\n", + "0 NaN No \n", + "1 NaN NaN \n", + "2 NaN No \n", + "3 NaN NaN \n", + "4 NaN NaN \n", "\n", - " general_modes_used_visitor_employee_shuttle \\\n", - "0 No \n", - "1 NaN \n", - "2 No \n", - "3 NaN \n", - "4 NaN \n", + " home_location_zip from_airport_transit_route_1_other \\\n", + "0 None NaN \n", + "1 None NaN \n", + "2 NaN NaN \n", + "3 None NaN \n", + "4 None NaN \n", "\n", - " general_modes_used_visitor_bicycle_non_electric_bikeshare \\\n", - "0 No \n", - "1 NaN \n", - "2 No \n", - "3 NaN \n", - "4 NaN \n", + " record_type_synthetic ... parking_cost_frequency_other submit \\\n", + "0 0 ... NaN YES \n", + "1 0 ... NaN YES \n", + "2 0 ... NaN NO \n", + "3 0 ... NaN YES \n", + "4 0 ... NaN YES \n", "\n", - " sdia_accessmode_split_chartered_tour_bus origin_name \\\n", - "0 NaN NaN \n", - "1 No NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", + " sdia_accessmode_split_uber_lyft race_other sdia_accessmode_split_mts992 \\\n", + "0 NaN NaN NaN \n", + "1 Yes NaN No \n", + "2 NaN NaN NaN \n", + "3 NaN NaN NaN \n", + "4 NaN NaN NaN \n", "\n", - " transit_alighting_longitude to_airport_transit_route_1_other \\\n", - "0 None NaN \n", - "1 None NaN \n", - "2 -117.20227 NaN \n", - "3 -117.197943 NaN \n", - "4 None NaN \n", + " to_airport_transit_route_3_other destination_city \\\n", + "0 NaN San Diego \n", + "1 NaN San Diego \n", + "2 NaN NaN \n", + "3 NaN San Diego \n", + "4 NaN San Diego \n", "\n", - " original_flight_origin reasons_no_transit_dislike_public_transport \\\n", - "0 NaN No \n", - "1 NaN No \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN No \n", + " reasons_no_transit_ride_too_long sdia_accessmode_split_other \\\n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 NaN NaN \n", + "3 NaN NaN \n", + "4 NaN NaN \n", "\n", - " reasons_no_transit_dislike_crowded_trains_buses \n", - "0 No \n", - "1 No \n", - "2 NaN \n", - "3 NaN \n", - "4 No \n", + " general_modes_used_visitor_bicycle_electric_bikeshare \n", + "0 No \n", + "1 NaN \n", + "2 No \n", + "3 NaN \n", + "4 NaN \n", "\n", "[5 rows x 251 columns]" ] @@ -1349,14 +1335,8 @@ "employee_variables = [field_name for field_name, field_info in Employee.__fields__.items()]\n", "employee_variables.remove('trip')\n", "\n", - "#air_passenger_variables = [field_name for field_name, field_info in AirPassenger.__fields__.items()]\n", - "#air_passenger_variables.remove('trip')\n", - "\n", - "air_passenger_departing_resident_variables = [field_name for field_name, field_info in DepartingPassengerResident.__fields__.items()] \n", - "air_passenger_departing_visitor_variables = [field_name for field_name, field_info in DepartingPassengerVisitor.__fields__.items()]\n", - "air_passenger_arriving_resident_variables = [field_name for field_name, field_info in ArrivingPassengerResident.__fields__.items()]\n", - "air_passenger_arriving_visitor_variables = [field_name for field_name, field_info in ArrivingPassengerVisitor.__fields__.items()]\n", - "air_passenger_variables = list(set(air_passenger_departing_resident_variables + air_passenger_departing_visitor_variables + air_passenger_arriving_resident_variables +air_passenger_arriving_visitor_variables))\n", + "air_passenger_variables = [field_name for field_name, field_info in AirPassenger.__fields__.items()]\n", + "air_passenger_variables.remove('trip')\n", "\n", "variables_to_verify = list(set(air_passenger_variables + respondent_variables + trip_variables + employee_variables))\n", "variables_to_verify.remove('trip')\n", @@ -1448,39 +1428,6 @@ "cell_type": "code", "execution_count": 32, "metadata": {}, - "outputs": [], - "source": [ - "# employee_list = []\n", - "# air_passenger_list = []\n", - "# other_list = []\n", - "# failed_records = []\n", - "\n", - "# for respondent in respondent_list:\n", - "# market_segment = respondent[\"marketsegment\"]\n", - "# try:\n", - "# if market_segment == e.Type.EMPLOYEE:\n", - "# ev = Employee(** respondent)\n", - "# employee_list.append(ev)\n", - "# elif market_segment == e.Type.PASSENGER:\n", - "# av = AirPassenger(** respondent)\n", - "# air_passenger_list.append(av)\n", - "# else:\n", - "# rv = Respondent(** respondent)\n", - "# other_list.append(rv)\n", - "# except ValidationError as err:\n", - "# respondent['error_flag'] = 'failed'\n", - "# respondent['error_message'] = str(err)\n", - "# failed_records.append(respondent) \n", - "\n", - "\n", - "# failed_df = pd.DataFrame(failed_records)\n", - "# failed_df.head()" - ] - }, - { - "cell_type": "code", - "execution_count": 33, - "metadata": {}, "outputs": [ { "data": { @@ -1516,47 +1463,30 @@ "Index: []" ] }, - "execution_count": 33, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "employee_list = []\n", - "arriving_air_passenger_resident_list = []\n", - "arriving_air_passenger_visitor_list = []\n", - "departing_air_passenger_resident_list = []\n", - "departing_air_passenger_visitor_list = []\n", + "air_passenger_list = []\n", "other_list = []\n", "failed_records = []\n", "\n", "for respondent in respondent_list:\n", - " market_segment = respondent[\"marketsegment\"]\n", - " try:\n", + " market_segment = respondent[\"marketsegment\"]\n", + " try:\n", " if market_segment == e.Type.EMPLOYEE:\n", " ev = Employee(** respondent)\n", " employee_list.append(ev)\n", " elif market_segment == e.Type.PASSENGER:\n", - " passenger_type = respondent[\"passenger_type\"]\n", - " resident_visitor_general = respondent[\"resident_visitor_general\"]\n", - " if passenger_type == e.PassengerType.ARRIVING:\n", - " if resident_visitor_general == e.ResidentVisitorGeneral.COMING_HOME:\n", - " apr = ArrivingPassengerResident(** respondent)\n", - " arriving_air_passenger_resident_list.append(apr)\n", - " else: \n", - " apv = ArrivingPassengerVisitor(** respondent)\n", - " arriving_air_passenger_visitor_list.append(apv)\n", - " elif passenger_type == e.PassengerType.DEPARTING:\n", - " if resident_visitor_general == e.ResidentVisitorGeneral.LEAVING_HOME:\n", - " dpr = DepartingPassengerResident(** respondent)\n", - " departing_air_passenger_resident_list.append(dpr)\n", - " else: \n", - " dpv = DepartingPassengerVisitor(** respondent)\n", - " departing_air_passenger_visitor_list.append(dpv)\n", + " av = AirPassenger(** respondent)\n", + " air_passenger_list.append(av)\n", " else:\n", " rv = Respondent(** respondent)\n", " other_list.append(rv)\n", - " except ValidationError as err:\n", + " except ValidationError as err:\n", " respondent['error_flag'] = 'failed'\n", " respondent['error_message'] = str(err)\n", " failed_records.append(respondent) \n", @@ -1568,7 +1498,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -1577,7 +1507,7 @@ "(0, 0)" ] }, - "execution_count": 34, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -1588,39 +1518,16 @@ }, { "cell_type": "code", - "execution_count": 35, - "metadata": {}, - "outputs": [ - { - "ename": "KeyError", - "evalue": "'error_message'", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mKeyError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[1;32mIn[35], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mfailed_df\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43merror_message\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[38;5;241m.\u001b[39munique()\n", - "File \u001b[1;32mc:\\Users\\USVV724227\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\pandas\\core\\frame.py:4102\u001b[0m, in \u001b[0;36mDataFrame.__getitem__\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m 4100\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcolumns\u001b[38;5;241m.\u001b[39mnlevels \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m 4101\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_getitem_multilevel(key)\n\u001b[1;32m-> 4102\u001b[0m indexer \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcolumns\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_loc\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 4103\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m is_integer(indexer):\n\u001b[0;32m 4104\u001b[0m indexer \u001b[38;5;241m=\u001b[39m [indexer]\n", - "File \u001b[1;32mc:\\Users\\USVV724227\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\pandas\\core\\indexes\\range.py:417\u001b[0m, in \u001b[0;36mRangeIndex.get_loc\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m 415\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m(key) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01merr\u001b[39;00m\n\u001b[0;32m 416\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(key, Hashable):\n\u001b[1;32m--> 417\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m(key)\n\u001b[0;32m 418\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_check_indexing_error(key)\n\u001b[0;32m 419\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m(key)\n", - "\u001b[1;31mKeyError\u001b[0m: 'error_message'" - ] - } - ], - "source": [ - "#failed_df['error_message'].unique()" - ] - }, - { - "cell_type": "code", - "execution_count": 36, + "execution_count": 34, "metadata": {}, "outputs": [], "source": [ - "#failed_df['error_message'][0]" + "#failed_df['error_message'].unique()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ @@ -1629,7 +1536,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 36, "metadata": {}, "outputs": [ { @@ -1638,7 +1545,7 @@ "0" ] }, - "execution_count": 37, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -1647,31 +1554,6 @@ "len(failed_df)" ] }, - { - "cell_type": "code", - "execution_count": 42, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Arriving Air Passengers Residents: 37\n", - "Arriving Air Passengers Visitors: 150\n", - "Departing Air Passengers Residents: 1520\n", - "Departing Air Passengers Visitors: 2706\n", - "Total Air Passengers: 4413\n" - ] - } - ], - "source": [ - "print(\"Arriving Air Passengers Residents:\", len(arriving_air_passenger_resident_list))\n", - "print(\"Arriving Air Passengers Visitors:\", len(arriving_air_passenger_visitor_list))\n", - "print(\"Departing Air Passengers Residents:\", len(departing_air_passenger_resident_list))\n", - "print(\"Departing Air Passengers Visitors:\", len(departing_air_passenger_visitor_list))\n", - "print(\"Total Air Passengers:\", len(arriving_air_passenger_resident_list) + len(arriving_air_passenger_visitor_list) + len(departing_air_passenger_resident_list) + len(departing_air_passenger_visitor_list))" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -1681,7 +1563,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 37, "metadata": {}, "outputs": [], "source": [ @@ -1690,7 +1572,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -1713,43 +1595,12 @@ } ], "source": [ - "#passenger_df = pd.DataFrame([AirPassenger.model_dump() for AirPassenger in air_passenger_list])" + "passenger_df = pd.DataFrame([AirPassenger.model_dump() for AirPassenger in air_passenger_list])" ] }, { "cell_type": "code", - "execution_count": 44, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "c:\\Users\\USVV724227\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\pydantic\\main.py:364: UserWarning: Pydantic serializer warnings:\n", - " Expected `enum` but got `Terminal` - serialized value may not be as expected\n", - " return self.__pydantic_serializer__.to_python(\n", - "c:\\Users\\USVV724227\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\pydantic\\main.py:364: UserWarning: Pydantic serializer warnings:\n", - " Expected `float` but got `str` - serialized value may not be as expected\n", - " Expected `enum` but got `Terminal` - serialized value may not be as expected\n", - " return self.__pydantic_serializer__.to_python(\n", - "c:\\Users\\USVV724227\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\pydantic\\main.py:364: UserWarning: Pydantic serializer warnings:\n", - " Expected `float` but got `str` - serialized value may not be as expected\n", - " Expected `float` but got `str` - serialized value may not be as expected\n", - " Expected `enum` but got `Terminal` - serialized value may not be as expected\n", - " return self.__pydantic_serializer__.to_python(\n" - ] - } - ], - "source": [ - "arriving_passenger_resident_df = pd.DataFrame([ArrivingPassengerResident.model_dump() for ArrivingPassengerResident in arriving_air_passenger_resident_list])\n", - "arriving_passenger_visitor_df = pd.DataFrame([ArrivingPassengerVisitor.model_dump() for ArrivingPassengerVisitor in arriving_air_passenger_visitor_list])\n", - "departing_passenger_resident_df = pd.DataFrame([DepartingPassengerResident.model_dump() for DepartingPassengerResident in departing_air_passenger_resident_list])\n", - "departing_passenger_visitor_df = pd.DataFrame([DepartingPassengerVisitor.model_dump() for DepartingPassengerVisitor in departing_air_passenger_visitor_list])" - ] - }, - { - "cell_type": "code", - "execution_count": 45, + "execution_count": 39, "metadata": {}, "outputs": [], "source": [ @@ -1759,7 +1610,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 40, "metadata": {}, "outputs": [ { @@ -1768,7 +1619,7 @@ "102" ] }, - "execution_count": 46, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -1779,7 +1630,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 41, "metadata": {}, "outputs": [ { @@ -1799,7 +1650,7 @@ "source": [ "trip_list = []\n", "id_list = []\n", - "for record in employee_list + arriving_air_passenger_resident_list + arriving_air_passenger_visitor_list + departing_air_passenger_resident_list + departing_air_passenger_visitor_list + other_list:\n", + "for record in employee_list + air_passenger_list + other_list:\n", " trip_list.append(record.trip)\n", " id_list.append(record.respondentid)\n", "\n", @@ -1812,26 +1663,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 42, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "C:\\Users\\USVV724227\\AppData\\Local\\Temp\\ipykernel_29792\\2189731026.py:1: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + "C:\\Users\\USVV724227\\AppData\\Local\\Temp\\ipykernel_27016\\2189731026.py:1: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", " output_df = pd.concat([employee_df, passenger_df, other_df], axis=0).reset_index(drop=True).drop(columns=[\"trip\"])\n" ] } ], "source": [ - "output_df = pd.concat([employee_df, arriving_passenger_resident_df, arriving_passenger_visitor_df, departing_passenger_resident_df, departing_passenger_visitor_df , other_df], axis=0).reset_index(drop=True).drop(columns=[\"trip\"])\n", + "output_df = pd.concat([employee_df, passenger_df, other_df], axis=0).reset_index(drop=True).drop(columns=[\"trip\"])\n", "output_df = pd.merge(output_df, trip_df, on=\"respondentid\", how=\"left\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 43, "metadata": {}, "outputs": [ { @@ -1851,7 +1702,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 44, "metadata": {}, "outputs": [], "source": [ @@ -1860,115 +1711,110 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 45, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n", - "c:\\projects\\SANDAG\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", + "c:\\projects\\SANDAG\\Questionarie_excel_to_word\\Survey_Airport\\data_model\\utils.py:36: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n", " df[enum_name_col] = df[field].map(enum_names).astype(str)\n" ] } ], "source": [ "output_df = add_enum_label_columns(output_df, Respondent)\n", - "\n", - "output_df = add_enum_label_columns(output_df, DepartingPassengerResident)\n", - "output_df = add_enum_label_columns(output_df, DepartingPassengerVisitor)\n", - "output_df = add_enum_label_columns(output_df, ArrivingPassengerResident)\n", - "output_df = add_enum_label_columns(output_df, ArrivingPassengerVisitor)\n", - "\n", + "output_df = add_enum_label_columns(output_df, AirPassenger)\n", "output_df = add_enum_label_columns(output_df, Trip)\n", "output_df = add_enum_label_columns(output_df, Employee)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 46, "metadata": {}, "outputs": [ { @@ -1998,7 +1844,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 47, "metadata": {}, "outputs": [ { @@ -2253,11 +2099,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 48, "metadata": {}, "outputs": [], "source": [ - "output_df.index = output_df.index + 1\n", + "output_df.index = output_df.index+1\n", "output_df.to_csv(output_csv_filename, index_label = 'unique_id')" ] } diff --git a/notebooks/create-variable-summaries.ipynb b/notebooks/02-create-variable-summaries.ipynb similarity index 100% rename from notebooks/create-variable-summaries.ipynb rename to notebooks/02-create-variable-summaries.ipynb diff --git a/notebooks/mode_summaries.ipynb b/notebooks/03-mode-summaries-by-date.ipynb similarity index 100% rename from notebooks/mode_summaries.ipynb rename to notebooks/03-mode-summaries-by-date.ipynb diff --git a/notebooks/compare-pilot-and-original.ipynb b/notebooks/04-compare-pilot-and-original.ipynb similarity index 100% rename from notebooks/compare-pilot-and-original.ipynb rename to notebooks/04-compare-pilot-and-original.ipynb diff --git a/notebooks/make-excel-data-dictionary-from-data-model.ipynb b/notebooks/10-make-excel-data-dictionary-from-data-model.ipynb similarity index 100% rename from notebooks/make-excel-data-dictionary-from-data-model.ipynb rename to notebooks/10-make-excel-data-dictionary-from-data-model.ipynb diff --git a/notebooks/make-word-document-from-excel-data-dictionary.ipynb b/notebooks/11-make-word-document-from-excel-data-dictionary.ipynb similarity index 100% rename from notebooks/make-word-document-from-excel-data-dictionary.ipynb rename to notebooks/11-make-word-document-from-excel-data-dictionary.ipynb diff --git a/notebooks/excel-to-doc.ipynb b/notebooks/12-make-word-docment-from-excel-questionnaire.ipynb similarity index 96% rename from notebooks/excel-to-doc.ipynb rename to notebooks/12-make-word-docment-from-excel-questionnaire.ipynb index 3ad8317..04d9ac2 100644 --- a/notebooks/excel-to-doc.ipynb +++ b/notebooks/12-make-word-docment-from-excel-questionnaire.ipynb @@ -30,8 +30,8 @@ "metadata": {}, "outputs": [], "source": [ - "input_excel_file = \"../docs/draft_RP_questionnaire_2024_09_09.xlsx\"\n", - "output_word_file = \"../docs/Survey_Documentation_09_09.docx\"" + "input_excel_file = \"../reports/draft_RP_questionnaire.xlsx\"\n", + "output_word_file = \"../reports/RP_Questionnaire.docx\"" ] }, { @@ -158,7 +158,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Document saved as ../docs/Survey_Documentation_09_09.docx\n" + "Document saved as ../reports/RP_Questionnaire.docx\n" ] } ], diff --git a/reports/ModeSummariesATC.pbix b/reports/PowerBI/mode-summaries.pbix similarity index 100% rename from reports/ModeSummariesATC.pbix rename to reports/PowerBI/mode-summaries.pbix diff --git a/docs/Survey_Documentation_09_09.docx b/reports/RP_Questionnaire.docx similarity index 53% rename from docs/Survey_Documentation_09_09.docx rename to reports/RP_Questionnaire.docx index c9f643a..3d0ea0d 100644 Binary files a/docs/Survey_Documentation_09_09.docx and b/reports/RP_Questionnaire.docx differ diff --git a/reports/data_dictionary.docx b/reports/data_dictionary.docx index 4a304ff..bd30b44 100644 Binary files a/reports/data_dictionary.docx and b/reports/data_dictionary.docx differ diff --git a/reports/data_dictionary.xlsx b/reports/data_dictionary.xlsx index fb850eb..34c36fb 100644 Binary files a/reports/data_dictionary.xlsx and b/reports/data_dictionary.xlsx differ diff --git a/docs/draft_RP_questionnaire_2024_10_16.xlsx b/reports/draft_RP_questionnaire.xlsx similarity index 100% rename from docs/draft_RP_questionnaire_2024_10_16.xlsx rename to reports/draft_RP_questionnaire.xlsx diff --git a/reports/~$riable_summary.docx b/reports/~$riable_summary.docx deleted file mode 100644 index 426d822..0000000 Binary files a/reports/~$riable_summary.docx and /dev/null differ diff --git a/requirements.data_model.txt b/requirements.txt similarity index 100% rename from requirements.data_model.txt rename to requirements.txt