python - 如何解决 Pandas 的属性错误:“AttributeError: module 'pandas' has no attribute 'StringDtype'”?
问题描述
pd.Series(["a","b","c"], dtype=pd.StringDtype())
AttributeError:模块“pandas”没有属性“StringDtype”
解决方案
您需要升级 pandas,因为pandas.StringDtype
在 pandas 1.0.0+ 中实现:
类 pandas.StringDtype
字符串数据的扩展 dtype。
1.0.0 版中的新功能。
推荐阅读
- webpack - TailwindCSS JIT Webpack HMR 不断用 themekit 重新编译
- angular - 在命名插座中传递参数不起作用
- c - 在 MPI 中按顺序运行 for 循环的某些部分
- .net - 为避免使用 API,我不能只写入 Google Drive 文件夹吗?我如何找到它?
- docker - Docker:traefik 反向代理 + 自己的 dockerfile = 坏网关
- python - 为什么我的计算器 GUI 单元测试显示 AssertionError?
- scipy - sympy中符号和的复杂度
- react-native - 登录后如何隐藏按钮导航(React Native)
- material-ui - 用于 groupBy 标题的 Material UI 自动完成自定义 CSS
- javascript - 如何在字符串中获取选定的多复选框值