Datetimes and Timedeltas

New in version 1.7.0. Starting in NumPy 1.7, there are core array data types which natively support datetime functionality. The data type is called ?datetime64?, so named because ?datetime? is already taken by the datetime library included in Python. Note The datetime API is experimental in 1.7.0, and may undergo changes in future versions of NumPy. Basic Datetimes The most basic way to create datetimes is from strings in ISO 8601 date or datetime format. The unit for internal storage is

Datetime Support Functions

Business Day Functions busdaycalendar A business day calendar object that efficiently stores information defining valid days for the busday family of functions. is_busday(dates[, weekmask, holidays, ...]) Calculates which of the given dates are valid days, and which are not. busday_offset(dates, offsets[, roll, ...]) First adjusts the date to fall on a valid day according to the roll rule, then applies offsets to the given dates counted in valid days. busday_count(begindates, enddates[, ..

DataSource.open()

DataSource.open(path, mode='r') [source] Open and return file-like object. If path is an URL, it will be downloaded, stored in the DataSource directory and opened from there. Parameters: path : str Local file path or URL to open. mode : {?r?, ?w?, ?a?}, optional Mode to open path. Mode ?r? for reading, ?w? for writing, ?a? to append. Available modes depend on the type of object specified by path. Default is ?r?. Returns: out : file object File object.

DataSource.exists()

DataSource.exists(path) [source] Test if path exists. Test if path exists as (and in this order): a local file. a remote URL that has been downloaded and stored locally in the DataSource directory. a remote URL that has not been downloaded, but is valid and accessible. Parameters: path : str Can be a local file or a remote URL. Returns: out : bool True if path exists. Notes When path is an URL, exists will return True if it?s either stored locally in the DataSource directory, or is

DataSource.abspath()

DataSource.abspath(path) [source] Return absolute path of file in the DataSource directory. If path is an URL, then abspath will return either the location the file exists locally or the location it would exist when opened using the open method. Parameters: path : str Can be a local file or a remote URL. Returns: out : str Complete path, including the DataSource destination directory. Notes The functionality is based on os.path.abspath.

Data type routines

can_cast(from, totype, casting = ) Returns True if cast between data types can occur according to the casting rule. promote_types(type1, type2) Returns the data type with the smallest size and smallest scalar kind to which both type1 and type2 may be safely cast. min_scalar_type(a) For scalar a, returns the data type with the smallest size and smallest scalar kind which can hold its value. result_type(*arrays_and_dtypes) Returns the type that results from applying the NumPy type promotion

Data type objects (dtype)

A data type object (an instance of numpy.dtype class) describes how the bytes in the fixed-size block of memory corresponding to an array item should be interpreted. It describes the following aspects of the data: Type of the data (integer, float, Python object, etc.) Size of the data (how many bytes is in e.g. the integer) Byte order of the data (little-endian or big-endian) If the data type is structured, an aggregate of other data types, (e.g., describing an array item consisting of an inte

class.__numpy_ufunc__()

The ndarray in NumPy is a ?new-style? Python built-in-type. Therefore, it can be inherited from (in Python or in C) if desired. Therefore, it can form a foundation for many useful classes. Often whether to sub-class the array object or to simply use the core array component as an internal part of a new class is a difficult decision, and can be simply a matter of choice. NumPy has several tools for simplifying how your new object interacts with other array objects, and so the choice may not be

Chebyshev.__call__()

Chebyshev.__call__(arg) [source]

Chebyshev.truncate()

Chebyshev.truncate(size) [source] Truncate series to length size. Reduce the series to length size by discarding the high degree terms. The value of size must be a positive integer. This can be useful in least squares where the coefficients of the high degree terms may be very small. Parameters: size : positive int The series is reduced to length size by discarding the high degree terms. The value of size must be a positive integer. Returns: new_series : series New instance of series