API Reference¶
Axis¶
Axis (labels[, name]) |
Represents an axis. |
Exploring¶
Axis.name | Name of the axis. None in the case of an anonymous axis. |
Axis.labels |
Labels of the axis. |
Axis.labels_summary |
Short representation of the labels. |
Axis.dtype |
Data type for the axis labels. |
Searching¶
Axis.index (self, key) |
Translates a label key to its numerical index counterpart. |
Axis.containing (self, substring) |
Returns a group with all the labels containing the specified substring. |
Axis.startingwith (self, prefix) |
Returns a group with the labels starting with the specified string. |
Axis.endingwith (self, suffix) |
Returns a group with the labels ending with the specified string. |
Axis.matching (self[, deprecated, pattern, regex]) |
Returns a group with all the labels matching the specified pattern or regular expression. |
Modifying/Selecting¶
Axis.__getitem__ (self, key) |
Returns a group (list or unique element) of label(s) usable in .sum or .filter |
Axis.i |
Allows to define a subset using positions along the axis instead of labels. |
Axis.by (self, length[, step, template]) |
Split axis into several groups of specified length. |
Axis.rename (self, name) |
Renames the axis. |
Axis.subaxis (self, key) |
Returns an axis for a sub-array. |
Axis.extend (self, labels) |
Append new labels to an axis or increase its length in case of wildcard axis. |
Axis.insert (self, new_labels[, before, after]) |
Return a new axis with new_labels inserted before before or after after. |
Axis.replace (self, old[, new]) |
Returns a new axis with some labels replaced. |
Axis.apply (self, func) |
Returns a new axis with the labels transformed by func. |
Axis.union (self, other) |
Returns axis with the union of this axis labels and other labels. |
Axis.intersection (self, other) |
Returns axis with the (set) intersection of this axis labels and other labels. |
Axis.difference (self, other) |
Returns axis with the (set) difference of this axis labels and other labels. |
Axis.align (self, other[, join]) |
Align axis with other object using specified join method. |
Axis.split (self[, sep, names, regex, …]) |
Split axis and returns a list of Axis. |
Axis.ignore_labels (self) |
Returns a wildcard axis with the same name and length than this axis. |
Testing¶
Axis.iscompatible (self, other) |
Checks if self is compatible with another axis. |
Axis.equals (self, other) |
Checks if self is equal to another axis. |
Save¶
Axis.to_hdf (self, filepath[, key]) |
Writes axis to a HDF file. |
Group¶
IGroup¶
IGroup (key[, name, axis]) |
Index Group. |
IGroup.named (self, name) |
Returns group with a different name. |
IGroup.with_axis (self, axis) |
Returns group with a different axis. |
IGroup.by (self, length[, step, template]) |
Split group into several groups of specified length. |
IGroup.equals (self, other) |
Checks if this group is equal to another group. |
IGroup.translate (self[, bound, stop]) |
compute position(s) of group |
IGroup.union (self, other) |
Returns (set) union of this label group and other. |
IGroup.intersection (self, other) |
Returns (set) intersection of this label group and other. |
IGroup.difference (self, other) |
Returns (set) difference of this label group and other. |
IGroup.containing (self, substring) |
Returns a group with all the labels containing the specified substring. |
IGroup.startingwith (self, prefix) |
Returns a group with the labels starting with the specified string. |
IGroup.endingwith (self, suffix) |
Returns a group with the labels ending with the specified string. |
IGroup.matching (self[, deprecated, pattern, …]) |
Returns a group with all the labels matching the specified pattern or regular expression. |
IGroup.to_hdf (self, filepath[, key, axis_key]) |
Writes group to a HDF file. |
LGroup¶
LGroup (key[, name, axis]) |
Label group. |
LGroup.named (self, name) |
Returns group with a different name. |
LGroup.with_axis (self, axis) |
Returns group with a different axis. |
LGroup.by (self, length[, step, template]) |
Split group into several groups of specified length. |
LGroup.equals (self, other) |
Checks if this group is equal to another group. |
LGroup.translate (self[, bound, stop]) |
compute position(s) of group |
LGroup.union (self, other) |
Returns (set) union of this label group and other. |
LGroup.intersection (self, other) |
Returns (set) intersection of this label group and other. |
LGroup.difference (self, other) |
Returns (set) difference of this label group and other. |
LGroup.containing (self, substring) |
Returns a group with all the labels containing the specified substring. |
LGroup.startingwith (self, prefix) |
Returns a group with the labels starting with the specified string. |
LGroup.endingwith (self, suffix) |
Returns a group with the labels ending with the specified string. |
LGroup.matching (self[, deprecated, pattern, …]) |
Returns a group with all the labels matching the specified pattern or regular expression. |
LGroup.to_hdf (self, filepath[, key, axis_key]) |
Writes group to a HDF file. |
AxisCollection¶
AxisCollection ([axes]) |
AxisCollection.names |
Returns the list of (raw) names of the axes. |
AxisCollection.display_names |
Returns the list of (display) names of the axes. |
AxisCollection.labels |
Returns the list of labels of the axes. |
AxisCollection.shape |
Returns the shape of the collection. |
AxisCollection.size |
Returns the size of the collection, i.e. |
AxisCollection.info |
Describes the collection (shape and labels for each axis). |
AxisCollection.copy (self) |
Returns a copy. |
Searching¶
AxisCollection.keys (self) |
Returns list of all axis names. |
AxisCollection.index (self, axis[, compatible]) |
Returns the index of axis. |
AxisCollection.axis_id (self, axis) |
Returns the id of an axis. |
AxisCollection.ids |
Returns the list of ids of the axes. |
AxisCollection.iter_labels (self[, axes, …]) |
Returns a view of the axes labels. |
Modifying/Selecting¶
AxisCollection.get (self, key[, default, name]) |
Returns axis corresponding to key. |
AxisCollection.get_by_pos (self, key, i) |
Returns axis corresponding to a key, or to position i if the key has no name and key object not found. |
AxisCollection.get_all (self, key) |
Returns all axes from key if present and length 1 wildcard axes otherwise. |
AxisCollection.pop (self[, axis]) |
Removes and returns an axis. |
AxisCollection.append (self, axis) |
Appends axis at the end of the collection. |
AxisCollection.extend (self, axes[, …]) |
Extends the collection by appending the axes from axes. |
AxisCollection.insert (self, index, axis) |
Inserts axis before index. |
AxisCollection.rename (self[, renames, to]) |
Renames axes of the collection. |
AxisCollection.replace (self[, …]) |
Replace one, several or all axes of the collection. |
AxisCollection.set_labels (self[, axis, …]) |
Replaces the labels of one or several axes. |
AxisCollection.without (self, axes) |
Returns a new collection without some axes. |
AxisCollection.combine_axes (self[, axes, …]) |
Combine several axes into one. |
AxisCollection.split_axes (self[, axes, sep, …]) |
Split axes and returns a new collection |
AxisCollection.align (self, other[, join, axes]) |
Align this axis collection with another. |
Testing¶
AxisCollection.isaxis (self, value) |
Tests if input is an Axis object or the name of an axis contained in self. |
AxisCollection.check_compatible (self, axes) |
Checks if axes passed as argument are compatible with those contained in the collection. |
Array¶
- Overview
- Array Creation Functions
- Copying
- Inspecting
- Modifying/Selecting
- Changing Axes or Labels
- Aggregation Functions
- Sorting
- Reshaping/Extending/Reordering
- Testing/Searching
- Iterating
- Operators
- Miscellaneous
- Converting to Pandas objects
- Plotting
Overview¶
Array (data[, axes, title, meta, dtype]) |
An Array object represents a multidimensional, homogeneous array of fixed-size items with labeled axes. |
Array Creation Functions¶
sequence (axis[, initial, inc, mult, func, …]) |
Creates an array by sequentially applying modifications to the array along axis. |
ndtest (shape_or_axes[, start, label_start, …]) |
Returns test array with given shape. |
zeros (axes[, title, dtype, order, meta]) |
Returns an array with the specified axes and filled with zeros. |
zeros_like (array[, title, dtype, order, meta]) |
Returns an array with the same axes as array and filled with zeros. |
ones (axes[, title, dtype, order, meta]) |
Returns an array with the specified axes and filled with ones. |
ones_like (array[, title, dtype, order, meta]) |
Returns an array with the same axes as array and filled with ones. |
empty (axes[, title, dtype, order, meta]) |
Returns an array with the specified axes and uninitialized (arbitrary) data. |
empty_like (array[, title, dtype, order, meta]) |
Returns an array with the same axes as array and uninitialized (arbitrary) data. |
full (axes, fill_value[, title, dtype, …]) |
Returns an array with the specified axes and filled with fill_value. |
full_like (array, fill_value[, title, dtype, …]) |
Returns an array with the same axes and type as input array and filled with fill_value. |
Copying¶
Array.copy (self) |
Returns a copy of the array. |
Array.astype (dtype[, order, casting, subok, …]) |
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) |
Array.info |
Describes an Array (metadata + shape and labels for each axis). |
Array.shape |
Returns the shape of the array as a tuple. |
Array.ndim |
Returns the number of dimensions of the array. |
Array.dtype |
Returns the type of the data of the array. |
Array.size |
Returns the number of elements in array. |
Array.nbytes |
Returns the number of bytes used to store the array in memory. |
Array.memory_used |
Returns the memory consumed by the array in human readable form. |
Modifying/Selecting¶
Array.i |
Allows selection of a subset using indices of labels. |
Array.points |
Allows selection of arbitrary items in the array based on their N-dimensional label index. |
Array.ipoints |
Allows selection of arbitrary items in the array based on their N-dimensional index. |
Array.iflat |
Access the array by index as if it was flat (one dimensional) and all its axes were combined. |
Array.set (self, value, \*\*kwargs) |
Sets a subset of array to value. |
Array.drop (self[, labels]) |
Return array without some labels or indices along an axis. |
Array.ignore_labels (self[, axes]) |
Ignore labels from axes (replace those axes by “wildcard” axes). |
Array.filter (self[, collapse]) |
Filters the array along the axes given as keyword arguments. |
Array.apply (self, transform, \*args, \*\*kwargs) |
Apply a transformation function to array elements. |
Array.apply_map (self, mapping[, dtype]) |
Apply a transformation mapping to array elements. |
Changing Axes or Labels¶
Array.set_axes (self[, axes_to_replace, …]) |
Replace one, several or all axes of the array. |
Array.rename (self[, renames, to, inplace]) |
Renames axes of the array. |
Array.set_labels (self[, axis, labels, inplace]) |
Replaces the labels of one or several axes of the array. |
Array.combine_axes (self[, axes, sep, wildcard]) |
Combine several axes into one. |
Array.split_axes (self[, axes, sep, names, …]) |
Split axes and returns a new array |
Array.reverse (self[, axes]) |
Reverse axes of an array |
Aggregation Functions¶
Array.sum (*axes_and_groups[, dtype, out, …]) |
Computes the sum of array elements along given axes/groups. |
Array.sum_by (*axes_and_groups[, dtype, out, …]) |
Computes the sum of array elements for the given axes/groups. |
Array.prod (*axes_and_groups[, dtype, out, …]) |
Computes the product of array elements along given axes/groups. |
Array.prod_by (*axes_and_groups[, dtype, …]) |
Computes the product of array elements for the given axes/groups. |
Array.cumsum (self[, axis]) |
Returns the cumulative sum of array elements along an axis. |
Array.cumprod (self[, axis]) |
Returns the cumulative product of array elements. |
Array.mean (*axes_and_groups[, dtype, out, …]) |
Computes the arithmetic mean. |
Array.mean_by (*axes_and_groups[, dtype, …]) |
Computes the arithmetic mean. |
Array.median (*axes_and_groups[, out, …]) |
Computes the arithmetic median. |
Array.median_by (*axes_and_groups[, out, …]) |
Computes the arithmetic median. |
Array.var (*axes_and_groups[, dtype, ddof, …]) |
Computes the unbiased variance. |
Array.var_by (*axes_and_groups[, dtype, …]) |
Computes the unbiased variance. |
Array.std (*axes_and_groups[, dtype, ddof, …]) |
Computes the sample standard deviation. |
Array.std_by (*axes_and_groups[, dtype, …]) |
Computes the sample standard deviation. |
Array.percentile (q, *axes_and_groups[, out, …]) |
Computes the qth percentile of the data along the specified axis. |
Array.percentile_by (q, *axes_and_groups[, …]) |
Computes the qth percentile of the data for the specified axis. |
Array.ptp (*axes_and_groups[, out]) |
Returns the range of values (maximum - minimum). |
Array.with_total (*args[, op, label]) |
Add aggregated values (sum by default) along each axis. |
Array.percent (self, \*axes) |
Returns an array with values given as percent of the total of all values along given axes. |
Array.ratio (self, \*axes) |
Returns an array with all values divided by the sum of values along given axes. |
Array.rationot0 (self, \*axes) |
Returns an Array with values array / array.sum(axes) where the sum is not 0, 0 otherwise. |
Array.growth_rate (self[, axis, d, label]) |
Calculates the growth along a given axis. |
Array.describe (self, \*args, \*\*kwargs) |
Descriptive summary statistics, excluding NaN values. |
Array.describe_by (self, \*args, \*\*kwargs) |
Descriptive summary statistics, excluding NaN values, along axes or for groups. |
Sorting¶
Array.sort_axes (self[, axes, ascending]) |
Sorts axes of the array. |
Array.sort_values (self[, key, axis, ascending]) |
Sorts values of the array. |
Array.labelsofsorted (self[, axis, …]) |
Returns the labels that would sort this array. |
Array.indicesofsorted (self[, axis, …]) |
Returns the indices that would sort this array. |
Reshaping/Extending/Reordering¶
Array.reshape (self, target_axes) |
Given a list of new axes, changes the shape of the array. |
Array.reshape_like (self, target) |
Same as reshape but with an array as input. |
Array.compact (self) |
Detects and removes “useless” axes (ie axes for which values are constant over the whole axis) |
Array.reindex (self[, axes_to_reindex, …]) |
Reorder and/or add new labels in axes. |
Array.transpose (self, \*args) |
Reorder axes. |
Array.expand (self[, target_axes, out, readonly]) |
Expands array to target_axes. |
Array.prepend (self, axis, value[, label]) |
Adds an array before self along an axis. |
Array.append (self, axis, value[, label]) |
Adds an array to self along an axis. |
Array.extend (self, axis, other) |
Adds an array to self along an axis. |
Array.insert (self, value[, before, after, …]) |
Inserts value in array along an axis. |
Array.broadcast_with (self, target) |
Returns an array that is (NumPy) broadcastable with target. |
Array.align (self, other[, join, fill_value, …]) |
Align two arrays on their axes with the specified join method. |
Testing/Searching¶
Array.equals (self, other[, rtol, atol, …]) |
Compares self with another array and returns True if they have the same axes and elements, False otherwise. |
Array.eq (self, other[, rtol, atol, nans_equal]) |
Compares self with another array element-wise and returns an array of booleans. |
Array.isin (self, test_values[, …]) |
Computes whether each element of this array is in test_values. |
Array.nonzero (self) |
Returns the indices of the elements that are non-zero. |
Array.all (*axes_and_groups[, out, skipna, …]) |
Test whether all selected elements evaluate to True. |
Array.all_by (*axes_and_groups[, out, …]) |
Test whether all selected elements evaluate to True. |
Array.any (*axes_and_groups[, out, skipna, …]) |
Test whether any selected elements evaluate to True. |
Array.any_by (*axes_and_groups[, out, …]) |
Test whether any selected elements evaluate to True. |
Array.min (*axes_and_groups[, out, skipna, …]) |
Get minimum of array elements along given axes/groups. |
Array.min_by (*axes_and_groups[, out, …]) |
Get minimum of array elements for the given axes/groups. |
Array.max (*axes_and_groups[, out, skipna, …]) |
Get maximum of array elements along given axes/groups. |
Array.max_by (*axes_and_groups[, out, …]) |
Get maximum of array elements for the given axes/groups. |
Array.labelofmin (self[, axis]) |
Returns labels of the minimum values along a given axis. |
Array.indexofmin (self[, axis]) |
Returns indices of the minimum values along a given axis. |
Array.labelofmax (self[, axis]) |
Returns labels of the maximum values along a given axis. |
Array.indexofmax (self[, axis]) |
Returns indices of the maximum values along a given axis. |
Iterating¶
Array.keys (self[, axes, ascending]) |
Returns a view on the array labels along axes. |
Array.values (self[, axes, ascending]) |
Returns a view on the values of the array along axes. |
Array.items (self[, axes, ascending]) |
Returns a (label, value) view of the array along axes. |
Operators¶
@ |
Matrix multiplication |
Miscellaneous¶
Array.divnot0 (self, other) |
Divides array by other, but returns 0.0 where other is 0. |
Array.clip (self[, minval, maxval, out]) |
Clip (limit) the values in an array. |
Array.shift (self, axis[, n]) |
Shifts the cells of the array n-times to the right along axis. |
Array.roll (self[, axis, n]) |
Rolls the cells of the array n-times to the right along axis. |
Array.diff (self[, axis, d, n, label]) |
Calculates the n-th order discrete difference along a given axis. |
Array.unique (self[, axes, sort, sep]) |
Returns unique values (optionally along axes) |
Array.to_clipboard (self, \*args, \*\*kwargs) |
Sends the content of the array to clipboard. |
Converting to Pandas objects¶
Array.to_series (self[, name, dropna]) |
Converts an Array into a Pandas Series. |
Array.to_frame (self[, fold_last_axis_name, …]) |
Converts an Array into a Pandas DataFrame. |
Plotting¶
Array.plot |
Plots the data of the array into a graph (window pop-up). |
Utility Functions¶
- Miscellaneous
- Rounding
- Exponents And Logarithms
- Trigonometric functions
- Hyperbolic functions
- Complex Numbers
- Floating Point Routines
Miscellaneous¶
where (condition, x, y) |
Return elements, either from x or y, depending on condition. |
maximum (x1, x2[, out, dtype]) |
Element-wise maximum of array elements. |
minimum (x1, x2[, out, dtype]) |
Element-wise minimum of array elements. |
inverse (\*args, \*\*kwargs) |
Compute the (multiplicative) inverse of a matrix. |
interp (\*args, \*\*kwargs) |
One-dimensional linear interpolation. |
convolve (\*args, \*\*kwargs) |
Returns the discrete, linear convolution of two one-dimensional sequences. |
absolute (x, /[, out, where, casting, order, …]) |
Calculate the absolute value element-wise. |
fabs (x, /[, out, where, casting, order, …]) |
Compute the absolute values element-wise. |
isnan (x, /[, out, where, casting, order, …]) |
Test element-wise for NaN and return result as a boolean array. |
isinf (x, /[, out, where, casting, order, …]) |
Test element-wise for positive or negative infinity. |
nan_to_num (\*args, \*\*kwargs) |
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. |
sqrt (x, /[, out, where, casting, order, …]) |
Return the non-negative square-root of an array, element-wise. |
i0 (\*args, \*\*kwargs) |
Modified Bessel function of the first kind, order 0. |
sinc (\*args, \*\*kwargs) |
Return the sinc function. |
Rounding¶
round (\*args, \*\*kwargs) |
Round an array to the given number of decimals. |
floor (x, /[, out, where, casting, order, …]) |
Return the floor of the input, element-wise. |
ceil (x, /[, out, where, casting, order, …]) |
Return the ceiling of the input, element-wise. |
trunc (x, /[, out, where, casting, order, …]) |
Return the truncated value of the input, element-wise. |
rint (x, /[, out, where, casting, order, …]) |
Round elements of the array to the nearest integer. |
fix (\*args, \*\*kwargs) |
Round to nearest integer towards zero. |
Exponents And Logarithms¶
exp (x, /[, out, where, casting, order, …]) |
Calculate the exponential of all elements in the input array. |
expm1 (x, /[, out, where, casting, order, …]) |
Calculate exp(x) - 1 for all elements in the array. |
exp2 (x, /[, out, where, casting, order, …]) |
Calculate 2**p for all p in the input array. |
log (x, /[, out, where, casting, order, …]) |
Natural logarithm, element-wise. |
log10 (x, /[, out, where, casting, order, …]) |
Return the base 10 logarithm of the input array, element-wise. |
log2 (x, /[, out, where, casting, order, …]) |
Base-2 logarithm of x. |
log1p (x, /[, out, where, casting, order, …]) |
Return the natural logarithm of one plus the input array, element-wise. |
logaddexp (x1, x2, /[, out, where, casting, …]) |
Logarithm of the sum of exponentiations of the inputs. |
logaddexp2 (x1, x2, /[, out, where, casting, …]) |
Logarithm of the sum of exponentiations of the inputs in base-2. |
Trigonometric functions¶
sin (x, /[, out, where, casting, order, …]) |
Trigonometric sine, element-wise. |
cos (x, /[, out, where, casting, order, …]) |
Cosine element-wise. |
tan (x, /[, out, where, casting, order, …]) |
Compute tangent element-wise. |
arcsin (x, /[, out, where, casting, order, …]) |
Inverse sine, element-wise. |
arccos (x, /[, out, where, casting, order, …]) |
Trigonometric inverse cosine, element-wise. |
arctan (x, /[, out, where, casting, order, …]) |
Trigonometric inverse tangent, element-wise. |
hypot (x1, x2, /[, out, where, casting, …]) |
Given the “legs” of a right triangle, return its hypotenuse. |
arctan2 (x1, x2, /[, out, where, casting, …]) |
Element-wise arc tangent of x1/x2 choosing the quadrant correctly. |
degrees (x, /[, out, where, casting, order, …]) |
Convert angles from radians to degrees. |
radians (x, /[, out, where, casting, order, …]) |
Convert angles from degrees to radians. |
unwrap (\*args, \*\*kwargs) |
Unwrap by changing deltas between values to 2*pi complement. |
Hyperbolic functions¶
sinh (x, /[, out, where, casting, order, …]) |
Hyperbolic sine, element-wise. |
cosh (x, /[, out, where, casting, order, …]) |
Hyperbolic cosine, element-wise. |
tanh (x, /[, out, where, casting, order, …]) |
Compute hyperbolic tangent element-wise. |
arcsinh (x, /[, out, where, casting, order, …]) |
Inverse hyperbolic sine element-wise. |
arccosh (x, /[, out, where, casting, order, …]) |
Inverse hyperbolic cosine, element-wise. |
arctanh (x, /[, out, where, casting, order, …]) |
Inverse hyperbolic tangent element-wise. |
Complex Numbers¶
angle (\*args, \*\*kwargs) |
Return the angle of the complex argument. |
real (\*args, \*\*kwargs) |
Return the real part of the complex argument. |
imag (\*args, \*\*kwargs) |
Return the imaginary part of the complex argument. |
conj (x, /[, out, where, casting, order, …]) |
Return the complex conjugate, element-wise. |
Floating Point Routines¶
signbit (x, /[, out, where, casting, order, …]) |
Returns element-wise True where signbit is set (less than zero). |
copysign (x1, x2, /[, out, where, casting, …]) |
Change the sign of x1 to that of x2, element-wise. |
frexp (x[, out1, out2], / [[, out, where, …]) |
Decompose the elements of x into mantissa and twos exponent. |
ldexp (x1, x2, /[, out, where, casting, …]) |
Returns x1 * 2**x2, element-wise. |
Metadata¶
Metadata |
An ordered dictionary allowing key-values accessibly using attribute notation (AttributeDict.attribute) instead of key notation (Dict[“key”]). |
Input/Output¶
Read¶
read_csv (filepath_or_buffer[, nb_axes, …]) |
Reads csv file and returns an array with the contents. |
read_tsv (filepath_or_buffer, \*\*kwargs) |
|
read_excel (filepath[, sheet, nb_axes, …]) |
Reads excel file from sheet name and returns an Array with the contents |
read_hdf (filepath_or_buffer, key[, …]) |
Reads an axis or group or array named key from a HDF5 file in filepath (path+name) |
read_eurostat (filepath_or_buffer, \*\*kwargs) |
Reads EUROSTAT TSV (tab-separated) file into an array. |
read_sas (filepath[, nb_axes, index_col, …]) |
Reads sas file and returns an Array with the contents |
read_stata (filepath_or_buffer[, index_col, …]) |
Reads Stata .dta file and returns an Array with the contents |
Write¶
Array.to_csv (self, filepath[, sep, na_rep, …]) |
Writes array to a csv file. |
Array.to_excel (self[, filepath, sheet, …]) |
Writes array in the specified sheet of specified excel workbook. |
Array.to_hdf (self, filepath, key) |
Writes array to a HDF file. |
Array.to_stata (self, filepath_or_buffer, …) |
Writes array to a Stata .dta file. |
Array.dump (self[, header, wide, value_name, …]) |
Dump array as a 2D nested list. |
Excel¶
open_excel ([filepath, overwrite_file, …]) |
Open an Excel workbook |
Workbook ([filepath, overwrite_file, …]) |
Excel Workbook. |
Workbook.sheet_names (self) |
Returns the names of the Excel sheets. |
Workbook.save (self[, path]) |
Saves the Workbook. |
Workbook.close (self) |
Close the workbook in Excel. |
Workbook.app (self) |
Return the Excel instance this workbook is attached to. |
ExcelReport¶
ExcelReport () |
Automate the generation of multiple graphs in an Excel file. |
ExcelReport.template_dir |
Set the path to the directory containing the Excel template files (with ‘.crtx’ extension). |
ExcelReport.template |
Set a default Excel template file. |
ExcelReport.set_item_default_size (self, kind) |
Override the default ‘width’ and ‘height’ values for the given kind of item. |
ExcelReport.graphs_per_row |
Default number of graphs per row. |
ExcelReport.new_sheet (self, sheet_name) |
Add a new empty output sheet. |
ExcelReport.sheet_names (self) |
Returns the names of the output sheets. |
ExcelReport.to_excel (self, filepath[, …]) |
Generate the report Excel file. |
ReportSheet¶
ReportSheet () |
Represents a sheet dedicated to contains only graphical items (title banners, graphs). |
ReportSheet.template_dir |
Set the path to the directory containing the Excel template files (with ‘.crtx’ extension). |
ReportSheet.template |
Set a default Excel template file. |
ReportSheet.set_item_default_size (self, kind) |
Override the default ‘width’ and ‘height’ values for the given kind of item. |
ReportSheet.graphs_per_row |
Default number of graphs per row. |
ReportSheet.add_title (self, title[, width, …]) |
Add a title item to the current sheet. |
ReportSheet.add_graph (self, data[, title, …]) |
Add a graph item to the current sheet. |
ReportSheet.add_graphs (self, …[, …]) |
Add multiple graph items to the current sheet. |
ReportSheet.newline (self) |
Force a new row of graphs. |
Miscellaneous¶
asarray (a[, meta]) |
Converts input as Array if possible. |
from_frame (df[, sort_rows, sort_columns, …]) |
Converts Pandas DataFrame into Array. |
from_series (s[, sort_rows, fill_value, meta]) |
Converts Pandas Series into Array. |
get_example_filepath (fname) |
Return absolute path to an example file if exist. |
set_options (**kwargs) |
Set options for larray in a controlled context. |
get_options () |
Return the current options. |
labels_array (axes[, title, meta]) |
Returns an array with specified axes and the combination of corresponding labels as values. |
union (\*args) |
Returns the union of several “value strings” as a list. |
stack ([elements, axes, title, meta, dtype, …]) |
Combines several arrays or sessions along an axis. |
identity (axis) |
|
diag (a[, k, axes, ndim, split]) |
Extracts a diagonal or construct a diagonal array. |
eye (rows[, columns, k, title, dtype, meta]) |
Returns a 2-D array with ones on the diagonal and zeros elsewhere. |
ipfp (target_sums[, a, axes, maxiter, …]) |
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_elementwise_array_func (func) |
Wrap a function using numpy arrays to work with LArray arrays instead. |
zip_array_values (values[, axes, ascending]) |
Returns a sequence as if simultaneously iterating on several arrays. |
zip_array_items (values[, axes, ascending]) |
Returns a sequence as if simultaneously iterating on several arrays as well as the current iteration “key”. |
Session¶
Session (*args, **kwargs) |
Groups several objects together. |
arrays ([depth, include_private, meta]) |
Returns a session containing all available arrays (whether they are defined in local or global variables) sorted in alphabetical order. |
local_arrays ([depth, include_private, meta]) |
Returns a session containing all local arrays sorted in alphabetical order. |
global_arrays ([depth, include_private, meta]) |
Returns a session containing all global arrays sorted in alphabetical order. |
load_example_data (name) |
Load arrays used in the tutorial so that all examples in it can be reproduced. |
Exploring¶
Session.names |
Returns the list of names of the objects in the session. |
Session.keys (self) |
Returns a view on the session’s keys. |
Session.values (self) |
Returns a view on the session’s values. |
Session.items (self) |
Returns a view of the session’s items ((key, value) pairs). |
Session.summary (self[, template]) |
Returns a summary of the content of the session. |
Copying¶
Session.copy (self) |
Returns a copy of the session. |
Testing¶
Session.element_equals (self, other) |
Test if each element (group, axis and array) of the current session equals the corresponding element of another session. |
Session.equals (self, other) |
Test if all elements (groups, axes and arrays) of the current session are equal to those of another session. |
Selecting¶
Session.get (self, key[, default]) |
Returns the object corresponding to the key. |
Modifying¶
Session.add (self, \*args, \*\*kwargs) |
Adds objects to the current session. |
Session.update (self[, other]) |
Update the session with the key/value pairs from other or passed keyword arguments, overwriting existing keys. |
Session.get (self, key[, default]) |
Returns the object corresponding to the key. |
Session.apply (self, func, \*args, \*\*kwargs) |
Apply function func on elements of the session and return a new session. |
Session.transpose (self, \*args) |
Reorder axes of arrays in session, ignoring missing axes for each array. |
Filtering/Cleaning¶
Session.filter (self[, pattern, kind]) |
Returns a new session with objects which match some criteria. |
Session.compact (self[, display]) |
Detects and removes “useless” axes (ie axes for which values are constant over the whole axis) for all array objects in session |
Load/Save¶
Session.load (self, fname[, names, engine, …]) |
Load Array objects from a file, or several .csv files (all formats). |
Session.save (self, fname[, names, engine, …]) |
Dumps Array objects from the current session to a file (all formats). |
Session.to_csv (self, fname[, names, display]) |
Dumps Array objects from the current session to CSV files. |
Session.to_excel (self, fname[, names, …]) |
Dumps Array objects from the current session to an Excel file. |
Session.to_hdf (self, fname[, names, …]) |
Dumps Array, Axis and Group objects from the current session to an HDF file. |
Session.to_pickle (self, fname[, names, …]) |
Dumps Array, Axis and Group objects from the current session to a file using pickle. |
Editor¶
view ([obj, title, depth]) |
Opens a new viewer window. |
edit ([obj, title, minvalue, maxvalue, …]) |
Opens a new editor window. |
debug ([depth]) |
Opens a new debug window. |
compare (\*args, \*\*kwargs) |
Opens a new comparator window, comparing arrays or sessions. |
run_editor_on_exception ([root_path, …]) |
Runs the editor when an unhandled exception (a fatal error) happens. |
Random¶
random.randint (low[, high, axes, dtype, meta]) |
Return random integers from low (inclusive) to high (exclusive). |
random.normal ([loc, scale, axes, meta]) |
Draw random samples from a normal (Gaussian) distribution. |
random.uniform ([low, high, axes, meta]) |
Draw samples from a uniform distribution. |
random.permutation (x[, axis]) |
Randomly permute a sequence along an axis, or return a permuted range. |
random.choice ([choices, axes, replace, p, meta]) |
Generates a random sample from given choices |