Panel

Constructor

Panel([data, items, major_axis, minor_axis, ...]) Represents wide format panel data, stored as 3-dimensional array

Attributes and underlying data

Axes

  • items: axis 0; each item corresponds to a DataFrame contained inside
  • major_axis: axis 1; the index (rows) of each of the DataFrames
  • minor_axis: axis 2; the columns of each of the DataFrames
Panel.values Numpy representation of NDFrame
Panel.axes Return index label(s) of the internal NDFrame
Panel.ndim Number of axes / array dimensions
Panel.size number of elements in the NDFrame
Panel.shape Return a tuple of axis dimensions
Panel.dtypes Return the dtypes in this object.
Panel.ftypes Return the ftypes (indication of sparse/dense and dtype) in this object.
Panel.get_dtype_counts() Return the counts of dtypes in this object.
Panel.get_ftype_counts() Return the counts of ftypes in this object.

Conversion

Panel.astype(dtype[, copy, raise_on_error]) Cast object to input numpy.dtype
Panel.copy([deep]) Make a copy of this objects data.
Panel.isnull() Return a boolean same-sized object indicating if the values are null.
Panel.notnull() Return a boolean same-sized object indicating if the values are not null.

Getting and setting

Panel.get_value(*args, **kwargs) Quickly retrieve single value at (item, major, minor) location
Panel.set_value(*args, **kwargs) Quickly set single value at (item, major, minor) location

Indexing, iteration, slicing

Panel.at Fast label-based scalar accessor
Panel.iat Fast integer location scalar accessor.
Panel.ix A primarily label-location based indexer, with integer position fallback.
Panel.loc Purely label-location based indexer for selection by label.
Panel.iloc Purely integer-location based indexing for selection by position.
Panel.__iter__() Iterate over infor axis
Panel.iteritems() Iterate over (label, values) on info axis
Panel.pop(item) Return item and drop from frame.
Panel.xs(key[, axis]) Return slice of panel along selected axis
Panel.major_xs(key) Return slice of panel along major axis
Panel.minor_xs(key) Return slice of panel along minor axis

For more information on .at, .iat, .ix, .loc, and .iloc, see the indexing documentation.

Binary operator functions

Panel.add(other[, axis]) Addition of series and other, element-wise (binary operator add).
Panel.sub(other[, axis]) Subtraction of series and other, element-wise (binary operator sub).
Panel.mul(other[, axis]) Multiplication of series and other, element-wise (binary operator mul).
Panel.div(other[, axis]) Floating division of series and other, element-wise (binary operator truediv).
Panel.truediv(other[, axis]) Floating division of series and other, element-wise (binary operator truediv).
Panel.floordiv(other[, axis]) Integer division of series and other, element-wise (binary operator floordiv).
Panel.mod(other[, axis]) Modulo of series and other, element-wise (binary operator mod).
Panel.pow(other[, axis]) Exponential power of series and other, element-wise (binary operator pow).
Panel.radd(other[, axis]) Addition of series and other, element-wise (binary operator radd).
Panel.rsub(other[, axis]) Subtraction of series and other, element-wise (binary operator rsub).
Panel.rmul(other[, axis]) Multiplication of series and other, element-wise (binary operator rmul).
Panel.rdiv(other[, axis]) Floating division of series and other, element-wise (binary operator rtruediv).
Panel.rtruediv(other[, axis]) Floating division of series and other, element-wise (binary operator rtruediv).
Panel.rfloordiv(other[, axis]) Integer division of series and other, element-wise (binary operator rfloordiv).
Panel.rmod(other[, axis]) Modulo of series and other, element-wise (binary operator rmod).
Panel.rpow(other[, axis]) Exponential power of series and other, element-wise (binary operator rpow).
Panel.lt(other[, axis]) Wrapper for comparison method lt
Panel.gt(other[, axis]) Wrapper for comparison method gt
Panel.le(other[, axis]) Wrapper for comparison method le
Panel.ge(other[, axis]) Wrapper for comparison method ge
Panel.ne(other[, axis]) Wrapper for comparison method ne
Panel.eq(other[, axis]) Wrapper for comparison method eq

Function application, GroupBy

Panel.apply(func[, axis]) Applies function along axis (or axes) of the Panel
Panel.groupby(function[, axis]) Group data on given axis, returning GroupBy object

Computations / Descriptive Stats

