mathematics and numbers modules |in addition to the built-in intfloatand complex numbersthe library provides the decimal decimal and fractions fraction numbers three numeric libraries are availablemath for the standard mathematical functionscmath for complex number mathematical functionsand random which provides many functions for random number generationthese modules were introduced in python' numeric abstract base classes (classes that can be inherited from but that cannot be used directlyare in the numbers module they are useful for checking that an objectsayxis any kind of number using isinstance(xnumbers number)or is specific kind of numberfor exampleisinstance(xnumbers rationalor isinstance(xnumbers integralthose involved in scientific and engineering programming will find the thirdparty numpy package to be useful this module provides highly efficient -dimensional arraysbasic linear algebra functions and fourier transformsand tools for integration with cc++and fortran code the scipy package incorporates numpy and extends it to include modules for statistical computationssignal and image processinggenetic algorithmsand great deal more both are freely available from www scipy org times and dates |the calendar and datetime modules provide functions and classes for date and time handling howeverthey are based on an idealized gregorian calendarso they are not suitable for dealing with pre-gregorian dates time and date handling is very complex topic--the calendars in use have varied in different places and at different timesa day is not precisely hoursa year is not exactly daysand daylight saving time and time zones vary the datetime datetime class (but not the datetime date classhas provisions for handling time zonesbut does not do so out of the box third-party modules are available to make good this deficiencyfor exampledateutil from www labix org/python-dateutiland mxdatetime from www egenix com/products/python/mxbase/mxdatetime the time module handles timestamps these are simply numbers that hold the number of seconds since the epoch ( : : on unixthis module can be used to get timestamp of the machine' current time in utc (coordinated universal time)or as local time that accounts for daylight saving timeand to create datetimeand date/time strings formatted in various ways it can also parse strings that have dates and times