per page, with , order by , clip by
Results of 1 - 10 of about 10 for ratio (0.010 sec.)
difflib --- 差分の計算の補助 13408
difflib --- 差分の計算の補助 ソースコード: Lib/difflib.py このモジュールはシーケンスを比較するクラスと関数を提供します。 その多くは、テキスト行のシーケンス (文字列のリストや ファイルオブジェクト など) を比較し、相違点を報告する 差分 (diff) ... 変更箇所をより小さなまとまりに分割し、間に挟まる変更のない範囲を除きます。 グループは get_opcodes() と同じ書式で返されます。 ratio ( ) [0, 1] の範囲の浮動小数点数で、シーケンスの類似度を測る値を返します。 T が2つのシーケンスの要素数の総計だと仮定し、M を ... または get_opcodes() がまだ呼び出されていない場合には非常にコストが高いです。この場合、上限を素早く計算するために、 quick_ratio() もしくは real_quick_ratio() を最初に試してみる方がいいかもしれません。 quick_ratio ( ) ratio() の上界を、より高速に計算し ... ます。 real_quick_ratio ( ) ratio() の上界を、非常に高速に計算します。 一致した文字数の総文字数に対する比率を返す 3 つのメソッドは、近似の程度が異 ...
https://man.mtool.work/python/3.14/library/difflib.html
fractions --- 有理数 11119
fractions --- 有理数 ソースコード: Lib/fractions.py fractions モジュールは有理数の演算をサポートします。 Fraction インスタンスは、2 つの有理数、1 つの数値、または文字列から作成できます。 class fractions. Fraction ( numerator = 0 , denominat ... ass fractions. Fraction ( number ) class fractions. Fraction ( string ) 最初の形式では numerator と denominator が numbers.Rational のインスタンスである必要があり、 numerator/denominator と等しい値を持つ新しい Fraction インスタンスを返します。 denomin ... ator がゼロの場合は ZeroDivisionError を送出します。 2 番目の形式では number が numbers.Rational のインスタンスであるか、 as_integer_ratio() メソッドを持つ必要があります ( float と decimal.Decimal はこれに含まれます) ... 。 まったく同じ値を持つ Fraction インスタンスを返します。 as_integer_ratio() メソッドは互いに素な整数のペアを返し、後者が正であることを前提としています。 二進浮動小数点に伴う一般的な問題 ( 浮動小数 ...
https://man.mtool.work/python/3.14/library/fractions.html
15. 浮動小数点演算、その問題と制限 9153
15. 浮動小数点演算、その問題と制限 浮動小数点数は、コンピューターのハードウェア上では 2 進小数で表されます。 例えば、 10 進小数 の 0.625 は 6/10 + 2/100 + 5/1000 という値を持ち、同様に 2 進小数 の 0.101 は 1/2 + 0/4 + 1/8 という値を持ちます ... さい。 浮動小数点数の正確な値を 本当に 知りたいというまれな場合に役立つツールも、Python は提供しています。 float.as_integer_ratio() メソッドは、浮動小数点数の値を分数として表します: >>> x = 3.14159 >>> x . as_integer_ratio () (3537115888337719, 1125899 ... s import Fraction >>> Fraction . from_float ( 0.1 ) Fraction(3602879701896397, 36028797018963968) >>> ( 0.1 ) . as_integer_ratio () (3602879701896397, 36028797018963968) >>> Decimal . from_float ( 0.1 ) Decimal('0.1000000000000000055511151231257827021 ...
https://man.mtool.work/python/3.14/tutorial/floatingpoint.html
What's New in Python 2.6 8170
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 の主要なテーマは、言語を大幅に再設計する ... 15 文字幅まで埋める >>> # フィールド 1: 右揃え、6 文字幅まで埋める >>> fmt = ' {0:15} $ {1:>6} ' >>> fmt . format ( 'Registration' , 35 ) 'Registration $ 35' >>> fmt . format ( 'Tutorial' , 50 ) 'Tutorial $ 50' >>> fmt . format ( 'Banquet' , 125 ) 'Ba ... te access upon the same underlying stream, and BufferedRWPair is for objects such as TTYs that have both read and write operations acting upon unconnected streams of data. The BytesIO class supports reading, writing, and seeking over an in-memory buff ... に Complex を継承し、実数だけで行える操作を追加します。 floor() 、 trunc() 、丸め、N で割った剰余、切り捨て除算、比較です。 Rational は Real を継承し、 numerator と denominator プロパティを持ち、浮動小数点数へ変換できます。 Python 2.6 では fractions モ ...
https://man.mtool.work/python/3.14/whatsnew/2.6.html
What's new in Python 3.14 8170
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 ... 。 from compression import zstd import math data = str ( math . pi ) . encode () * 20 compressed = zstd . compress ( data ) ratio = len ( compressed ) / len ( data ) print ( f "Achieved compression ratio of { ratio } " ) このように、API は lzma や bz2 ... 一致する名前を除外する filterfalse() 関数を追加しました。 (Bénédikt Tran が gh-74598 で貢献しました。) fractions as_integer_ratio() メソッドを持つ任意のオブジェクトから、 Fraction オブジェクトを構築できるようになりました。 (Serhiy Storchaka が gh-82017 ... で処理を実行し、その前後にブロッキングするコードを実行したい場合は、 asyncio.Runner を使ってください。 変更前: async def operation_one (): ... def blocking_code (): ... async def operation_two (): ... loop = asyncio . get_event_loop () try : loop . run ...
https://man.mtool.work/python/3.14/whatsnew/3.14.html
組み込み型 7848
組み込み型 以下のセクションでは、インタプリタに組み込まれている標準型について記述します。 主要な組み込み型は、数値、シーケンス、マッピング、クラス、インスタンス、および例外です。 コレクションクラスには、ミュータブルなものがあります。コレクシ ... ered ) return n Added in version 3.2. バージョン 3.11 で変更: byteorder 引数にデフォルト値を追加しました。 int. as_integer_ratio ( ) 比が元の数と等しくなるような整数のペアを返します。戻り値の分母に相当する数は正の整数です。元の数が整数の場合の比は、常 ... します。 __float__() が定義されていない場合、 __index__() へフォールバックします。 Added in version 3.14. float. as_integer_ratio ( ) 比が厳密に元の浮動小数点数であるような一対の整数を返します。比は既約分数として与えられ、分母は正の値です。無限大に対し ... f ( x ): return sys . hash_info . inf if x > 0 else - sys . hash_info . inf else : return hash_fraction ( * x . as_integer_ratio ()) def hash_complex ( z ): """複素数 z のハッシュを計算する。""" hash_value = hash_float ( z . real ) + sys . hash_info . ...
https://man.mtool.work/python/3.14/builtins/stdtypes.html
bz2 --- bzip2 圧縮のサポート 7848
bz2 --- bzip2 圧縮のサポート ソースコード: Lib/bz2.py このモジュールは、bzip2 アルゴリズムを用いて圧縮・展開を行う包括的なインターフェイスを提供します。 bz2 モジュールは次の機能を提供します。 圧縮ファイルを読み書きするための open() 関数と B ... cinia mi ornare consectetur vestibulum.""" >>> c = bz2 . compress ( data ) >>> len ( data ) / len ( c ) # Data compression ratio 1.513595166163142 >>> d = bz2 . decompress ( c ) >>> data == d # Check equality to original object after round-trip True B ...
https://man.mtool.work/python/3.14/library/bz2.html
decimal --- 10進固定小数点と浮動小数点の演算 7848
decimal --- 10進固定小数点と浮動小数点の演算 ソースコード: Lib/decimal.py decimal モジュールは、高速で正しく丸められる 10 進浮動小数点演算をサポートします。 float データ型に比べて次のような利点があります: Decimal は「人間を念頭に設計された ... に従って、無視されたり、単なる情報とみなされたり、例外として扱われたりします。 decimal モジュールには、 Clamped , InvalidOperation , DivisionByZero , Inexact , Rounded , Subnormal , Overflow , Underflow , および FloatOperation といったシグナルがあります ... ding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999, capitals=1, clamp=0, flags=[], traps=[Overflow, DivisionByZero, InvalidOperation]) >>> getcontext () . prec = 7 # 新しい精度を設定します Decimal インスタンスは、整数、文字列、浮動小数点数、またはタプルか ... 14213562373095048801688724') >>> Decimal ( 'NaN' ) Decimal('NaN') >>> Decimal ( '-Infinity' ) Decimal('-Infinity') FloatOperation シグナルがトラップされる場合、コンストラクタや順序比較において誤って decimal と float が混ざると、例外が送出されます: >>> ...
https://man.mtool.work/python/3.14/library/decimal.html
What's New In Python 3.6 7848
What's New In Python 3.6 エディタ : Elvis Pranskevichus < elvis @ magic . io >, Yury Selivanov < yury @ magic . io > この記事では 3.5 と比較した Python 3.6 の新機能を解説します。 Python 3.6 は2016年12月23日にリリースされました。 全詳細につい ... いことは PYTHONMALLOC 節 を参照してください。 セキュリティの改善: The new secrets module has been added to simplify the generation of cryptographically strong pseudo-random numbers suitable for managing secrets such as account authentication, tokens, a ... ibuted by A. Jesse Jiryu Davis.) The loop.stop() method has been changed to stop the loop immediately after the current iteration. Any new callbacks scheduled as a result of the last iteration will be discarded. (Contributed by Guido van Rossum in bpo ... -25593 .) Future.set_exception に StopIteration 例外のインスタンスを渡すと TypeError を送出するようになりました。 (Contributed by Chris Angelico in bpo-26221 .) asyncio ...
https://man.mtool.work/python/3.14/whatsnew/3.6.html
What's New In Python 3.8 7848
What's New In Python 3.8 編集者 : Raymond Hettinger この記事では Python 3.7 と比較した Python 3.8 の新機能を解説します。 Python 3.8 は 2019 年 10 月 14 日にリリースされました。 詳しくは 変更履歴 を参照してください。 概要 -- リリースハイライ ... Storchaka の貢献による bpo-32489 ) bool , int , fractions.Fraction タイプは、 float や decimal.Decimal と同様の as_integer_ratio() メソッドを持つようになりました。このAPI の拡張によって、 numerator, denominator = x.as_integer_ratio() のようなコードがよ ... (Ethan Smith の貢献による bpo-32380 ) gc get_objects() は、オブジェクトを得る世代を指定するオプションのパラメータ引数 generation を受け取るようになりました。(Pablo Galindo の貢献による bpo-36016 ) gettext pgettext() を含む、類似のいくつかの関数が追加 ... ドキュメントを付けられます。 class AudioClip : __slots__ = { 'bit_rate' : 'expressed in kilohertz to one decimal place' , 'duration' : 'in seconds, rounded up to an integer' } def __init__ ( self , bit_rate , duration ): self . bit_rate = round ( bit_ra ...
https://man.mtool.work/python/3.14/whatsnew/3.8.html
PREV 1 NEXT