Comments (3)
These arrays aren't being concatenated, they are just being compared.
This is just to see if they are equal so we know whether to keep that around in the result or not. https://anndata.readthedocs.io/en/latest/concatenation.html#merging-uns
The specific use case here was comparing images. It's very possible that we should look into faster ways to compare these things. Maybe fast paths when the objects are the same, hashing, etc.
from anndata.
Think I figured out why we convert to pandas. It's because np.array_equal(..., equal_nan=True)
doesn't work for some non-numeric dtypes...
Specifically:
In [6]: a = anndata.tests.helpers.gen_vstr_recarray(5, 2)
In [7]: np.array_equal(a, a, equal_nan=True)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[7], line 1
----> 1 np.array_equal(a, a, equal_nan=True)
File <__array_function__ internals>:180, in array_equal(*args, **kwargs)
File ~/miniforge3/envs/scanpy-dev/lib/python3.11/site-packages/numpy/core/numeric.py:2465, in array_equal(a1, a2, equal_nan)
2463 return bool(asarray(a1 == a2).all())
2464 # Handling NaN values if equal_nan is True
-> 2465 a1nan, a2nan = isnan(a1), isnan(a2)
2466 # NaN's occur at different locations
2467 if not (a1nan == a2nan).all():
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
from anndata.
while this is possibly a generic user behaviour, are we sure this shouldn't error anyway? what's the use case of concatenating arrays in uns?
from anndata.
Related Issues (20)
- TypeError: Can't implicitly convert non-string objects to strings HOT 4
- Error concatenating scRNA with visium dataset
- memory usage of concat HOT 3
- Using `Pint` for units HOT 9
- UMAP of gene subset of adata HOT 1
- Error using sc.pl.stacked_violin HOT 1
- NotImplementedError with concat_on_disk
- Issue when setting anndata.X to numpy array HOT 3
- Does anndata.raw can be automatically modified after define it?
- Make the call to `_check_uniqueness()` optional in `_init_as_actual()` (and `__init__()`) HOT 1
- `concat_on_disk` outer join
- `concat_on_disk` merge strategies are untested/not implemented
- Potentially flaky benchmark HOT 1
- Reading Anndata from only parts of h5ad file: Hack solution HOT 8
- 2D indexing (no “:”) in `sparse_dataset` is not lazy HOT 7
- Set of categories changes when slicing AnnData, but not when slicing DataFrame HOT 1
- Gpu failing because of `cp.full` with `np.nan`
- Add path parameter to write_zarr method HOT 7
- GPU writing HOT 1
- GPU concatenation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anndata.