scverse / scverse/scanpy

AttributeError: Can only use .str accessor with string values!

Open
#3,261 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs info❔
Dominant language
Python
Stars
2.6k
Forks
779
Avg merge
1d 4h
Merged PRs (30d)
27

Description

Please make sure these conditions are met
  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of scanpy.
  • (optional) I have confirmed this bug exists on the main branch of scanpy.
What happened?

Dear scanpy teams, research fellows,
I downloaded some scRNA-seq data from https://zenodo.org/records/3357167,
and when I was tring to use anndata.AnnData.concatenate to combine two read count data(I checked their dimensions and the result were Baron_human: [2133,22758] and Segerstolpe: [8569,17500] which means they certainly have different annotated genes), I got below error.

Could u help. many thanks!!

Minimal code sample
all_adata = anndata.AnnData.concatenate(train_adata,test_adata)
Error output
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\strings\accessor.py", line 245, in _validate
    raise AttributeError("Can only use .str accessor with string values!")
AttributeError: Can only use .str accessor with string values!
Versions
>>> scanpy.logging.print_versions()
-----
anndata     0.8.0
scanpy      1.9.3
-----
CIForm              NA
PIL                 9.1.0
astunparse          1.6.3
cffi                1.15.1
colorama            0.4.6
cycler              0.10.0
cython_runtime      NA
dateutil            2.8.2
google              NA
h5py                3.11.0
igraph              0.10.4
joblib              1.2.0
kiwisolver          1.4.2
leidenalg           0.9.1
llvmlite            0.39.1
matplotlib          3.5.2
mpl_toolkits        NA
natsort             8.3.1
nt                  NA
numba               0.56.4
numpy               1.23.5
opt_einsum          v3.3.0
packaging           21.3
pandas              2.2.3
plotly              5.13.1
psutil              5.9.4
pyparsing           3.0.9
pytz                2022.1
scipy               1.10.0
session_info        1.0.0
six                 1.16.0
sklearn             1.2.1
texttable           1.6.7
threadpoolctl       3.1.0
torch               1.13.1+cpu
tqdm                4.64.1
typing_extensions   NA
yaml                6.0
zoneinfo            NA
zope                NA
-----
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
Windows-10-10.0.19041-SP0
-----
Session information updated at 2024-09-26 11:05

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the minimal anndata.AnnData.concatenate call with the reported scanpy, anndata, pandas, and Python versions and the linked datasets. Inspect the resulting traceback and the concatenate path to determine whether the failure is caused by the input annotations or dependency compatibility. Done means the cause is confirmed and the issue has a reproducible fix or clear compatibility guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.