推荐学习书目
› 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
bestehen
V2EX  ›  Python

Python 如何处理 写 csv 多了个双引号 如何处理 本来是“” 但是写入 csv 的时候编程““””

  •  
  •   bestehen · Aug 4, 2018 · 5327 views
    This topic created in 2982 days ago, the information mentioned may be changed or developed.
    csv.writer(f, dialect="excel").writerow( [{"found_year":found_year,"jg_type":jg_type,"area":area,"source_gw_link":source_gw_link,"jianjie":jianjie,"lianxi":lianxi},{"company_news":company_news}, {"name":name,"sex":sex,"company":company,"position":position,"role" :role, "edu_experience":edu_experience,"work_experience": json.dumps(OrderedDict(sorted(work_experience.items()))).encode('utf-8').decode('unicode_escape')}, {"lingyu":lingyu,"jiguan":jiguan,"lunci":lunci,"jieduan":jieduan,"jieshao":jieshao,"money_type":money_type,"touzianlie":json.dumps(OrderedDict (sorted(tzanli.items()))).encode('utf-8').decode('unicode_escape')},{"person_news":json.dumps(OrderedDict(sorted(person_news.items()))).encode('utf-8').decode('unicode_escape')}])



    这段信息 其中的一段 我打印屏幕上 是这样的'news_date': '2018.7.17',后来就插入 csv 后就变成这样了
    ""news_date"": ""2018.7.26""
    5 replies  •  2018-08-27 09:58:02 +08:00
    CEBBCAT
        1
    CEBBCAT  
       Aug 4, 2018
    ' '
    CEBBCAT
        2
    CEBBCAT  
       Aug 4, 2018
    @CEBBCAT 不行,老嘲讽显得不够意思,我觉好好看看楼主的帖子
    CEBBCAT
        3
    CEBBCAT  
       Aug 4, 2018
    CEBBCAT
        4
    CEBBCAT  
       Aug 4, 2018
    接 @CEBBCAT #3

    请楼主把代码全部贴上来,用到的数据也要上传,因为要测试,你的问题要截图,必要时录屏
    matrix273
        5
    matrix273  
       Aug 27, 2018 via Android
    pandas.read_csv
    pandas.to_csv
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2232 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 06:09 · PVG 14:09 · LAX 23:09 · JFK 02:09
    ♥ Do have faith in what you're doing.