Joypy演示(Python中的joyplots)无法正常工作? [英] Demo of Joypy (joyplots in python) not working?

查看:44
本文介绍了Joypy演示(Python中的joyplots)无法正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在以下位置处理NBA示例:

解决方案

如果唯一的问题是 Joyplot 中的颜色显示不正确,这是由于执行了归一化,其中级别除以数量曲线.由于曲线数是整数,因此像 curve_number/ncurves 的除法将在python 2中产生0.在python 3中,这是一个浮点数.

因此,在代码中进行除法可能就足够了.

在您的sitepackages文件夹中找到 joyplot.py 并添加

来自__future__进口部门的

 

作为该文件的第一行.

I'm working off the NBA example in: http://sbebo.github.io/blog/blog/2017/08/01/joypy/

I follow the instructions, but my plot does not have the proper colormap. Every one of my histograms is the lowest value on the colormap (yellow in this case). Any suggestions?

解决方案

If the only problem is that the colors in the joyplot are not shown correctly, this is due to the normalization performed, where the levels are divided by the number of curves. Since the number of curves is an integer number, a division like curve_number/ncurves will result in 0 in python 2. In python 3 this is a float.

Hence it will probably be sufficient to make the division work in the code.

Locate joyplot.py in your sitepackages folder and add

from __future__ import division

as very first line in that file.

这篇关于Joypy演示(Python中的joyplots)无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