Panel.abs() Return an object with absolute value taken–only applicable to objects that are all numeric.
Panel.clip([lower, upper, axis]) Trim values at input threshold(s).
Panel.clip_lower(threshold[, axis]) Return copy of the input with values below given value(s) truncated.
Panel.clip_upper(threshold[, axis]) Return copy of input with values above given value(s) truncated.
Panel.count([axis]) Return number of observations over requested axis.
Panel.cummax([axis, skipna]) Return cumulative max over requested axis.
Panel.cummin([axis, skipna]) Return cumulative minimum over requested axis.
Panel.cumprod([axis, skipna]) Return cumulative product over requested axis.
Panel.cumsum([axis, skipna]) Return cumulative sum over requested axis.
Panel.max([axis, skipna, level, numeric_only]) This method returns the maximum of the values in the object.
Panel.mean([axis, skipna, level, numeric_only]) Return the mean of the values for the requested axis
Panel.median([axis, skipna, level, numeric_only]) Return the median of the values for the requested axis
Panel.min([axis, skipna, level, numeric_only]) This method returns the minimum of the values in the object.
Panel.pct_change([periods, fill_method, ...]) Percent change over given number of periods.
Panel.prod([axis, skipna, level, numeric_only]) Return the product of the values for the requested axis
Panel.sem([axis, skipna, level, ddof, ...]) Return unbiased standard error of the mean over requested axis.
Panel.skew([axis, skipna, level, numeric_only]) Return unbiased skew over requested axis
Panel.sum([axis, skipna, level, numeric_only]) Return the sum of the values for the requested axis
Panel.std([axis, skipna, level, ddof, ...]) Return sample standard deviation over requested axis.
Panel.var([axis, skipna, level, ddof, ...]) Return unbiased variance over requested axis.

Reindexing / Selection / Label manipulation

Panel.add_prefix(prefix) Concatenate prefix string with panel items names.
Panel.add_suffix(suffix) Concatenate suffix string with panel items names.
Panel.drop(labels[, axis, level, inplace, ...]) Return new object with labels in requested axis removed.
Panel.equals(other) Determines if two NDFrame objects contain the same elements.
Panel.filter([items, like, regex, axis]) Subset rows or columns of dataframe according to labels in the specified index.
Panel.first(offset) Convenience method for subsetting initial periods of time series data based on a date offset.
Panel.last(offset) Convenience method for subsetting final periods of time series data based on a date offset.
Panel.reindex([items, major_axis, minor_axis]) Conform Panel to new index with optional filling logic, placing NA/NaN in locations having no value in the previous index.
Panel.reindex_axis(labels[, axis, method, ...]) Conform input object to new index with optional filling logic, placing NA/NaN in locations having no value in the previous index.
Panel.reindex_like(other[, method, copy, ...]) Return an object with matching indices to myself.
Panel.rename([items, major_axis, minor_axis]) Alter axes input function or functions.
Panel.sample([n, frac, replace, weights, ...]) Returns a random sample of items from an axis of object.
Panel.select(crit[, axis]) Return data corresponding to axis labels matching criteria
Panel.take(indices[, axis, convert, is_copy]) Analogous to ndarray.take
Panel.truncate([before, after, axis, copy]) Truncates a sorted NDFrame before and/or after some particular index value.

Missing data handling

Panel.dropna([axis, how, inplace]) Drop 2D from panel, holding passed axis constant
Panel.fillna([value, method, axis, inplace, ...]) Fill NA/NaN values using the specified method

Reshaping, sorting, transposing

Panel.sort_index([axis, level, ascending, ...]) Sort object by labels (along an axis)
Panel.swaplevel([i, j, axis]) Swap levels i and j in a MultiIndex on a particular axis
Panel.transpose(*args, **kwargs) Permute the dimensions of the Panel
Panel.swapaxes(axis1, axis2[, copy]) Interchange axes and swap values axes appropriately
Panel.conform(frame[, axis]) Conform input DataFrame to align with chosen axis pair.

Combining / joining / merging

Panel.join(other[, how, lsuffix, rsuffix]) Join items with other Panel either on major and minor axes column
Panel.update(other[, join, overwrite, ...]) Modify Panel in place using non-NA values from passed Panel, or object coercible to Panel.

Serialization / IO / Conversion

Panel.from_dict(data[, intersect, orient, dtype]) Construct Panel from dict of DataFrame objects
Panel.to_pickle(path) Pickle (serialize) object to input file path.
Panel.to_excel(path[, na_rep, engine]) Write each DataFrame in Panel to a separate excel sheet
Panel.to_hdf(path_or_buf, key, **kwargs) Activate the HDFStore.
Panel.to_sparse(*args, **kwargs) NOT IMPLEMENTED: do not call this method, as sparsifying is not supported for Panel objects and will raise an error.
Panel.to_frame([filter_observations]) Transform wide format into long (stacked) format as DataFrame whose columns are the Panel’s items and whose index is a MultiIndex formed of the Panel’s major and minor axes.
Panel.to_xarray() Return an xarray object from the pandas object.
Panel.to_clipboard([excel, sep]) Attempt to write text representation of object to the system clipboard This can be pasted into Excel, for example.