laskuma
V2EX  ›  问与答

Python中该如何理解这句statement?

  •  
  •   laskuma · Nov 3, 2013 · 4308 views
    This topic created in 4754 days ago, the information mentioned may be changed or developed.
    在做topic modeling的research。对python不是很熟悉,正在看gensim的tutorial,有这么一句话不是很明白。能帮我分解一下吗?能否告诉我这种格式叫什么?
    texts = [[word for word in document.lower().split() if word not in stoplist]for document in documents]
    4 replies  •  1970-01-01 08:00:00 +08:00
    stillwater
    stillwater
    Nov 3, 2013❤️1
    1
    list comprehension
    laskuma
    laskuma
    OP
    Nov 3, 2013
    2
    @stillwater 感谢!
    mkeith
    mkeith
    Nov 3, 2013❤️1
    3
    texts = []
    for document in documents:
    for word in document.lower().split():
    if word not in stoplist:
    texts.append(word)
    subpo
    subpo
    Nov 3, 2013❤️1
    4
    好像一下子知道pythoner推崇的pythonic是什么意思了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   974 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 22:29 · PVG 06:29 · LAX 14:29 · JFK 17:29
    ♥ Do have faith in what you're doing.