API Reference
Axis
|
Represents an axis. |
Exploring
Axis.name |
Name of the axis. None in the case of an anonymous axis. |
|
Labels of the axis. |
|
Short representation of the labels. |
|
Data type for the axis labels. |
Copying
Return a copy of the axis. |
Searching
|
Translate a label key to its numerical index counterpart. |
|
Return a group with all the labels containing the specified substring. |
|
Return a group with the labels starting with the specified string. |
|
Return a group with the labels ending with the specified string. |
|
Return a group with all the labels matching the specified pattern or regular expression. |
|
Get minimum of labels. |
|
Get maximum of labels. |
Modifying/Selecting
|
Return a group (list or unique element) of label(s) usable in .sum or .filter. |
Take a subset using positions along the axis instead of labels. |
|
|
Split axis into several groups of specified length. |
|
Rename the axis. |
|
Append new labels to an axis or increase its length in case of wildcard axis. |
|
Return a new axis with new_labels inserted before before or after after. |
|
Return a new axis with some labels replaced. |
|
Return a new axis with the labels transformed by func. |
|
Return axis with the union of this axis labels and other labels. |
|
Return axis with the (set) intersection of this axis labels and other labels. |
|
Return axis with the (set) difference of this axis labels and other labels. |
|
Align axis with other object using specified join method. |
|
Split axis and returns a list of Axis. |
Return a wildcard axis with the same name and length than this axis. |
|
|
Cast labels to a specified type. |
Testing
|
Check if this axis is compatible with another axis. |
|
Check if this axis is equal to another axis. |
Save
|
Write axis to a HDF file. |
Group
IGroup
|
Index Group. |
|
Return group with a different name. |
|
Return group with a different axis. |
|
Split group into several groups of specified length. |
|
Check if this group is equal to another group. |
|
compute position(s) of group. |
|
Return (set) union of this label group and other. |
|
Return (set) intersection of this label group and other. |
|
Return (set) difference of this label group and other. |
|
Return a group with all the labels containing the specified substring. |
|
Return a group with the labels starting with the specified string. |
|
Return a group with the labels ending with the specified string. |
|
Return a group with all the labels matching the specified pattern or regular expression. |
|
Write group to a HDF file. |
LGroup
|
Label group. |
|
Return group with a different name. |
|
Return group with a different axis. |
|
Split group into several groups of specified length. |
|
Check if this group is equal to another group. |
|
compute position(s) of group. |
|
Return (set) union of this label group and other. |
|
Return (set) intersection of this label group and other. |
|
Return (set) difference of this label group and other. |
|
Return a group with all the labels containing the specified substring. |
|
Return a group with the labels starting with the specified string. |
|
Return a group with the labels ending with the specified string. |
|
Return a group with all the labels matching the specified pattern or regular expression. |
|
Write group to a HDF file. |
LSet
|
Label set. |
AxisCollection
|
Return the list of (raw) names of the axes. |
|
Return the list of (display) names of the axes. |
|
Return the list of labels of the axes. |
|
Return the shape of the collection. |
|
Return the size of the collection, i.e. the number of elements of the array. |
|
Describe the collection (shape and labels for each axis). |
|
Return a copy. |
Searching
Return list of all axis names. |
|
|
Return the index of axis. |
|
Return the id of an axis. |
Return the list of ids of the axes. |
|
|
Return a view of the axes labels. |
Modifying/Selecting
|
Return axis corresponding to key. |
|
Return axis corresponding to a key, or to position i if the key has no name and key object not found. |
Return all axes from key if present and length 1 wildcard axes otherwise. |
|
|
Remove and return an axis. |
|
Append axis at the end of the collection. |
|
Extend the collection by appending the axes from axes. |
|
Insert axis before index. |
|
Rename axes of the collection. |
|
Replace one, several or all axes of the collection. |
|
Replace the labels of one or several axes. |
|
Return a new collection without some axes. |
|
Combine several axes into one. |
|
Split axes and returns a new collection. |
|
Align this axis collection with another. |
Testing
|
Test if input is an Axis object or the name of an axis contained in self. |
Check if axes passed as argument are compatible with those contained in the collection. |
Array
Overview
|
An Array object represents a multidimensional, homogeneous array of fixed-size items with labeled axes. |
Array Creation Functions
|
Create an array by sequentially applying modifications to the array along axis. |
|
Return test array with given shape. |
|
Return an array with the specified axes and filled with zeros. |
|
Return an array with the same axes as array and filled with zeros. |
|
Return an array with the specified axes and filled with ones. |
|
Return an array with the same axes as array and filled with ones. |
|
Return an array with the specified axes and uninitialized (arbitrary) data. |
|
Return an array with the same axes as array and uninitialized (arbitrary) data. |
|
Return an array with the specified axes and filled with fill_value. |
|
Return an array with the same axes and type as input array and filled with fill_value. |
Copying
Return a copy of the array. |
|
|
Copy of the array, cast to a specified type. |
Inspecting
Array.data |
Data of the array (Numpy ndarray) |
Array.axes |
Axes of the array (AxisCollection) |
Array.title |
Title of the array (str) |
Describe an Array (metadata + shape and labels for each axis). |
|
Return the shape of the array as a tuple. |
|
Return the number of dimensions of the array. |
|
Return the type of the data of the array. |
|
Return the number of elements in array. |
|
Return the number of bytes used to store the array in memory. |
|
Return the memory consumed by the array in human readable form. |
Modifying/Selecting
Allows selection of a subset using indices of labels. |
|
Allows selection of arbitrary items in the array based on their N-dimensional label index. |
|
Allows selection of arbitrary items in the array based on their N-dimensional index. |
|
Access the array by index as if it was flat (one dimensional) and all its axes were combined. |
|
|
Set a subset of array to value. |
|
Return array without some labels or indices along an axis. |
|
Ignore labels from axes (replace those axes by "wildcard" axes). |
|
Filter the array along the axes given as keyword arguments. |
|
Apply a transformation function to array elements. |
|
Apply a transformation mapping to array elements. |
Changing Axes or Labels
|
Replace one, several or all axes of the array. |
|
Rename axes of the array. |
|
Replace the labels of one or several axes of the array. |
|
Combine several axes into one. |
|
Split axes and returns a new array. |
|
Reverse axes of an array. |
Aggregation Functions
|
Compute the sum of array elements along given axes/groups. |
|
Compute the sum of array elements for the given axes/groups. |
|
Compute the product of array elements along given axes/groups. |
|
Compute the product of array elements for the given axes/groups. |
|
Return the cumulative sum of array elements along an axis. |
|
Return the cumulative product of array elements. |
|
Compute the arithmetic mean. |
|
Compute the arithmetic mean. |
|
Compute the arithmetic median. |
|
Compute the arithmetic median. |
|
Compute the unbiased variance. |
|
Compute the unbiased variance. |
|
Compute the sample standard deviation. |
|
Compute the sample standard deviation. |
|
Compute the qth percentile of the data along the specified axis. |
|
Compute the qth percentile of the data for the specified axis. |
|
Return the range of values (maximum - minimum). |
|
Add aggregated values (sum by default) along each axis. |
|
Return an array with values given as percent of the total of all values along given axes. |
|
Return an array with all values divided by the sum of values along given axes. |
|
Return an Array with values array / array.sum(axes) where the sum is not 0, 0 otherwise. |
|
Compute the growth along a given axis. |
|
Descriptive summary statistics, excluding NaN values. |
|
Descriptive summary statistics, excluding NaN values, along axes or for groups. |
Count number of occurrences of each unique value in array. |
Sorting
|
Sort labels of axes of the array. |
|
Sort values of the array. |
|
Return the labels that would sort this array. |
|
Return the indices that would sort this array. |
Reshaping/Extending/Reordering
|
Given a list of new axes, changes the shape of the array. |
|
Same as reshape but with an array as input. |
|
Detect and remove "useless" axes (ie axes for which values are constant over the whole axis). |
|
Reorder and/or add new labels in axes. |
|
Reorder axes. |
|
Expand this array to target_axes. |
|
Add an array before this array along an axis. |
|
Add a value to this array along an axis. |
|
|
|
Insert value in array along an axis. |
|
Return an array that is (NumPy) broadcastable with target. |
|
Align two arrays on their axes with the specified join method. |
Testing/Searching
|
Compare this array with another array and returns True if they have the same axes and elements, False otherwise. |
|
Compare this array with another array and returns True if they are element-wise equal within a tolerance. |
|
Compare this array with another array element-wise and returns an array of booleans. |
|
Compute whether each element of this array is in test_values. |
Return the indices of the elements that are non-zero. |
|
|
Test whether all selected elements evaluate to True. |
|
Test whether all selected elements evaluate to True. |
|
Test whether any selected elements evaluate to True. |
|
Test whether any selected elements evaluate to True. |
|
Get minimum of array elements along given axes/groups. |
|
Get minimum of array elements for the given axes/groups. |
|
Get maximum of array elements along given axes/groups. |
|
Get maximum of array elements for the given axes/groups. |
|
Return labels of the minimum values along a given axis. |
|
Return indices of the minimum values along a given axis. |
|
Return labels of the maximum values along a given axis. |
|
Return indices of the maximum values along a given axis. |
Iterating
|
Return a view on the array labels along axes. |
|
Return a view on the values of the array along axes. |
|
Return a (label, value) view of the array along axes. |
Operators
|
Matrix multiplication |
Miscellaneous
|
Divide this array by other, but return 0.0 where other is 0. |
|
Clip (limit) the values in an array. |
|
Shift the cells of the array n-times to the right along axis. |
|
Roll the cells of the array n-times to the right along axis. |
|
Compute the n-th order discrete difference along a given axis. |
|
Return unique values (optionally along axes). |
|
Send the content of the array to the clipboard. |
Converting to Pandas objects
|
Convert an Array into a Pandas Series. |
|
Convert an Array into a Pandas DataFrame. |
Plotting
Plot the data of the array into a graph (window pop-up). |
Utility Functions
Miscellaneous
|
Return elements, either from x or y, depending on condition. |
|
Element-wise maximum of array elements. |
|
Element-wise minimum of array elements. |
|
Compute the (multiplicative) inverse of a matrix. |
|
One-dimensional linear interpolation for monotonically increasing sample points. |
|
Returns the discrete, linear convolution of two one-dimensional sequences. |
|
Calculate the absolute value element-wise. |
|
Compute the absolute values element-wise. |
|
Return True if the type of element is a scalar type. |
|
Test element-wise for NaN and return result as a boolean array. |
|
Test element-wise for positive or negative infinity. |
|
Replace NaN with zero and infinity with large finite numbers (default behaviour) or with the numbers defined by the user using the nan, posinf and/or neginf keywords. |
|
Return the non-negative square-root of an array, element-wise. |
|
Modified Bessel function of the first kind, order 0. |
|
Return the normalized sinc function. |
Rounding
|
Evenly round to the given number of decimals. |
|
Return the floor of the input, element-wise. |
|
Return the ceiling of the input, element-wise. |
|
Return the truncated value of the input, element-wise. |
|
Round elements of the array to the nearest integer. |
|
Round to nearest integer towards zero. |
Exponents And Logarithms
|
Calculate the exponential of all elements in the input array. |
|
Calculate |
|
Calculate 2**p for all p in the input array. |
|
Natural logarithm, element-wise. |
|
Return the base 10 logarithm of the input array, element-wise. |
|
Base-2 logarithm of x. |
|
Return the natural logarithm of one plus the input array, element-wise. |
|
Logarithm of the sum of exponentiations of the inputs. |
|
Logarithm of the sum of exponentiations of the inputs in base-2. |
Trigonometric functions
|
Trigonometric sine, element-wise. |
|
Cosine element-wise. |
|
Compute tangent element-wise. |
|
Inverse sine, element-wise. |
|
Trigonometric inverse cosine, element-wise. |
|
Trigonometric inverse tangent, element-wise. |
|
Given the "legs" of a right triangle, return its hypotenuse. |
|
Element-wise arc tangent of |
|
Convert angles from radians to degrees. |
|
Convert angles from degrees to radians. |
|
Unwrap by taking the complement of large deltas with respect to the period. |
Hyperbolic functions
|
Hyperbolic sine, element-wise. |
|
Hyperbolic cosine, element-wise. |
|
Compute hyperbolic tangent element-wise. |
|
Inverse hyperbolic sine element-wise. |
|
Inverse hyperbolic cosine, element-wise. |
|
Inverse hyperbolic tangent element-wise. |
Complex Numbers
|
Return the angle of the complex argument. |
|
Return the real part of the complex argument. |
|
Return the imaginary part of the complex argument. |
|
Return the complex conjugate, element-wise. |
Floating Point Routines
|
Returns element-wise True where signbit is set (less than zero). |
|
Change the sign of x1 to that of x2, element-wise. |
|
Decompose the elements of x into mantissa and twos exponent. |
|
Returns x1 * 2**x2, element-wise. |
Metadata
An ordered dictionary allowing key-values accessibly using attribute notation (AttributeDict.attribute) instead of key notation (Dict["key"]). |
Input/Output
Read
|
Read csv file and returns an array with the contents. |
|
|
|
Read excel file from sheet name and returns an Array with the contents. |
|
Read a scalar or an axis or group or array named key from a HDF5 file in filepath (path+name). |
|
Read EUROSTAT TSV (tab-separated) file into an array. |
|
Read sas file and returns an Array with the contents |
|
Read Stata .dta file and returns an Array with the contents. |
Write
|
Write array to a csv file. |
|
Write array in the specified sheet of specified excel workbook. |
|
Write array to a HDF file. |
|
Write array to a Stata .dta file. |
|
Dump array as a 2D nested list. |
Excel
|
Open an Excel workbook |
|
Excel Workbook. |
Return the names of the Excel sheets. |
|
|
Saves the Workbook. |
Close the workbook in Excel. |
|
Return the Excel instance this workbook is attached to. |
ExcelReport
Automate the generation of multiple graphs in an Excel file. |
|
Set the path to the directory containing the Excel template files (with '.crtx' extension). |
|
Set a default Excel template file. |
|
|
Override the default 'width' and 'height' values for the given kind of item. |
Default number of graphs per row. |
|
|
Add a new empty output sheet. |
Return the names of the output sheets. |
|
|
Generate the report Excel file. |
ReportSheet
Represents a sheet dedicated to contains only graphical items (title banners, graphs). |
|
Set the path to the directory containing the Excel template files (with '.crtx' extension). |
|
Set a default Excel template file. |
|
|
Override the default 'width' and 'height' values for the given kind of item. |
Default number of graphs per row. |
|
|
Add a title item to the current sheet. |
|
Add a graph item to the current sheet. |
|
Add multiple graph items to the current sheet. |
Force a new row of graphs. |
Miscellaneous
|
Convert input as Array if possible. |
|
Convert Pandas DataFrame into Array. |
|
Convert Pandas Series into Array. |
|
Return absolute path to an example file if exist. |
|
Set options for larray in a controlled context. |
Return the current options. |
|
|
Return an array with specified axes and the combination of corresponding labels as values. |
|
Return the union of several "value strings" as a list. |
|
Combine several arrays or sessions along an axis. |
|
|
|
Extract a diagonal or construct a diagonal array. |
|
Return a 2-D array with ones on the diagonal and zeros elsewhere. |
|
Apply Iterative Proportional Fitting Procedure (also known as bi-proportional fitting in statistics, RAS algorithm in economics) to array a, with target_sums as targets. |
|
Wrap a function using numpy arrays to work with LArray arrays instead. |
|
Return a sequence as if simultaneously iterating on several arrays. |
|
Return a sequence as if simultaneously iterating on several arrays as well as the current iteration "key". |
Session
|
Groups several objects together. |
|
Return a session containing all available arrays (whether they are defined in local or global variables) sorted in alphabetical order. |
|
Return a session containing all local arrays sorted in alphabetical order. |
|
Return a session containing all global arrays sorted in alphabetical order. |
|
Load arrays used in the tutorial so that all examples in it can be reproduced. |
Exploring
Return the list of names of the objects in the session. |
|
Return a view on the session's keys. |
|
Return a view on the session's values. |
|
Return a view of the session's items ((key, value) pairs). |
|
|
Return a summary of the content of the session. |
Copying
Return a copy of the session. |
Testing
|
Test if each element (group, axis and array) of the current session equals the corresponding element of another session. |
|
Test if all elements (groups, axes and arrays) of the current session are equal to those of another session. |
Selecting
|
Return the object corresponding to the key. |
Modifying
|
Deprecated. |
|
Update the session with the key/value pairs from other or passed keyword arguments, overwriting existing keys. |
|
Apply function func on elements of the session and return a new session. |
|
Reorder axes of arrays in session, ignoring missing axes for each array. |
Filtering/Cleaning
|
Return a new session with objects which match some criteria. |
|
Detect and remove "useless" axes (ie axes for which values are constant over the whole axis) for all array objects in session. |
Load/Save
|
Load objects from a file, or several .csv files. |
|
Dump objects from the current session to a file, or several .csv files. |
|
Dump Array objects from the current session to CSV files. |
|
Dump Array objects from the current session to an Excel file. |
|
Dump objects from the current session to an HDF file. |
|
Dump objects from the current session to a file using pickle. |
CheckedArray
|
CheckedSession
|
Class intended to be inherited by user defined classes in which the variables of a model are declared. |
CheckedParameters
|
Same as py:class:CheckedSession but declared variables cannot be modified after initialization. |
Editor
|
Open a new viewer window. |
|
Open a new editor window. |
|
Open a new debug window. |
|
Open a new comparator window, comparing arrays or sessions. |
|
Run the editor when an unhandled exception (a fatal error) happens. |
Random
|
Return random integers from low (inclusive) to high (exclusive). |
|
Draw random samples from a normal (Gaussian) distribution. |
|
Draw samples from a uniform distribution. |
|
Randomly permute a sequence along an axis, or return a permuted range. |
|
Generate a random sample from given choices. |
Constants
NaN (Not a Number) |
|
\(\infty\) (infinite) |
|
\(\pi\) |
|
\(e\) |
|
Euler's \(\gamma\) |