In [1]:
nl = pymaid.get_neurons('annotation:glomerulus DA1 right')
nl.head()


Out[1]:
neuron_name skeleton_id n_nodes n_connectors n_branch_nodes n_end_nodes open_ends cable_length review_status soma
0 PN glomerulus DA1 57316 ML 2863105 2863104 5222 439 149 157 63 1109.886700 NA True
1 PN glomerulus DA1 57382 ML 57381 7730 360 153 162 71 1215.920600 NA True
2 PN glomerulus DA1 61222 AJ 61221 7875 534 135 140 26 1182.642823 NA True
3 PN glomerulus DA1 57354 GA 57353 4898 327 90 95 52 1113.156682 NA True
4 PN glomerulus DA1 57324 LK JSL 57323 4585 438 120 127 59 1035.099284 NA True

In [2]:
1 == 1


Out[2]:
True

In [3]:
2 == 1


Out[3]:
False

In [4]:
n1 = nl[0]
n2 = nl[0]
n1 == n2


Out[4]:
True

In [5]:
n1 = nl[0]
n2 = nl[1]
n1 == n2


Out[5]:
False

In [6]:
nl == nl


Out[6]:
True

In [7]:
nl == nl[:-1]


Out[7]:
False

In [8]:
nl[[0, 1, 2]] == nl[[2, 1, 0]]


Out[8]:
False

In [9]:
n1 = nl[0]
n2 = n1.copy()
n1 == n2


Out[9]:
True

In [10]:
n1 = nl[0]
n2 = n1.reroot(nl[0].tags['ends'][0], inplace=False)
n1 == n2


Out[10]:
False

In [11]:
n1 = nl[0]
n1 in nl


Out[11]:
True

In [12]:
n1 in nl[1:]


Out[12]:
False

In [13]:
n1.skeleton_id in nl


Out[13]:
True

In [14]:
n1.skeleton_id in nl[1:]


Out[14]:
False

In [15]:
a = [1]
b = [3]
a + b


Out[15]:
[1, 3]

In [16]:
a = nl[0]
b = nl[[1, 2]]
a + b


Out[16]:
neuron_name skeleton_id n_nodes n_connectors n_branch_nodes n_end_nodes open_ends cable_length review_status soma
0 PN glomerulus DA1 57382 ML 57381 7729 360 153 162 71 1215.920599 NA True
1 AL.L(DA1) -{mALT}-> CAL.L-LH.L 2379518 PN022 D... 2379517 4657 411 86 90 31 836.067253 NA True
2 PN glomerulus DA1 57312 LK 57311 4882 429 157 164 105 1182.102458 NA True

In [17]:
a = nl[0]
b = nl[1]
a + b


Out[17]:
neuron_name skeleton_id n_nodes n_connectors n_branch_nodes n_end_nodes open_ends cable_length review_status soma
0 PN glomerulus DA1 57316 ML 2863105 2863104 5222 439 149 157 63 1109.88670 NA True
1 AL.L(DA1) -{mALT}-> CAL.L-LH.L 2319458 PN036 D... 2319457 10209 964 431 458 90 1747.51171 NA True

In [18]:
a = [1, 2, 3]
b = 2
a.pop(b)
a


Out[18]:
[1, 2]

In [19]:
a = nl[[0, 1, 2]]
b = nl[2]
a - b


Out[19]:
neuron_name skeleton_id n_nodes n_connectors n_branch_nodes n_end_nodes open_ends cable_length review_status soma
0 PN glomerulus DA1 57382 ML 57381 7729 360 153 162 71 1215.920599 NA True
1 AL.L(DA1) -{mALT}-> CAL.L-LH.L 2379518 PN022 D... 2379517 4657 411 86 90 31 836.067253 NA True

In [20]:
a = set([0, 1, 2])
b = set([2, 3, 4])
a & b


Out[20]:
{2}

In [21]:
a = nl[[0, 1, 2]]
b = nl[[2, 3, 4]]
a & b


Out[21]:
neuron_name skeleton_id n_nodes n_connectors n_branch_nodes n_end_nodes open_ends cable_length review_status soma
0 PN glomerulus DA1 57312 LK 57311 4882 429 157 164 105 1182.102458 NA True

In [22]:
a = nl[[0, 1, 2]]
b = nl[[2, 3, 4]]
a & b.skeleton_id


Out[22]:
neuron_name skeleton_id n_nodes n_connectors n_branch_nodes n_end_nodes open_ends cable_length review_status soma
0 PN glomerulus DA1 57312 LK 57311 4882 429 157 164 105 1182.102458 NA True

In [23]:
n = nl[0]
n.nodes.head()


Out[23]:
treenode_id parent_id creator_id x y z radius confidence type
0 3046710 32963981 53 442883 212802 44240 -1 5 slab
1 32963981 3046707 150 442931 212892 44040 -1 5 slab
2 652935 652934 22 444126 151826 216240 -1 5 slab
3 3245741 3245737 61 414617 243177 52400 3451 5 end
4 3042776 27298300 53 436753 225519 38000 -1 5 slab

In [24]:
n2 = n / 1000
n2.nodes.head()


Out[24]:
treenode_id parent_id creator_id x y z radius confidence type
0 3046710 32963981 53 442.883 212.802 44.24 -0.001 5 slab
1 32963981 3046707 150 442.931 212.892 44.04 -0.001 5 slab
2 652935 652934 22 444.126 151.826 216.24 -0.001 5 slab
3 3245741 3245737 61 414.617 243.177 52.40 3.451 5 end
4 3042776 27298300 53 436.753 225.519 38.00 -0.001 5 slab

In [25]:
n1 = nl[0]
n1 in nl


Out[25]:
True

In [26]:
n2 = n1.reroot(nl[0].tags['ends'][0], inplace=False)
n2 in nl


Out[26]:
False

In [27]:
nl & n1


Out[27]:
neuron_name skeleton_id n_nodes n_connectors n_branch_nodes n_end_nodes open_ends cable_length review_status soma
0 PN glomerulus DA1 57316 ML 2863105 2863104 5222 439 149 157 63 1109.8867 NA True

In [28]:
nl & n2


WARNING : Skeleton IDs overlap but neuron not identical! Bitwise cancelled! Try using .skeleton_id instead. (pymaid)

In [29]:
n2.skeleton_id in nl


Out[29]:
True

In [30]:
nl & n2.skeleton_id


Out[30]:
neuron_name skeleton_id n_nodes n_connectors n_branch_nodes n_end_nodes open_ends cable_length review_status soma
0 PN glomerulus DA1 57316 ML 2863105 2863104 5222 439 149 157 63 1109.8867 NA True