Results of 1 - 9 of about 9 for iterables (0.008 sec.)
- itertools --- 効率的なループ用のイテレータ生成関数群 13732
- itertools --- 効率的なループ用のイテレータ生成関数群 このモジュールは イテレータ を構築する部品を実装しています。プログラム言語 APL, Haskell, SML からアイデアを得ていますが、 Python に適した形に修正されています。 このモジュールは、高速でメモ
...batch' ) yield batch Added in version 3.12. バージョン 3.13 で変更: strict オプションを追加しました。 itertools. chain ( * iterables ) 最初のイテラブルから 使い切る まで要素を返し、次のイテラブルへ進むことを、すべてのイテラブルを使い切るまで繰り返すイテレ...ータを作成します。 複数のデータ源を単一のイテレータにまとめます。 およそ次のコードと同等です。 def chain ( * iterables ): # chain('ABC', 'DEF') → A B C D E F for iterable in iterables : yield from iterable classmethod chain. from_iterable (...遅延評価される iterable 引数一つから連鎖した入力を受け取ります。この関数は、以下のコードとほぼ等価です: def from_iterable ( iterables ): # chain.from_iterable(['ABC', 'DEF']) → A B C D E F for iterable in iterables : yield from iterable itertools. combinat... - https://man.mtool.work/python/3.14/library/itertools.html
- concurrent.futures --- 並列タスク実行 9634
- concurrent.futures --- 並列タスク実行 Added in version 3.2. ソースコード: Lib/concurrent/futures/thread.py 、 Lib/concurrent/futures/process.py および Lib/concurrent/futures/interpreter.py concurrent.futures モジュールは、呼び出し可能オブジ
...( max_workers = 1 ) as executor : future = executor . submit ( pow , 323 , 1235 ) print ( future . result ()) map ( fn , * iterables , timeout = None , chunksize = 1 , buffersize = None ) map(fn, *iterables) と似ていますが、次の違いがあります: 結果をまだ...yield していない投入済みタスクの数を制限する buffersize が指定されていない限り、 iterables の要素は遅延せず、直ちに収集されます。 バッファがいっぱいになると、バッファから結果が yield されるまで iterables の反復処理...が例外を送出した場合、その例外はイテレータから値を受け取る時に送出されます。 ProcessPoolExecutor を使う場合、このメソッドは iterables を複数のチャンクに分割し、それぞれを別々のタスクとしてプールに投入します。 chunksize を正の整数に設定すると、各チャンクのお... - https://man.mtool.work/python/3.14/library/concurrent.futures.html
- heapq --- ヒープキューアルゴリズム 9077
- heapq --- ヒープキューアルゴリズム ソースコード: Lib/heapq.py このモジュールではヒープキューアルゴリズムの一実装を提供しています。優先度キューアルゴリズムとしても知られています。 最小ヒープは、各親ノードの値がそのどの子ノードの値以下でもある
...を参照してください。 Added in version 3.14. このモジュールではさらに3つのヒープに基く汎用関数を提供します。 heapq. merge ( * iterables , key = None , reverse = False ) 複数のソートされた入力をマージ(merge)して一つのソートされた出力にします (たとえば、複数の...ログファイルの時刻の入ったエントリーをマージします)。ソートされた値にわたる iterator を返します。 sorted(itertools.chain(*iterables)) と似ていますが、イテレータを返し、一度にはデータをメモリに読み込まず、それぞれの入力ストリームが予め(最小から最大へ)ソー...を直接比較します)。 reverse は真偽値です。 True の場合は比較の向きを逆にして入力要素をマージします。 sorted(itertools.chain(*iterables), reverse=True) と同様の動作にするには、すべての入力イテラブルをあらかじめ降順にソートしておく必要があります。 バージョン... - https://man.mtool.work/python/3.14/library/heapq.html
- random --- 疑似乱数を生成する 8717
- random --- 疑似乱数を生成する ソースコード: Lib/random.py このモジュールでは様々な分布をもつ擬似乱数生成器を実装しています。 整数用に、ある範囲からの一様な選択があります。 シーケンス用には、シーケンスからのランダムな要素の一様な選択、リスト
...ently make random selections from the combinatoric iterators in the itertools module: import random def random_product ( * iterables , repeat = 1 ): "次からランダムに選択: itertools.product(*iterables, repeat=repeat)" pools = tuple ( map ( tuple , iterabl... - https://man.mtool.work/python/3.14/library/random.html
- select --- I/O 完了の待機 8340
- select --- I/O 完了の待機 このモジュールでは、ほとんどのオペレーティングシステムで利用可能な select() および poll() 関数、Solaris やその派生で利用可能な devpoll() 、Linux 2.5+ で利用可能な epoll() 、多くのBSDで利用可能な kqueue() 関数に対す
...例外状態 (exceptional condition)" になるまで待機 ("例外状態" については、システムのマニュアルページを参照してください) Empty iterables are allowed, but acceptance of three empty iterables is platform-dependent. (It is known to work on Unix but not on Window... - https://man.mtool.work/python/3.14/library/select.html
- 組み込み関数 8160
- 組み込み関数 Python インタプリタには数多くの関数と型が組み込まれており、いつでも利用できます。それらをここにアルファベット順に挙げます。 組み込み関数 A abs() aiter() all() anext() any() ascii() B bin() bool() breakpoint() bytearray() bytes(
...うになりました。定義されただけで、その他のスコープの振る舞いは以前のバージョンのままです。 map ( function , iterable , / , * iterables , strict = False ) iterable の各要素に function を適用し、その結果を生成するイテレータを返します。 追加の iterables 引数が...ージョン 3.13 で変更: この関数を引数なしで呼び出したときの返り値は、 locals() 組み込み関数での説明に更新されました。 zip ( * iterables , strict = False ) 複数のイテラブルを並行に反復処理し、各イテラブルの要素からなるタプルを生成します。 以下はプログラム例で... - https://man.mtool.work/python/3.14/builtins/functions.html
- collections --- コンテナデータ型 7962
- collections --- コンテナデータ型 ソースコード: Lib/collections/__init__.py このモジュールは、汎用の Python 組み込みコンテナ dict , list , set , および tuple に代わる、特殊なコンテナデータ型を実装しています。 namedtuple() 名前付きフィールドを
...レータが 使い果たされた 場合は popleft() で削除でき、それ以外の場合は rotate() メソッドで末尾に戻せます。 def roundrobin ( * iterables ): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" iterators = deque ( map ( iter , iterables )) while iterators : try : wh... - https://man.mtool.work/python/3.14/library/collections.html
- What's New in Python 2.6 7585
- What's New in Python 2.6 著者 : A.M. Kuchling (amk at amk.ca) この記事では、2008 年 10 月 1 日にリリースされた Python 2.6 の新機能を説明します。 リリース日程は PEP 361 に記載されています。 Python 2.6 の主要なテーマは、言語を大幅に再設計する
...), (1, 4), (2, 1), (2, 3), (2, 4), (3, 1), (3, 2), (3, 4), (4, 1), (4, 2), (4, 3)] itertools の既存の関数 itertools.chain(*iterables) に、Python 2.6 で新しいコンストラクターが加わりました。 itertools.chain.from_iterable(iterable) は、ほかのイテラブルを返す... - https://man.mtool.work/python/3.14/whatsnew/2.6.html
- What's new in Python 3.14 7585
- What's new in Python 3.14 エディタ : Adam Turner と Hugo van Kemenade この記事では Python 3.13 と比較した Python 3.14 の新機能を解説します。Python 3.14 は2025年10月7日にリリースされました。全詳細については 変更履歴 をご覧ください。 参考 PEP
...しました。 投入済みで、まだ結果を返していないタスクの数を制限できます。 バッファがいっぱいの場合、バッファから結果を返すまで iterables の反復を一時停止します。 (Enzo Bonnal and Josh Rosenberg が gh-74028 で貢献しました。) configparser セキュリティ向上のため... - https://man.mtool.work/python/3.14/whatsnew/3.14.html
PREV
1
NEXT