pandana/loaders/pandash5.py
def remove_nodes(network, rm_nodes):
    """
    Create DataFrames of nodes and edges that do not include specified nodes.

    Parameters
    ----------
    network : pandana.Network
    rm_nodes : array_like
        A list, array, Index, or Series of node IDs that should *not*
        be saved as part of the Network.

    Returns
    -------
    nodes, edges : pandas.DataFrame

    """
    rm_nodes = set(rm_nodes)
    ndf = network.nodes_df
    edf = network.edges_df

    nodes_to_keep = ~ndf.index.isin(rm_nodes)
    edges_to_keep = ~(edf['from'].isin(rm_nodes) | edf['to'].isin(rm_nodes))

    return ndf.loc[nodes_to_keep], edf.loc[edges_to_keep]
def remove_nodes(network, rm_nodes):
    rm_nodes = set(rm_nodes)
    ndf = network.nodes_df
    edf = network.edges_df

    nodes_to_keep = ~ndf.index.isin(rm_nodes)
    edges_to_keep = ~(edf['from'].isin(rm_nodes) | edf['to'].isin(rm_nodes))

    return ndf.loc[nodes_to_keep], edf.loc[edges_to_keep]
def remove_nodes ( network , rm_nodes ) : rm_nodes = set ( rm_nodes ) ndf = network . nodes_df edf = network . edges_df nodes_to_keep = ~ ndf . index . isin ( rm_nodes ) edges_to_keep = ~ ( edf [ 'from' ] . isin ( rm_nodes ) | edf [ 'to' ] . isin ( rm_nodes ) ) return ndf . loc [ nodes_to_keep ] , edf . loc [ edges_to_keep ]
Create DataFrames of nodes and edges that do not include specified nodes.

    Parameters
    ----------
    network : pandana.Network
    rm_nodes : array_like
        A list, array, Index, or Series of node IDs that should *not*
        be saved as part of the Network.

    Returns
    -------
    nodes, edges : pandas.DataFrame
Create DataFrames of nodes and edges that do not include specified nodes .