navis.remove_nodes¶
- navis.remove_nodes(x, which, inplace=False)[source]¶
Drop nodes from neuron without disconnecting it.
Dropping node 2 from 1->2->3 will lead to connectivity 1->3.
- Parameters:
x (TreeNeuron) – Neuron to remove nodes from.
which (list of node IDs) – IDs of nodes to remove.
inplace (bool) – If True, will rewire the neuron inplace. If False, will return a rewired copy of the neuron.
- Return type:
Examples
Drop points from a neuron
>>> import navis >>> n = navis.example_neurons(1) >>> n.n_nodes 4465 >>> # Drop a hundred nodes >>> n2 = navis.remove_nodes(n, n.nodes.node_id.values[100:200]) >>> n2.n_nodes 4365