def select_targets_by_prefix(cells, prefix):
    """given all cells and a parameter name that may have a prefix, select the cells it refers to:
    if the param name starts with 'e_' or 'i_' it will be a subpopulation, otherwise return all
    """
    for subpopulation in ['e', 'i']:
        if prefix.startswith(subpopulation + '_'):
            return cells[cells.ei_type == subpopulation]

    return cells