Skip to content

Conversation

@Nanguage
Copy link
Member

Fig bug #345

Comment on lines -35 to 36

if scipy.issparse(adata.X):
if scipy.sparse.issparse(adata.X):
df = pd.DataFrame(adata.X.toarray(), columns=adata.var_names)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please confirm the version requirement for scipy? does it match up with the one stated in the requirements.txt file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have confirmed that the requirements are met. scipy.sparse.issparse is supported in v1.0.0(https://github.com/scipy/scipy/blob/11509c4a98edded6c59423ac44ca1b7f28fba1fd/scipy/sparse/base.py#L1231)

Comment on lines +42 to 45
_spatial = np.array(df2.index.to_list())
_idx = [str(i[0]) + "_" + str(i[1]) for i in df2.index.to_list()]
df2.index = _idx

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that f2.index.to_list() may be a tuple (for x/y dimensions). what you have assumes the index is just a numeric value

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The index is come from the spatial information so it's the numeric value

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, it should not be a couple of x, y coordinates?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I misunderstood. It is a list composed of tuples (x, y), but the code here can convert it into an array with shape (n, 2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants