久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

我在 Python 的 itertools 中找不到 imap()

I can#39;t find imap() in itertools in Python(我在 Python 的 itertools 中找不到 imap())
本文介紹了我在 Python 的 itertools 中找不到 imap()的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個問題想用 itertools.imap() 解決.但是,當我在 IDLE shell 中導入 itertools 并調用 itertools.imap() 后,IDLE shell 告訴我 itertools 沒有屬性 imap.怎么了?

I have a problem that I want to solve with itertools.imap(). However, after I imported itertools in IDLE shell and called itertools.imap(), the IDLE shell told me that itertools doesn't have attribute imap. What's going wrong?

>>> import itertools
>>> dir(itertools)
['__doc__', '__loader__', '__name__', '__package__', '__spec__', '_grouper',     '_tee', '_tee_dataobject', 'accumulate', 'chain', 'combinations', 'combinations_with_replacement', 'compress', 'count', 'cycle', 'dropwhile', 'filterfalse', 'groupby', 'islice', 'permutations', 'product', 'repeat', 'starmap', 'takewhile', 'tee', 'zip_longest']
>>> itertools.imap()
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
itertools.imap()
AttributeError: 'module' object has no attribute 'imap'

推薦答案

itertools.imap() 在 Python 2 中,但不在 Python 3 中.

itertools.imap() is in Python 2, but not in Python 3.

實際上,該函數在 Python 3 中被移到了 map 函數中,如果你想使用舊的 Python 2 地圖,你必須使用 list(map()).

Actually, that function was moved to just the map function in Python 3 and if you want to use the old Python 2 map, you must use list(map()).

這篇關于我在 Python 的 itertools 中找不到 imap()的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to draw a rectangle around a region of interest in python(如何在python中的感興趣區域周圍繪制一個矩形)
How can I detect and track people using OpenCV?(如何使用 OpenCV 檢測和跟蹤人員?)
How to apply threshold within multiple rectangular bounding boxes in an image?(如何在圖像的多個矩形邊界框中應用閾值?)
How can I download a specific part of Coco Dataset?(如何下載 Coco Dataset 的特定部分?)
Detect image orientation angle based on text direction(根據文本方向檢測圖像方向角度)
Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 檢測圖像中矩形的中心和角度)
主站蜘蛛池模板: 欧美福利一区 | 欧美日韩在线综合 | 午夜免费在线电影 | 久久伊人青青草 | h小视频 | 亚洲欧美成人 | eeuss国产一区二区三区四区 | 日韩精品一区二区三区中文在线 | 日本三级在线网站 | 一级黄色网页 | 色在线免费视频 | 成人自拍视频网站 | 日日干夜夜草 | 精品一区二区三区av | 精品中文在线 | 久久久久久久一区 | 黄色一级片aaa | 午夜三级视频 | 成人欧美 | 午夜资源 | 欧美日韩中文字幕 | 91在线成人 | 亚洲成人在线免费 | 久久国产区| 国产丝袜一区二区三区免费视频 | 一区二区免费看 | 中文字幕在线观看av | 欧美日韩国产在线观看 | 亚洲逼院 | 亚洲成人综合在线 | 亚洲va中文字幕 | 国产一级片91 | 精品1区| 亚洲精品久久嫩草网站秘色 | 亚洲日本乱码在线观看 | 亚洲天堂一区 | 男女啪啪高潮无遮挡免费动态 | 天天干天天爱天天操 | 国精日本亚洲欧州国产中文久久 | 欧美久久久久久久 | 免费观看一区二区三区毛片 |