V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
yellowtail
V2EX  ›  Python

每次遇到问题就想重新学一次 Python 是什么心态。。

  •  
  •   yellowtail · 2019-05-04 19:41:11 +08:00 · 3326 次点击
    这是一个创建于 1790 天前的主题,其中的信息可能已经有所发展或是发生改变。
    https://imgchr.com/i/EdDujJ

    请大佬帮我看看 为什么我的 kdj 里 k 值一直是零 唉!有心无力了
    10 条回复    2019-05-05 13:39:10 +08:00
    staticer
        1
    staticer  
       2019-05-04 19:56:10 +08:00   ❤️ 1
    我认为可能的原因: 你用的 Python 2, 却在用 Python 3 的除法思想。
    renmu123
        2
    renmu123  
       2019-05-04 20:04:55 +08:00 via Android
    看这个 print 应该就是 Python2 了,建议转 Python3,坑少多了。看你的代码风格应该是新手(早转早香),可以去看一下 PEP8 规范
    yellowtail
        3
    yellowtail  
    OP
       2019-05-04 20:18:15 +08:00
    @staticer 不太明白,能不能仔细说一下。。
    yellowtail
        4
    yellowtail  
    OP
       2019-05-04 20:20:56 +08:00
    @staticer 改了下 rsv_9.loc [i,'k']=2*rsv_9.loc [i,'k']/3+rsv_9.loc [i,'rsv9']/3 有用了!谢谢 (不过这种问题真的好心累)
    lithiumii
        5
    lithiumii  
       2019-05-04 20:26:58 +08:00
    建议重学,这次学 py 3
    不过话说回来,每次遇到问题就需要学习难道不是很正常的一件事吗?地球上有任何一个正常人类可以做到学一门编程语言只学一次吗?
    inoki
        6
    inoki  
       2019-05-04 20:32:34 +08:00 via Android   ❤️ 1
    2/3 int/int->int
    2.0/3 float/int->float
    mamahaha
        7
    mamahaha  
       2019-05-04 22:53:28 +08:00
    遇到问题可以歇俩天,尤其是复用结构,有时本来计划结构大调整做好玩命的准备了,两天后想通了改了几行代码就解决了。
    kuangwinnie
        8
    kuangwinnie  
       2019-05-05 07:13:33 +08:00
    9102 了别写 py2 了我的朋友
    leavic
        9
    leavic  
       2019-05-05 11:16:13 +08:00
    int/int 得 int
    Northxw
        10
    Northxw  
       2019-05-05 13:39:10 +08:00
    我一直在猜,都 9102 了,再过几个月 Python 就不支持 2.x 了,是不是还有公司或者人没有转到 3.x。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1186 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 18:23 · PVG 02:23 · LAX 11:23 · JFK 14:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.