成功解决AttributeError: 'PathCollection' object has no property 'n_levels'

目录

解决问题

解决思路

解决方法


解决问题

AttributeError: 'PathCollection' object has no property 'n_levels'

解决思路

属性错误:“PathCollection”对象没有属性“n_levels”

解决方法

def scatter Found at: matplotlib.pyplot中并没有n_levels参数!很可能是代码写的有误,这个参数存在在中,如果必须使用n_levels参数,那么应该加到sns.kdeplot函数中,即可!


def kdeplot Found at: seaborn.distributions@_deprecate_positional_args
def kdeplot(x= # Allow positional x, because behavior will not change with reorgNone, *, y=None, shade= # Note "soft" deprecation, explained belowNone, vertical= # DeprecatedFalse, kernel= # DeprecatedNone, bw= # DeprecatedNone, gridsize= # TODO maybe depend on uni/bivariate?200, cut=3, clip=None, legend=True, cumulative=False, shade_lowest= # Deprecated, controlled with levels nowNone, cbar=False, cbar_ax=None, cbar_kws=None, ax=# New paramsNone, weights= # TODO note that weights is grouped with semanticsNone, hue=None, palette=None, hue_order=None, hue_norm=None, multiple="layer", common_norm=True, common_grid=False, levels=10, thresh=.05, bw_method="scott", bw_adjust=1, log_scale=None, color=None, fill=# Renamed paramsNone, data=None, data2=None, **kwargs):# Handle deprecation of `data2` as name for y variableif data2 is not None:y = data2# If `data2` is present, we need to check for the `data` kwarg being# used to pass a vector for `x`. We'll reassign the vectors and warn.# We need this check because just passing a vector to `data` is now# technically valid.x_passed_as_data = x is None and data is not None and np.ndim(data) == 1if x_passed_as_data:msg = "Use `x` and `y` rather than `data` `and `data2`"x = dataelse:msg = "The `data2` param is now named `y`; please update your code"warnings.warn(msg, FutureWarning)# Handle deprecation of `vertical`if vertical:msg = "The `vertical` parameter is deprecated and will be removed in a "\"future version. Assign the data to the `y` variable instead."warnings.warn(msg, FutureWarning)x, y = y, x# Handle deprecation of `bw`if bw is not None:msg = "The `bw` parameter is deprecated in favor of `bw_method` and "\f"`bw_adjust`. Using {bw} for `bw_method`, but please "\"see the docs for the new parameters and update your code."warnings.warn(msg, FutureWarning)bw_method = bw# Handle deprecation of `kernel`if kernel is not None:msg = "Support for alternate kernels has been removed. "\"Using Gaussian kernel."warnings.warn(msg, UserWarning)# Handle deprecation of shade_lowestif shade_lowest is not None:if shade_lowest:thresh = 0msg = "`shade_lowest` is now deprecated in favor of `thresh`. "\f"Setting `thresh={thresh}`, but please update your code."warnings.warn(msg, UserWarning)# Handle `n_levels`# This was never in the formal API but it was processed, and appeared in an# example. We can treat as an alias for `levels` now and deprecate later.levels = kwargs.pop("n_levels", levels)# Handle "soft" deprecation of shade `shade` is not really the right# terminology here, but unlike some of the other deprecated parameters it# is probably very commonly used and much hard to remove. This is therefore# going to be a longer process where, first, `fill` will be introduced and# be used throughout the documentation. In 0.12, when kwarg-only# enforcement hits, we can remove the shade/shade_lowest out of the# function signature all together and pull them out of the kwargs. Then we# can actually fire a FutureWarning, and eventually remove.if shade is not None:fill = shade# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #p = _DistributionPlotter(data=data, variables=_DistributionPlotter.get_semantics(locals()))p.map_hue(palette=palette, order=hue_order, norm=hue_norm)if ax is None:ax = plt.gca()# Check for a specification that lacks x/y data and return earlyif not p.has_xy_data:return ax# Pack the kwargs for statistics.KDEestimate_kws = dict(bw_method=bw_method, bw_adjust=bw_adjust, gridsize=gridsize, cut=cut, clip=clip, cumulative=cumulative)p._attach(ax, allowed_types=["numeric", "datetime"], log_scale=log_scale)if p.univariate:plot_kws = kwargs.copy()if color is not None:plot_kws["color"] = colorp.plot_univariate_density(multiple=multiple, common_norm=common_norm, common_grid=common_grid, fill=fill, legend=legend, estimate_kws=estimate_kws, **plot_kws)else:p.plot_bivariate_density(common_norm=common_norm, fill=fill, levels=levels, thresh=thresh, legend=legend, color=color, cbar=cbar, cbar_ax=cbar_ax, cbar_kws=cbar_kws, estimate_kws=estimate_kws, **kwargs)return ax

成功解决AttributeError: ‘PathCollection‘ object has no property ‘n_levels‘相关推荐

  1. 成功解决AttributeError: ‘DataFrame‘ object has no attribute ‘tolist‘

    成功解决AttributeError: 'DataFrame' object has no attribute 'tolist' 目录 解决问题 解决思路 解决方法 解决问题 return objec ...

  2. 成功解决AttributeError: ‘NoneType‘ object has no attribute ‘shape‘

    成功解决AttributeError: 'NoneType' object has no attribute 'shape' 目录 解决问题 解决思路 解决方法 解决问题 multiplier = [ ...

  3. 成功解决AttributeError: ‘Series‘ object has no attribute ‘name’

    成功解决AttributeError: 'Series' object has no attribute 'name' 目录 解决问题 解决思路 解决方法 解决问题 AttributeError: ' ...

  4. 成功解决AttributeError: ‘Series‘ object has no attribute ‘columns‘

    成功解决AttributeError: 'Series' object has no attribute 'columns' 目录 解决问题 解决思路 解决方法 解决问题 AttributeError ...

  5. 成功解决AttributeError: ‘int‘ object has no attribute ‘encode‘

    成功解决AttributeError: 'int' object has no attribute 'encode' 目录 解决问题 解决思路 解决方法 解决问题 AttributeError: 'i ...

  6. 成功解决AttributeError: ‘JointGrid‘ object has no attribute ‘annotate‘

    成功解决AttributeError: 'JointGrid' object has no attribute 'annotate' 目录 解决问题 解决思路 解决方法 解决问题 Traceback ...

  7. 成功解决AttributeError : ‘GridSearchCV‘ object has no attribute ‘grid_scores_‘

    成功解决AttributeError : 'GridSearchCV' object has no attribute 'grid_scores_' 目录 解决问题 解决思路 解决方法 解决问题 At ...

  8. 成功解决AttributeError: ‘dict_values‘ object has no attribute ‘index‘

    成功解决AttributeError: 'dict_values' object has no attribute 'index' 目录 解决问题 解决思路 解决方法 解决问题 AttributeEr ...

  9. 成功解决AttributeError: 'list' object has no attribute 'ndim'

    成功解决AttributeError: 'list' object has no attribute 'ndim' 目录 解决问题 解决思路 解决方法 解决问题 AttributeError: 'li ...

最新文章

  1. Linux环境编程--文件基本操作
  2. linux update更新源
  3. leetcode 795. Number of Subarrays with Bounded Maximum | 795. 区间子数组个数(Java)
  4. antlr java_使用ANTLR和Java创建外部DSL
  5. 服务器关掉后django项目停止,Django项目关闭debug模式后,静态文件无法加载的解决办法...
  6. 获取一个类的信息(仿YYClassInfo类)
  7. html特使数字符号,特殊符号大全
  8. 怎么知道服务器是否正版,盗版太坑爹!五招识别Win7旗舰版正版
  9. maven 使用本地库
  10. SEM竞价推广如何提升流量精准度,增加展现、排名、线索量?
  11. jquery禁止复制、禁用右键、文本选择功能、复制按键
  12. java 什么是计算机
  13. Discuz被挂马的处理经验,Dz为什么会被挂马
  14. 【JSP课程设计】个人信息管理系统(代码保姆级)
  15. 应广单片机系列MCU
  16. 电脑软件没运行,内存爆满可以这样解决
  17. alarm中断慢系统调用
  18. 区块链 - DAPP
  19. python爬虫技术整理
  20. XSS 和 CSRF 详解

热门文章

  1. 怎么把数字替换成空格_剑指offer04:替换空格
  2. android简单小项目_烤面筋怎么做到年入20万?小成本!大收益!简单易操作的好项目!...
  3. C项目实践--俄罗斯方块(2)
  4. 为什么可能导致睡眠的函数都不能在中断上下文中使用呢?【转】
  5. 自动化运维工具SaltStack详细部署
  6. 一个SQL Server Sa密码破解的存储过程
  7. VISUAL STUDIO 2008 破解方法
  8. 有关架构图你需要了解的基础知识
  9. 轻松理解https,So easy!
  10. 我对分布式多中心架构的几点看法