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
songdg
V2EX  ›  Python

修改 pytables 表格里的行的问题

  •  
  •   songdg · 2022-03-25 17:33:29 +08:00 · 1508 次点击
    这是一个创建于 734 天前的主题,其中的信息可能已经有所发展或是发生改变。
    使用 class Brief 创建了一个 pytables 的表格,问题是创建后的表格是不按照 class Brief 指定的顺序创建列,有可能列的顺序是( debut ,price ,appear ,counter ,name ,update )或者是其他顺序,而使用 modify_rows 修改表格里的行必须按照指定的数据类型。
    class Brief(tb.IsDescription):
    name = tb.StringCol(256)
    price = tb.Float32Col()
    debut = tb.Time32Col()
    update = tb.Time32Col()
    counter = tb.UInt64Col()
    appear = tb.BoolCol()
    2 条回复    2022-03-29 09:06:30 +08:00
    ec0
        1
    ec0  
       2022-03-25 19:49:49 +08:00   ❤️ 1
    name = tb.StringCol(256, pos=0)
    price = tb.Float32Col(pos=1)
    debut = tb.Time32Col(pos=2)
    ...
    songdg
        2
    songdg  
    OP
       2022-03-29 09:06:30 +08:00
    @ec0 问题解决,非常感谢。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4123 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 05:24 · PVG 13:24 · LAX 22:24 · JFK 01:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.