Python -zelfstudie

Python HOME Python-intro Python Aan de slag Python-syntaxis Python-opmerkingen Python-variabelen Python-gegevenstypen Python-nummers Python-casting Python-snaren Python Booleans Python-operators Python-lijsten Python-tupels Python-sets Python-woordenboeken Python Als...Anders Python While-lussen Python voor lussen Python-functies Python Lambda Python-arrays Python-klassen/objecten Python-overerving Python-iterators Python-bereik Python-modules Python-datums Python-wiskunde Python JSON Python RegEx Python PIP Python proberen...Behalve Python-gebruikersinvoer Opmaak van Python-tekenreeksen

Bestandsbehandeling

Python-bestandsafhandeling Python-bestanden lezen Python bestanden schrijven/maken Python bestanden verwijderen

Python-modules

NumPy-zelfstudie Panda walkthrough Scipy-zelfstudie

Python Matplotlib

Matplotlib Intro Matplotlib Aan de slag Matplotlib Pyplot Matplotlib plotten Matplotlib-markeringen Matplotlib-lijn Matplotlib-labels Matplotlib-raster Matplotlib-subplots Matplotlib Scatter Matplotlib-repen Matplotlib-histogrammen Matplotlib-cirkeldiagrammen

Machinaal leren

Beginnen Gemiddelde mediane modus Standaardafwijking percentiel Gegevensdistributie Normale gegevensverdeling Scatterplot Lineaire regressie Polynomiale regressie Meervoudige regressie Schaal Trein/Test Beslissingsboom

Python MySQL

MySQL Aan de slag MySQL Database maken MySQL-tabel maken MySQL-invoeging MySQL Select MySQL Waar MySQL Bestel op MySQL verwijderen MySQL-droptabel MySQL-update MySQL-limiet MySQL Join

Python MongoDB

MongoDB Aan de slag MongoDB Database maken MongoDB Verzameling maken MongoDB invoegen MongoDB Zoeken MongoDB-query MongoDB Sorteren MongoDB verwijderen MongoDB Drop-collectie MongoDB-update MongoDB-limiet

Python-referentie

Python-overzicht Ingebouwde functies van Python Python-stringmethoden Methoden voor Python-lijst Python-woordenboekmethoden Python Tuple-methoden Methoden voor Python-sets Python-bestandsmethoden Python-trefwoorden Python-uitzonderingen Python-woordenlijst

Modulereferentie

Willekeurige module Verzoekmodule Statistiekmodule Wiskundige module cMath-module

Python-instructies

Lijstduplicaten verwijderen Een string omkeren Voeg twee nummers toe

Python-voorbeelden

Python-voorbeelden Python-compiler Python-oefeningen Python-quiz Python-certificaat

Python cmath-module


Python cmath-module

Python heeft een ingebouwde module die je kunt gebruiken voor wiskundige taken voor complexe getallen.

De methoden in deze module accepteren int, float, en complexgetallen. Het accepteert zelfs Python-objecten die een __complex__()of __float__()methode hebben.

De methoden in deze module retourneren bijna altijd een complex getal. Als de geretourneerde waarde kan worden uitgedrukt als een reëel getal, heeft de geretourneerde waarde een denkbeeldig deel van 0.

De cmathmodule heeft een reeks methoden en constanten.


cMath-methoden

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-constanten

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...)