Closed musikutiv closed 1 year ago
I am having the same error when the running RNA velocity basics tutorial.
Versions
scvelo==0.2.5 scanpy==1.9.3 anndata==0.8.0 loompy==2.0.16 numpy==1.23.5 scipy==1.10.1 matplotlib==3.7.1 sklearn==1.2.2 pandas==2.0.0
@musikutiv, @cadenmcquillen, I am pretty sure the issue is caused by pandas==2.0.0
. Can you please downgrade and check?
downgrading to pandas 1.5.3 solves the problem. thanks!
Also reported in https://github.com/theislab/cellrank/issues/1018.
@musikutiv, @cadenmcquillen, I am pretty sure the issue is caused by
pandas==2.0.0
. Can you please downgrade and check?
Thank you!
hi, i'm new on python. How can downgrade mantaining same environment? can you post the code pkease?
plotting raises Attribute error
Error output
```pytb --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[9], line 1 ----> 1 scv.pl.velocity_embedding_stream(adata, basis='umap') File ~/miniconda3/envs/scVelo/lib/python3.10/site-packages/scvelo/plotting/velocity_embedding_stream.py:252, in velocity_embedding_stream(adata, basis, vkey, density, smooth, min_mass, cutoff_perc, arrow_color, arrow_size, arrow_style, max_length, integration_direction, linewidth, n_neighbors, recompute, color, use_raw, layer, color_map, colorbar, palette, size, alpha, perc, X, V, X_grid, V_grid, sort_order, groups, components, legend_loc, legend_fontsize, legend_fontweight, xlabel, ylabel, title, fontsize, figsize, dpi, frameon, show, save, ax, ncols, **kwargs) 249 ax.streamplot(X_grid[0], X_grid[1], V_grid[0], V_grid[1], **stream_kwargs) 251 size = 8 * default_size(adata) if size is None else size --> 252 ax = scatter( 253 adata, 254 layer=layer, 255 color=color, 256 size=size, 257 title=title, 258 ax=ax, 259 zorder=0, 260 **scatter_kwargs, 261 ) 262 if save is True: 263 save = "embedding_stream" File ~/miniconda3/envs/scVelo/lib/python3.10/site-packages/scvelo/plotting/scatter.py:668, in scatter(adata, basis, x, y, vkey, color, use_raw, layer, color_map, colorbar, palette, size, alpha, linewidth, linecolor, perc, groups, sort_order, components, projection, legend_loc, legend_loc_lines, legend_fontsize, legend_fontweight, legend_fontoutline, legend_align_text, xlabel, ylabel, title, fontsize, figsize, xlim, ylim, add_density, add_assignments, add_linfit, add_polyfit, add_rug, add_text, add_text_pos, add_margin, add_outline, outline_width, outline_color, n_convolve, smooth, normalize_data, rescale_color, color_gradients, dpi, frameon, zorder, ncols, nrows, wspace, hspace, show, save, ax, **kwargs) 666 if not (add_outline is None or g_bool is None): 667 groups = add_outline --> 668 set_legend( 669 adata, 670 ax, 671 color, 672 legend_loc, 673 scatter_array, 674 legend_fontweight, 675 legend_fontsize, 676 legend_fontoutline, 677 legend_align_text, 678 groups, 679 ) 680 if add_density: 681 plot_density(x, y, add_density, ax=ax) File ~/miniconda3/envs/scVelo/lib/python3.10/site-packages/scvelo/plotting/utils.py:555, in set_legend(adata, ax, value_to_plot, legend_loc, scatter_array, legend_fontweight, legend_fontsize, legend_fontoutline, legend_align_text, groups) 553 legend_fontoutline = 1 554 obs_vals = adata.obs[value_to_plot] --> 555 obs_vals.cat.categories = obs_vals.cat.categories.astype(str) 556 color_keys = adata.uns[f"{value_to_plot}_colors"] 557 if isinstance(color_keys, dict): File ~/miniconda3/envs/scVelo/lib/python3.10/site-packages/pandas/core/base.py:178, in NoNewAttributesMixin.__setattr__(self, key, value) 172 if getattr(self, "__frozen", False) and not ( 173 key == "_cache" 174 or key in type(self).__dict__ 175 or getattr(self, key, None) is not None 176 ): 177 raise AttributeError(f"You cannot add any new attribute '{key}'") --> 178 object.__setattr__(self, key, value) File ~/miniconda3/envs/scVelo/lib/python3.10/site-packages/pandas/core/accessor.py:99, in PandasDelegate._add_delegate_accessors.Versions
```pytb scvelo==0.2.5 scanpy==1.9.3 anndata==0.9.1 loompy==3.0.6 numpy==1.23.5 scipy==1.10.1 matplotlib==3.7.1 sklearn==1.2.2 pandas==2.0.0 ```