Pythonチュートリアル

Pythonホーム Pythonイントロ Pythonはじめに Python構文 Pythonコメント Python変数 Pythonデータ型 Python番号 Pythonキャスティング Python文字列 Pythonブール値 Python演算子 Pythonリスト Pythonタプル Pythonセット Python辞書 Python If ... Else PythonのWhileループ PythonForループ Python関数 Python Lambda Python配列 Pythonクラス/オブジェクト Pythonの継承 Pythonイテレータ Pythonスコープ Pythonモジュール Pythonの日付 Python数学 Python JSON Python RegEx Python PIP Python試してみてください... Pythonユーザー入力 Python文字列フォーマット

ファイル処理

Pythonファイル処理 Python読み取りファイル Python書き込み/ファイルの作成 Pythonファイルの削除

Pythonモジュール

NumPyチュートリアル パンダ攻略 Scipyチュートリアル

Python Matplotlib

Matplotlibイントロ Matplotlibはじめに Matplotlib Pyplot Matplotlibプロット Matplotlibマーカー Matplotlibライン Matplotlibラベル Matplotlibグリッド Matplotlibサブプロット Matplotlib散布図 Matplotlibバー Matplotlibヒストグラム Matplotlib円グラフ

機械学習

入門 平均中央値モード 標準偏差 パーセンタイル データ配信 正規データ分布 散布図 線形回帰 多項式回帰 重回帰 規模 トレーニング/テスト デシジョンツリー

Python MySQL

MySQLはじめに MySQLデータベースの作成 MySQLテーブルの作成 MySQL挿入 MySQL Select MySQL Where MySQL Order By MySQL削除 MySQLドロップテーブル MySQLアップデート MySQLの制限 MySQL参加

Python MongoDB

MongoDBはじめに MongoDBデータベースの作成 MongoDBCreateコレクション MongoDBインサート MongoDB検索 MongoDBクエリ MongoDBソート MongoDB削除 MongoDBドロップコレクション MongoDBアップデート MongoDBの制限

Pythonリファレンス

Pythonの概要 Python組み込み関数 Python文字列メソッド Pythonリストメソッド Python辞書メソッド Pythonタプルメソッド Pythonセットメソッド Pythonファイルメソッド Pythonキーワード Pythonの例外 Python用語集

モジュールリファレンス

ランダムモジュール リクエストモジュール 統計モジュール 数学モジュール cMathモジュール

Pythonハウツー

リストの重複を削除する 文字列を逆にする 2つの数字を追加する

Pythonの例

Pythonの例 Pythonコンパイラ Python演習 Pythonクイズ Python証明書

Pythoncmathモジュール


Pythoncmathモジュール

Pythonには、複素数の数学タスクに使用できる組み込みモジュールがあります。

このモジュールのメソッドは、、、intおよびfloat数値complexを受け入れます。__complex__()or__float__()メソッドを持つPythonオブジェクトも受け入れます。

このモジュールのメソッドは、ほとんどの場合、複素数を返します。戻り値を実数で表すことができる場合、戻り値の虚数部は0になります。

cmathモジュールには、一連のメソッドと定数があります


cMathメソッド

Method Description
cmath.acos(x) Returns the arc cosine value of x
cmath.acosh(x) Returns the hyperbolic arc cosine of x
cmath.asin(x) Returns the arc sine of x
cmath.asinh(x) Returns the hyperbolic arc sine of x
cmath.atan(x) Returns the arc tangent value of x
cmath.atanh(x) Returns the hyperbolic arctangent value of x
cmath.cos(x) Returns the cosine of x
cmath.cosh(x) Returns the hyperbolic cosine of x
cmath.exp(x) Returns the value of Ex, where E is Euler's number (approximately 2.718281...), and x is the number passed to it
cmath.isclose() Checks whether two values are close, or not
cmath.isfinite(x) Checks whether x is a finite number
cmath.isinf(x) Check whether x is a positive or negative infinty
cmath.isnan(x) Checks whether x is NaN (not a number)
cmath.log(x[, base]) Returns the logarithm of x to the base
cmath.log10(x) Returns the base-10 logarithm of x
cmath.phase() Return the phase of a complex number
cmath.polar() Convert a complex number to polar coordinates
cmath.rect() Convert polar coordinates to rectangular form
cmath.sin(x) Returns the sine of x
cmath.sinh(x) Returns the hyperbolic sine of x
cmath.sqrt(x) Returns the square root of x
cmath.tan(x) Returns the tangent of x
cmath.tanh(x) Returns the hyperbolic tangent of x

cMath定数

Constant Description
cmath.e Returns Euler's number (2.7182...)
cmath.inf Returns a floating-point positive infinity value
cmath.infj Returns a complex infinity value
cmath.nan Returns floating-point NaN (Not a Number) value
cmath.nanj Returns coplext NaN (Not a Number) value
cmath.pi Returns PI (3.1415...)
cmath.tau Returns tau (6.2831...)