Python AttributeError:意外属性';响应性';算出 将pandas\u datareader.data作为web导入 导入日期时间 从bokeh.plotting导入图形,显示,输出文件 开始=日期时间。日期时间(2016,11,1) end=datetime.datetime(2017,3,10) df=web.DataReader(“TSLA”、“yahoo”、开始、结束) p=图形(x_轴类型='datetime',宽度=1000,高度=300,响应=True) def inc_dec(c,o): 如果c>o: value=“增加” 如果c

Python AttributeError:意外属性';响应性';算出 将pandas\u datareader.data作为web导入 导入日期时间 从bokeh.plotting导入图形,显示,输出文件 开始=日期时间。日期时间(2016,11,1) end=datetime.datetime(2017,3,10) df=web.DataReader(“TSLA”、“yahoo”、开始、结束) p=图形(x_轴类型='datetime',宽度=1000,高度=300,响应=True) def inc_dec(c,o): 如果c>o: value=“增加” 如果c,python,bokeh,Python,Bokeh,调试输出 import pandas_datareader.data as web import datetime from bokeh.plotting import figure,show, output_file start = datetime.datetime(2016,11,1) end = datetime.datetime(2017,3,10) df = web.DataReader("TSLA", "yahoo", start, end) p = figure(x_axis_

调试输出

import pandas_datareader.data as web
import datetime
from bokeh.plotting import figure,show, output_file

start = datetime.datetime(2016,11,1)
end = datetime.datetime(2017,3,10)
df = web.DataReader("TSLA", "yahoo", start, end)
p = figure(x_axis_type='datetime',width=1000, height=300, responsive=True)

def inc_dec(c,o):
    if c > o:
        value = "Increase"
    elif c < o:
        value = "Decrease"
    else:
        value = "Equal"
    return  value

df["status"] = [inc_dec(c,o) for c,o in zip(df.Close,df.Open)]
df["Middle"] = (df.Open + df.Close)/2
df["Height"] = abs(df.Close -df.Open)

hours_12 = 12 * 60 * 60 * 1000

p.rect(df.index[df.Status == "Increase"],
       df.Middle[df.Status == "Increase"],
       hours_12,
       df.Height[df.Status == "Increase"],
       fill_color = "#CCFFFF",
       line_color = "black"
       )

p.rect(df.index[df.Status == "Decrease"],
       df.Middle[df.Status == "Decrease"],
       hours_12,
       df.Height[df.Status == "Decrease"],
       fill_color = "#FF3333",
       line_color = "black"
       )

output_file("Graph.html")
show(p) 
E:\PyCharm项目\RL\venv\Scripts\python.exe“E:\PyCharm社区版2019.1.3\plugins\python ce\helpers\pydev\pydev.py”--multiproc--qt-support=auto--client 127.0.0.1--port 51236--file E:/PyCharm项目/RL/Myflie/bitkubAPI/RealStockGraph.py
pydev调试器:进程4776正在连接
已连接到pydev调试器(build 193.6015.41)
E:\PycharmProjects\RL\venv\lib\site packages\pandas\u datareader\compat\ \uuuu\u init\uuuuu.py:7:FutureWarning:pandas.util.testing不推荐使用。改为使用pandas.testing上的公共API中的函数。
从pandas.util.testing导入assert_frame_equal
回溯(最近一次呼叫最后一次):
文件“E:\PyCharm Community Edition 2019.1.3\plugins\python ce\helpers\pydev\pydevd.py”,第1434行,在_exec中
pydev_imports.execfile(文件、全局、局部)#执行脚本
文件“E:\PyCharm社区版2019.1.3\plugins\python ce\helpers\pydev\\u pydev\u imps\\u pydev\u execfile.py”,execfile中第18行
exec(编译(内容+“\n”,文件,'exec'),全局,loc)
文件“E:/PycharmProjects/RL/Myflie/bitkubAPI/RealStockGraph.py”,第8行,在
p=图形(x_轴类型='datetime',宽度=1000,高度=300,响应=True)
文件“E:\PycharmProjects\RL\venv\lib\site packages\bokeh\plotting\figure.py”,图中第1364行
返回数字(**kwargs)
文件“E:\PycharmProjects\RL\venv\lib\site packages\bokeh\plotting\figure.py”,第155行,在uu init中__
超级()
文件“E:\PycharmProjects\RL\venv\lib\site packages\bokeh\model.py”,第234行,在u init中__
超级()
文件“E:\PycharmProjects\RL\venv\lib\site packages\bokeh\core\has_props.py”,第247行,在u init中__
setattr(自身、名称、值)
文件“E:\PycharmProjects\RL\venv\lib\site packages\bokeh\core\has_props.py”,第282行,位于u setattr中__
(名称,self.\uuuuu类\uuuuu.\uuuuu名称,文本,nice\u连接(匹配)))
AttributeError:意外属性“响应”于图形,可能的属性有:上方、对齐、纵横比、纵横比、背景、背景填充字母、背景填充颜色、下方、边框填充字母、边框填充颜色、中心、css类、禁用、额外x范围、额外y范围、边框高度、边框宽度、高度、高度策略、hidpi、,内部\u高度、内部\u宽度、js\u事件\u回调、js\u属性\u回调、左侧、lod\u因子、lod\u间隔、lod\u阈值、lod\u超时、边距、匹配\u方向、最大\u高度、最大\u宽度、最小\u边框、最小\u边框底部、最小\u边框左侧、最小\u边框右侧、最小边框顶部、最小高度、最小\u宽度、名称、外部\u高度、外部\u宽度、轮廓线\u alpha、,轮廓线上限、轮廓线颜色、轮廓线短划线、轮廓线短划线偏移、轮廓线连接、轮廓线宽度、输出后端、打印高度、打印宽度、渲染器、重置策略、右侧、大小调整模式、订阅的事件、标记、标题、标题位置、工具栏、工具栏位置、工具栏粘性、可见、宽度、宽度策略、x范围、x比例、,y_范围或y_刻度
编辑响应大小调整模式时出现下一个错误 如果大小调整模式=True,则更改为大小调整模式=“缩放宽度”,大小调整模式=“拉伸两个”,大小调整模式=“固定”,大小调整模式=“拉伸宽度”,大小调整模式=“拉伸两个”


