navis-org / pymaid

Python library to interface with CATMAID servers. Fully interoperable with navis.
https://pymaid.readthedocs.io/en/latest/
GNU General Public License v3.0
24 stars 11 forks source link

'DataFrame' object has no attribute 'ix' index #201

Closed SridharJagannathan closed 3 years ago

SridharJagannathan commented 4 years ago

Error when plotting a neuron with connectors like below:

catmiad_neuron=pymaid.get_neurons(['6180224'],remote_instance = working_rm)
fig = catmiad_neuron.plot3d(backend='plotly', connectors=True, width=1400)

On further debugging, it seems the pandas has deprecated ix in favor of iloc and loc , see here: https://github.com/schlegelp/pymaid/blob/839863a523949ec64f1fa7112db558943ddc9adb/pymaid/plotting.py#L1316 in this context it would be best to update this like tn = neuron.nodes.set_index('treenode_id').loc[this_cn.treenode_id.values]

schlegelp commented 4 years ago

This is already fixed in the dev branch - I just haven't gotten around merging it as it is a major break with past versions in that it bases pymaid on navis.

I would recommend you install navis from Github and use pymaid's dev branch for now. That would also help me iron out some of the remaining kinks before merging dev into master.

schlegelp commented 3 years ago

pymaid 2.0.1 is now on master and has this issue fixed. Installation now also possible from PyPI: pip3 install python-catmaid