Results of 1 - 10 of about 35 for Itertools (0.009 sec.)
- 関数型プログラミング HOWTO 15339
- 関数型プログラミング HOWTO Author : A. M. Kuchling Release : 0.32 この文書では、関数型スタイルでプログラムを実装するのにピッタリな Python の機能を見てまわることにしましょう。まず関数型プログラミングという概念を紹介したあと、 iterator や gen
...erator のような言語機能、および itertools や functools といった関連するライブラリモジュールを見ることにします。 はじめに この章は関数型プログラミングの基本概念を説明...いたほうが良いです。その捨てられた要素を抜かしてしまう危険があるので、もうそのイテレータはそれ以上使えなくなってしまいます。 itertools モジュール itertools モジュールには、よく使うイテレータや、イテレータ同士の連結に使う関数がたくさん含まれています。この章で...数として扱う関数。 イテレータの出力から一部を取り出す関数。 イテレータの出力をグループ分けする関数。 新しいイテレータを作る itertools.count(start, step) は値の間隔が一定の無限ストリームを返します。 オプションで開始する数 (デフォルトは 0) や数どうしの間隔 (... - https://man.mtool.work/python/3.14/howto/functional.html
- itertools --- 効率的なループ用のイテレータ生成関数群 12555
- itertools --- 効率的なループ用のイテレータ生成関数群 このモジュールは イテレータ を構築する部品を実装しています。プログラム言語 APL, Haskell, SML からアイデアを得ていますが、 Python に適した形に修正されています。 このモジュールは、高速でメモ
...ます。 無限長のストリームを提供するものもあるので、その場合はストリームを途中で打ち切る関数やループでのみ使用してください。 itertools. accumulate ( iterable [ , function , * , initial=None ] ) 累積和、または他の 2 引数関数による累積結果を返すイテレータを作...で変更: 省略可能な function 引数を追加しました。 バージョン 3.8 で変更: オプションの initial パラメータが追加されました。 itertools. batched ( iterable , n , * , strict = False ) iterable から得られるデータを n 個ごとに一つのタプルにまとめます。 一番最後...atched(): incomplete batch' ) yield batch Added in version 3.12. バージョン 3.13 で変更: strict オプションを追加しました。 itertools. chain ( * iterables ) 最初のイテラブルから 使い切る まで要素を返し、次のイテラブルへ進むことを、すべてのイテラブルを使い切... - https://man.mtool.work/python/3.14/library/itertools.html
- 関数型プログラミング用モジュール 9118
- 関数型プログラミング用モジュール この章で説明するモジュールは、関数型プログラミングのスタイルをサポートする関数やクラスと、呼び出し可能オブジェクトに対する汎用的な操作を提供します。 この章では以下のモジュールが記述されています: itertools --
...- 効率的なループ用のイテレータ生成関数群 Itertool関数 Itertools レシピ functools --- 高階関数と呼び出し可能オブジェクトの操作 partial オブジェクト operator --- 関数形式の標準演算子 演算子... - https://man.mtool.work/python/3.14/library/functional.html
- modulefinder --- スクリプト中で使用されているモジュールの検索 8799
- modulefinder --- スクリプト中で使用されているモジュールの検索 ソースコード: Lib/modulefinder.py このモジュールでは、スクリプト中で import されているモジュールセットを調べるために使える ModuleFinder クラスを提供しています。 modulefinder.py は
...書。 ModuleFinder の使用例 を参照して下さい。 ModuleFinder の使用例 解析対象のスクリプトはこれ (bacon.py) です: import re , itertools try : import baconhameggs except ImportError : pass try : import guido.python.ham except ImportError : pass bacon.py のレポ..._optimize_unicode _sre : re . _constants : REPEAT_ONE , makedict , AT_END_LINE sys : re : __module__ , finditer , _expand itertools : __main__ : re , itertools , baconhameggs re . _parser : _PATTERNENDERS , SRE_FLAG_UNICODE array : types : __module__ , I... - https://man.mtool.work/python/3.14/library/modulefinder.html
- What's New in Python 2.4 8545
- What's New in Python 2.4 著者 : A.M. Kuchling この文書は 2005 年 3 月 30 日にリリースされた Python 2.4.1 の新機能について解説します。 Python 2.4 は、真ん中サイズ、のリリースです。急進的だった Python 2.2 ほどには多くの変更をしていませんが、保
...での変更については Kalle Svensson によって実装されました。 PEP 289: ジェネレータ式 Python 2.2 で導入されたイテレータ機能と itertools モジュールによって、データセット全体を一度にメモリへ読み込まずに、大きなデータセットをループで処理するプログラムが書きやす...ました。以前は正規の Python 辞書である必要がありました。 (Contributed by Raymond Hettinger.) The zip() built-in function and itertools.izip() now return an empty list if called with no arguments. Previously they raised a TypeError exception. This makes them...ne による貢献です)。 また、新しい deleteacl() メソッドと myrights() メソッドが加わりました (Arnaud Mazin による貢献です)。 itertools モジュールに groupby(iterable[, *func*]) 関数が加わりました。 iterable は、反復して要素の列を取り出せるものです。 省略可能... - https://man.mtool.work/python/3.14/whatsnew/2.4.html
- What's New in Python 2.6 8306
- 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 の主要なテーマは、言語を大幅に再設計する
...による貢献です。) このモジュールには isgenerator() 、 isgeneratorfunction() 、 isabstract() などの新しい関数も加わりました。 itertools モジュールにいくつかの関数が追加されています。 izip_longest(iter1, iter2, ...[, fillvalue]) はそれぞれの要素群からタプルを...生成します; イテラブルの要素数がほかのものより短ければ欠落値として fillvalue が埋められます。例えば: >>> tuple ( itertools . izip_longest ([ 1 , 2 , 3 ], [ 1 , 2 , 3 , 4 , 5 ])) ((1, 1), (2, 2), (3, 3), (None, 4), (None, 5)) product(iter1, iter2...oduct)、つまりそれぞれのイテラブルから返るその要素たちの全てのありうる組み合わせを含むタプルの集合を返します。: >>> list ( itertools . product ([ 1 , 2 , 3 ], [ 4 , 5 , 6 ])) [(1, 4), (1, 5), (1, 6), (2, 4), (2, 5), (2, 6), (3, 4), (3, 5), (3, 6)] 省略可能... - https://man.mtool.work/python/3.14/whatsnew/2.6.html
- random --- 疑似乱数を生成する 8226
- random --- 疑似乱数を生成する ソースコード: Lib/random.py このモジュールでは様々な分布をもつ擬似乱数生成器を実装しています。 整数用に、ある範囲からの一様な選択があります。 シーケンス用には、シーケンスからのランダムな要素の一様な選択、リスト
...が与えられた場合、相対的な重みに基づいて要素が選ばれます。あるいは、 cum_weights シーケンスが与えられた場合、累積的な重み ( itertools.accumulate() を用いて計算されるかもしれません) で要素が選ばれます。例えば、相対的な重み [10, 5, 30, 5] は累積的な重み [10,...バーしています。 レシピ These recipes show how to efficiently make random selections from the combinatoric iterators in the itertools module: import random def random_product ( * iterables , repeat = 1 ): "次からランダムに選択: itertools.product(*iterables...eat return tuple ( map ( random . choice , pools )) def random_permutation ( iterable , r = None ): "次からランダムに選択: itertools.permutations(iterable, r)" pool = tuple ( iterable ) r = len ( pool ) if r is None else r return tuple ( random . sample (... - https://man.mtool.work/python/3.14/library/random.html
- Python ドキュメントの目次 7972
- Python ドキュメントの目次 What's New in Python What's new in Python 3.14 概要 -- リリースハイライト 新しい機能 PEP 649 と PEP 749 : アノテーションの遅延評価 PEP 734 : 複数インタープリタ機能が標準ライブラリに追加 PEP 750 : テンプレート文字列
...pfile 最適化 asyncio base64 bdb difflib gc io pathlib pdb textwrap uuid zlib 削除 argparse ast asyncio email importlib.abc itertools pathlib pkgutil pty sqlite3 urllib 非推奨 新たな非推奨事項 Python 3.15 で削除予定 Python 3.16 で削除予定 Python 3.17 で削除...64 compileall concurrent.futures configparser copy ctypes dbm dis doctest email enum fractions glob importlib io ipaddress itertools marshal math mimetypes mmap multiprocessing os os.path pathlib pdb queue random re shutil site sqlite3 ssl statistics subp...その他の言語変更 新たなモジュール 改良されたモジュール array asyncio calendar csv dis fractions importlib.resources inspect itertools math os os.path pathlib platform pdb random shutil sqlite3 statistics sys tempfile threading tkinter tokenize types typing... - https://man.mtool.work/python/3.14/contents.html
- 変更履歴 7972
- 変更履歴 次の Python バージョン リリース日: XXXX-XX-XX セキュリティ gh-160499 : Fix unbounded memory growth in asyncio TLS connections when a peer stops reading but keeps sending records that make OpenSSL generate its own replies (such as T
...ゼロを返すと random.binomialvariate() が ZeroDivisionError を送出する問題を修正しました。 gh-153908 : free-threaded build で itertools.count に対して repr() を呼び出す際のデータ競合を修正しました。 gh-153896 : typing.Literal でハッシュ不可能な引数の重複を取...cProfile.Profile.enable() が sys.monitoring のエラーを上書きしないように修正しました。 gh-153062 : フリースレッドビルドで itertools.tee() のイテレーターを並行して反復するとクラッシュする問題を修正しました。 gh-153056 : pattern 属性が、ドキュメントで許可さ...ーより優先するようにしました。 これにより get_header() と header_items() と動作が一致します。 gh-123471 : フリースレッドでの itertools.zip_longest の並行した反復を安全にしました。 gh-123720 : asyncio: asyncio.Server.serve_forever() の終了時のリグレッションを... - https://man.mtool.work/python/3.14/whatsnew/changelog.html
- What's New In Python 3.1 7892
- What's New In Python 3.1 著者 : Raymond Hettinger この記事では Python 3.0 と比較した Python 3.1 の新機能を説明します。 Python 3.1 は 2009 年 6 月 27 日にリリースされました。 PEP 372: 順序付き辞書 通常の Python 辞書は、 key/value ペアを不定の
...に表現出来ないので、端数は十進表現でとても多くの桁数になっています。 (Contributed by Raymond Hettinger and Mark Dickinson.) itertools に 2 つの関数が追加されました。 itertools.combinations_with_replacement() 関数は、置換 (順列, permutation) や直積 (Cartesi...an product) を含む組合せ論の 4 つの生成関数のうちの 1 つです。 itertools.compress() 関数は APL の同名機能の模倣品です。また、既存の itertools.count() 関数は新たにオプショナルな step 引数を取るよう... - https://man.mtool.work/python/3.14/whatsnew/3.1.html