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

请帮忙看一下 dataframe 内日期文件通过 json 存入 mongodb 再以列表取出后日期无法正确显示的问题,谢谢!

  •  
  •   yellowtail · 2019-03-17 19:14:59 +08:00 · 1304 次点击
    这是一个创建于 1880 天前的主题,其中的信息可能已经有所发展或是发生改变。

    https://s2.ax1x.com/2019/03/17/AerKbR.png

    内容如图,也尝试过取出以后再用一次 pd.to_datetime

    结果还是不对,猴猴烦

    Z1on
        1
    Z1on  
       2019-03-17 21:13:48 +08:00   ❤️ 1
    brickyang
        2
    brickyang  
       2019-03-17 22:46:03 +08:00 via iPhone   ❤️ 1
    看起来 MongoDB 取出的是毫秒时间戳。pd.to_datetime 可以转成 Datetime 或其他格式: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.to_datetime.html

    你说的不对是指?
    yellowtail
        3
    yellowtail  
    OP
       2019-03-18 16:58:30 +08:00
    @brickyang 掉坑了,应该是 mongodb 里头数据复写出的问题,已解决。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   986 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 21:39 · PVG 05:39 · LAX 14:39 · JFK 17:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.