We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e2880c commit 4c81631Copy full SHA for 4c81631
anndata/base.py
@@ -201,7 +201,7 @@ def df_to_records_fixed_width(df):
201
arrays = [index]
202
for k in df.columns:
203
names.append(k)
204
- if is_string_dtype(df[k]):
+ if is_string_dtype(df[k]) and not is_categorical(df[k]):
205
lengths = df[k].map(len)
206
if is_categorical(lengths): lengths = lengths.cat.as_ordered()
207
arrays.append(df[k].values.astype('S{}'.format(lengths.max())))
0 commit comments