STREAM icon indicating copy to clipboard operation
STREAM copied to clipboard

Error with st.plot_stream()

Open aradley opened this issue 3 years ago • 1 comments

Hi,

Really like what I've been able to do with the software so far. Unfortunately, the functionality I was most looking forward to using, the st.plot_stream() function, appears to be pulling up an error.

I've confirmed this error on both my dataset and your example Nestorowa dataset by following your notebook examples. Everything appears to work and plot correctly up to the single cell stream plot with st.plot_stream_sc(). Sadly when I try st.plot_stream(), I get the following error.

'''' Traceback (most recent call last): File "", line 1, in File "/home/ahr35/miniconda3/envs/env_stream/lib/python3.7/site-packages/stream/core.py", line 3131, in plot_stream log_scale=log_scale,factor_zoomin=factor_zoomin) File "/home/ahr35/miniconda3/envs/env_stream/lib/python3.7/site-packages/stream/extra.py", line 933, in cal_stream_polygon_string df_stream.loc[df_stream.index[id_cells],'edge'] = [x] File "/home/ahr35/miniconda3/envs/env_stream/lib/python3.7/site-packages/pandas/core/indexing.py", line 692, in setitem iloc._setitem_with_indexer(indexer, value, self.name) File "/home/ahr35/miniconda3/envs/env_stream/lib/python3.7/site-packages/pandas/core/indexing.py", line 1635, in _setitem_with_indexer self._setitem_with_indexer_split_path(indexer, value, name) File "/home/ahr35/miniconda3/envs/env_stream/lib/python3.7/site-packages/pandas/core/indexing.py", line 1672, in _setitem_with_indexer_split_path self._setitem_with_indexer_2d_value(indexer, value) File "/home/ahr35/miniconda3/envs/env_stream/lib/python3.7/site-packages/pandas/core/indexing.py", line 1733, in _setitem_with_indexer_2d_value "Must have equal len keys and value when setting with an ndarray" ValueError: Must have equal len keys and value when setting with an ndarray ''''

My first guess is this is a deprecation issue with Pandas? This also would make sense because I get this warning when importing stream: ''' /home/ahr35/miniconda3/envs/env_stream/lib/python3.7/site-packages/rpy2/robjects/pandas2ri.py:17: FutureWarning: pandas.core.index is deprecated and will be removed in a future version. The public classes are available in the top-level namespace. from pandas.core.index import Index as PandasIndex ''''

Bit confused since I installed the entire STREAM environment through miniconda. Any ideas?

Thanks,

Arthur

aradley avatar Jan 31 '21 16:01 aradley

Ok yes, I downgraded to pandas==1.0 and the problem went away.

Some extra information for yourselves. I tried this with most of your available branches/versions and got the same error, so the most recent version of pandas may be incompatible in all versions (including STREAM2).

Hope this is helpful.

Best,

Arthur

aradley avatar Jan 31 '21 17:01 aradley