看起来你的帖子大部分都是代码;请添加更多详细信息。

答案在例外情况中(不是警告):

AttributeError:意外属性“响应”到Figure

responsive
参数在几年前被删除

在Bokeh的任何合理的现代版本中,您都希望指定
sizing_mode


答案在例外情况中(不是警告):

AttributeError:意外属性“响应”到Figure

responsive
参数在几年前被删除

在Bokeh的任何合理的现代版本中,您都希望指定
sizing_mode


在某个地方有问题吗?在某个地方有问题吗?当我根据大小调整模式进行编辑时,下一个错误值错误:应为str类型的值,为boolOk类型的值为真当我更改大小调整时,没有错误\u模式=为大小调整模式=“缩放宽度”当我根据大小调整模式进行编辑时,下一个错误值错误:应为str类型的值,为boolOk类型的值为True更改大小调整时无错误\u mode=True to size\u mode=“scale\u width”
E:\PycharmProjects\RL\venv\Scripts\python.exe "E:\PyCharm Community Edition 2019.1.3\plugins\python-ce\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 51236 --file E:/PycharmProjects/RL/Myflie/bitkubAPI/RealStockGraph.py
pydev debugger: process 4776 is connecting

Connected to pydev debugger (build 193.6015.41)
E:\PycharmProjects\RL\venv\lib\site-packages\pandas_datareader\compat\__init__.py:7: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.
  from pandas.util.testing import assert_frame_equal
Traceback (most recent call last):
  File "E:\PyCharm Community Edition 2019.1.3\plugins\python-ce\helpers\pydev\pydevd.py", line 1434, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "E:\PyCharm Community Edition 2019.1.3\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "E:/PycharmProjects/RL/Myflie/bitkubAPI/RealStockGraph.py", line 8, in <module>
    p = figure(x_axis_type='datetime',width=1000, height=300, responsive=True)
  File "E:\PycharmProjects\RL\venv\lib\site-packages\bokeh\plotting\figure.py", line 1364, in figure
    return Figure(**kwargs)
  File "E:\PycharmProjects\RL\venv\lib\site-packages\bokeh\plotting\figure.py", line 155, in __init__
    super().__init__(*arg, **kw)
  File "E:\PycharmProjects\RL\venv\lib\site-packages\bokeh\model.py", line 234, in __init__
    super().__init__(**kwargs)
  File "E:\PycharmProjects\RL\venv\lib\site-packages\bokeh\core\has_props.py", line 247, in __init__
    setattr(self, name, value)
  File "E:\PycharmProjects\RL\venv\lib\site-packages\bokeh\core\has_props.py", line 282, in __setattr__
    (name, self.__class__.__name__, text, nice_join(matches)))
AttributeError: unexpected attribute 'responsive' to Figure, possible attributes are above, align, aspect_ratio, aspect_scale, background, background_fill_alpha, background_fill_color, below, border_fill_alpha, border_fill_color, center, css_classes, disabled, extra_x_ranges, extra_y_ranges, frame_height, frame_width, height, height_policy, hidpi, inner_height, inner_width, js_event_callbacks, js_property_callbacks, left, lod_factor, lod_interval, lod_threshold, lod_timeout, margin, match_aspect, max_height, max_width, min_border, min_border_bottom, min_border_left, min_border_right, min_border_top, min_height, min_width, name, outer_height, outer_width, outline_line_alpha, outline_line_cap, outline_line_color, outline_line_dash, outline_line_dash_offset, outline_line_join, outline_line_width, output_backend, plot_height, plot_width, renderers, reset_policy, right, sizing_mode, subscribed_events, tags, title, title_location, toolbar, toolbar_location, toolbar_sticky, visible, width, width_policy, x_range, x_scale, y_range or y_scale