def ensure_dtype(data):
    """
    To ensure that input file and output file are comparable,
    data types should be the same in all files.
    #Input:
    @data: pandas DataFrame
    #Output:
    @data_trans: transformed pandas DataFrame with corrected dtype
    """
    # dtypes taken from Hestia website
    data_trans = data.astype(dtype={'cycle.@id': str,
                                    'cycle.name': str,
                                    'cycle.description': str,
                                    'cycle.endDate': str,
                                    'cycle.functionalUnit': str,
                                    'impactAssessment.@id': str,
                                    'impactAssessment.name': str,
                                    'impactAssessment.endDate': str,
                                    'impactAssessment.functionalUnitQuantity': int,
                                    'impactAssessment.allocationMethod': str,
                                    'impactAssessment.systemBoundary': bool,
                                    'site.@id': str,
                                    'site.name': str,
                                    'site.siteType': str,
                                    'source.@id': str,
                                    'source.name': str,
                                    'cycle.site.@id': str,
                                    'cycle.defaultSource.@id': str,
                                    'cycle.inputs.0.term.@id': str,
                                    'cycle.inputs.0.term.name': str,
                                    'cycle.inputs.0.value': float,
                                    'cycle.inputs.1.term.@id': str,
                                    'cycle.inputs.1.term.name': str,
                                    'cycle.inputs.1.value': float,
                                    'cycle.inputs.2.term.@id': str,
                                    'cycle.inputs.2.term.name': str,
                                    'cycle.inputs.2.value': float,
                                    'cycle.inputs.3.term.@id': str,
                                    'cycle.inputs.3.term.name': str,
                                    'cycle.inputs.3.value': float,
                                    'cycle.emissions.0.term.@id': str,
                                    'cycle.emissions.0.term.name': str,
                                    'cycle.emissions.0.value': float,
                                    'cycle.emissions.0.methodModel.@id': str,
                                    'cycle.emissions.0.methodModel.name': str,
                                    'cycle.emissions.0.methodTier': str,
                                    'cycle.emissions.1.term.@id': str,
                                    'cycle.emissions.1.term.name': str,
                                    'cycle.emissions.1.value': float,
                                    'cycle.emissions.1.methodModel.@id': str,
                                    'cycle.emissions.1.methodModel.name': str,
                                    'cycle.emissions.1.methodTier': str,
                                    'cycle.emissions.2.term.@id': str,
                                    'cycle.emissions.2.term.name': str,
                                    'cycle.emissions.2.value': float,
                                    'cycle.emissions.2.methodModel.@id': str,
                                    'cycle.emissions.2.methodModel.name': str,
                                    'cycle.emissions.2.methodTier': str,
                                    'cycle.products.0.term.@id': str,
                                    'cycle.products.0.term.name': str,
                                    'cycle.products.0.value': float,
                                    'cycle.products.0.primary': bool,
                                    'impactAssessment.cycle.@id': str,
                                    'impactAssessment.country.@id': str,
                                    'impactAssessment.country.name': str,
                                    'impactAssessment.product.@id': str,
                                    'impactAssessment.product.name': str,
                                    'impactAssessment.source.@id': str,
                                    'site.defaultSource.@id': str,
                                    'site.country.@id': str,
                                    'site.country.name': str,
                                    'site.measurements.0.term.@id': str,
                                    'site.measurements.0.term.name': str,
                                    'site.measurements.0.value': float,
                                    'site.measurements.1.term.@id': str,
                                    'site.measurements.1.term.name': str,
                                    'site.measurements.1.value': float,
                                    'site.measurements.2.term.@id': str,
                                    'site.measurements.2.term.name': str,
                                    'site.measurements.2.value': float,
                                    'site.measurements.3.term.@id': str,
                                    'site.measurements.3.term.name': str,
                                    'site.measurements.3.value': float,
                                    'source.bibliography.name': str,
                                    'source.bibliography.documentDOI': str,
                                    'source.bibliography.title': str})
    # Return transformed DataFrame
    return data_trans