def get_line_and_trafo_dict(nw):
    """ Get dictionaries of line and transformer data (in order to compare two networks)

    Parameters
    ----------
    nw:
        Network

    Returns
    -------
    Dictionary
        mv_branches_dict
    Dictionary
        lv_branches_dict
    Dictionary
        lv_transformer_dict
    """
    mv_branches_dict = {}
    lv_branches_dict = {}
    lv_transformer_dict = {}
    for mv_district in nw._mv_grid_districts:
        for branch in mv_district.mv_grid.graph_edges():
            mv_branches_dict[branch['branch'].id_db] = {'limiting current':
                branch['branch'].type['I_max_th'], 'length': branch[
                'branch'].length / 1000.0, 'type': branch['branch'].type[
                'name'], 'resistance': branch['branch'].type['R_per_km'],
                'inductance': branch['branch'].type['L_per_km']}
        for LA in mv_district.lv_load_areas():
            for lv_district in LA.lv_grid_districts():
                for branch in lv_district.lv_grid.graph_edges():
                    lv_branches_dict[branch['branch'].id_db] = {
                        'limiting current': branch['branch'].type[
                        'I_max_th'], 'length': branch['branch'].length / 
                        1000.0, 'type': branch['branch'].type.name,
                        'resistance': branch['branch'].type['R_per_km'],
                        'inductance': branch['branch'].type['L_per_km']}
                trafo_count = 0
                for trafo in lv_district.lv_grid._station._transformers:
                    lv_transformer_dict[str(lv_district.lv_grid._station.
                        id_db) + '_' + str(trafo_count)] = {'power': trafo.
                        s_max_a, 'resistance': trafo.r_pu, 'ractance':
                        trafo.x_pu}
    return mv_branches_dict, lv_branches_dict, lv_transformer_dict
