pandas.Panel¶
- class pandas.Panel(data=None, items=None, major_axis=None, minor_axis=None, copy=False, dtype=None)¶
Represents wide format panel data, stored as 3-dimensional array
Parameters : data : ndarray (items x major x minor), or dict of DataFrames
items : Index or array-like
axis=0
major_axis : Index or array-like
axis=1
minor_axis : Index or array-like
axis=2
dtype : dtype, default None
Data type to force, otherwise infer
copy : boolean, default False
Copy data from inputs. Only affects DataFrame / 2d ndarray input
Attributes
at axes index(es) of the NDFrame blocks Internal property, property synonym for as_blocks() dtypes Return the dtypes in this object empty True if NDFrame is entirely empty [no items] ftypes Return the ftypes (indication of sparse/dense and dtype) iat iloc ix loc ndim Number of axes / array dimensions shape tuple of axis dimensions values Numpy representation of NDFrame is_copy Methods
abs() Return an object with absolute value taken. add(other[, axis]) Wrapper method for add add_prefix(prefix) Concatenate prefix string with panel items names. add_suffix(suffix) Concatenate suffix string with panel items names align(other[, join, axis, level, copy, ...]) Align two object on their axes with the apply(func[, axis]) Applies function along input axis of the Panel as_blocks() Convert the frame to a dict of dtype -> Constructor Types that each has as_matrix() asfreq(freq[, method, how, normalize]) Convert all TimeSeries inside to specified frequency using DateOffset astype(dtype[, copy, raise_on_error]) Cast object to input numpy.dtype at_time(time[, asof]) Select values at particular time of day (e.g. between_time(start_time, end_time[, ...]) Select values between particular times of the day (e.g., 9:00-9:30 AM) bfill([axis, inplace, limit, downcast]) Synonym for NDFrame.fillna(method=’bfill’) bool() Return the bool of a single element PandasObject clip([lower, upper, out]) Trim values at input threshold(s) clip_lower(threshold) Return copy of the input with values below given value truncated clip_upper(threshold) Return copy of input with values above given value truncated compound([axis, skipna, level]) Return the compound percentage of the values for the requested axis conform(frame[, axis]) Conform input DataFrame to align with chosen axis pair. consolidate([inplace]) Compute NDFrame with “consolidated” internals (data of each dtype convert_objects([convert_dates, ...]) Attempt to infer better dtype for object columns copy([deep]) Make a copy of this object count([axis]) Return number of observations over requested axis. cummax([axis, dtype, out, skipna]) Return cumulative max over requested axis. cummin([axis, dtype, out, skipna]) Return cumulative min over requested axis. cumprod([axis, dtype, out, skipna]) Return cumulative prod over requested axis. cumsum([axis, dtype, out, skipna]) Return cumulative sum over requested axis. describe([percentile_width, percentiles]) Generate various summary statistics, excluding NaN values. div(other[, axis]) Wrapper method for truediv divide(other[, axis]) Wrapper method for truediv drop(labels[, axis, level, inplace]) Return new object with labels in requested axis removed dropna([axis, how, inplace]) Drop 2D from panel, holding passed axis constant eq(other) Wrapper for comparison method eq equals(other) Determines if two NDFrame objects contain the same elements. NaNs in the ffill([axis, inplace, limit, downcast]) Synonym for NDFrame.fillna(method=’ffill’) fillna([value, method, axis, inplace, ...]) Fill NA/NaN values using the specified method filter([items, like, regex, axis]) Restrict the info axis to set of items or wildcard first(offset) Convenience method for subsetting initial periods of time series data floordiv(other[, axis]) Wrapper method for floordiv fromDict(data[, intersect, orient, dtype]) Construct Panel from dict of DataFrame objects from_dict(data[, intersect, orient, dtype]) Construct Panel from dict of DataFrame objects ge(other) Wrapper for comparison method ge get(key[, default]) Get item from object for given key (DataFrame column, Panel slice, get_dtype_counts() Return the counts of dtypes in this object get_ftype_counts() Return the counts of ftypes in this object get_value(*args, **kwargs) Quickly retrieve single value at (item, major, minor) location get_values() same as values (but handles sparseness conversions) groupby(function[, axis]) Group data on given axis, returning GroupBy object gt(other) Wrapper for comparison method gt head([n]) interpolate([method, axis, limit, inplace, ...]) Interpolate values according to different methods. isnull() Return a boolean same-sized object indicating if the values are null .. iteritems() Iterate over (label, values) on info axis iterkv(*args, **kwargs) iteritems alias used to get around 2to3. Deprecated join(other[, how, lsuffix, rsuffix]) Join items with other Panel either on major and minor axes column keys() Get the ‘info axis’ (see Indexing for more) kurt([axis, skipna, level, numeric_only]) Return unbiased kurtosis over requested axis kurtosis([axis, skipna, level, numeric_only]) Return unbiased kurtosis over requested axis last(offset) Convenience method for subsetting final periods of time series data le(other) Wrapper for comparison method le load(path) Deprecated. lt(other) Wrapper for comparison method lt mad([axis, skipna, level]) Return the mean absolute deviation of the values for the requested axis major_xs(key[, copy]) Return slice of panel along major axis mask(cond) Returns copy whose values are replaced with nan if the max([axis, skipna, level, numeric_only]) This method returns the maximum of the values in the object. mean([axis, skipna, level, numeric_only]) Return the mean of the values for the requested axis median([axis, skipna, level, numeric_only]) Return the median of the values for the requested axis min([axis, skipna, level, numeric_only]) This method returns the minimum of the values in the object. minor_xs(key[, copy]) Return slice of panel along minor axis mod(other[, axis]) Wrapper method for mod mul(other[, axis]) Wrapper method for mul multiply(other[, axis]) Wrapper method for mul ne(other) Wrapper for comparison method ne notnull() Return a boolean same-sized object indicating if the values are not null .. pct_change([periods, fill_method, limit, freq]) Percent change over given number of periods. pop(item) Return item and drop from frame. pow(other[, axis]) Wrapper method for pow prod([axis, skipna, level, numeric_only]) Return the product of the values for the requested axis product([axis, skipna, level, numeric_only]) Return the product of the values for the requested axis radd(other[, axis]) Wrapper method for radd rdiv(other[, axis]) Wrapper method for rtruediv reindex([items, major_axis, minor_axis]) Conform Panel to new index with optional filling logic, placing reindex_axis(labels[, axis, method, level, ...]) Conform input object to new index with optional filling logic, reindex_like(other[, method, copy, limit]) return an object with matching indicies to myself rename([items, major_axis, minor_axis]) Alter axes input function or functions. rename_axis(mapper[, axis, copy, inplace]) Alter index and / or columns using input function or functions. replace([to_replace, value, inplace, limit, ...]) Replace values given in ‘to_replace’ with ‘value’. resample(rule[, how, axis, fill_method, ...]) Convenience method for frequency conversion and resampling of regular time-series data. rfloordiv(other[, axis]) Wrapper method for rfloordiv rmod(other[, axis]) Wrapper method for rmod rmul(other[, axis]) Wrapper method for rmul rpow(other[, axis]) Wrapper method for rpow rsub(other[, axis]) Wrapper method for rsub rtruediv(other[, axis]) Wrapper method for rtruediv save(path) Deprecated. select(crit[, axis]) Return data corresponding to axis labels matching criteria sem([axis, skipna, level, ddof]) Return unbiased standard error of the mean over requested axis. set_axis(axis, labels) public verson of axis assignment set_value(*args, **kwargs) Quickly set single value at (item, major, minor) location shift(*args, **kwargs) Shift major or minor axis by specified number of leads/lags. skew([axis, skipna, level, numeric_only]) Return unbiased skew over requested axis slice_shift([periods, axis]) Equivalent to shift without copying data. sort_index([axis, ascending]) Sort object by labels (along an axis) squeeze() squeeze length 1 dimensions std([axis, skipna, level, ddof]) Return unbiased standard deviation over requested axis. sub(other[, axis]) Wrapper method for sub subtract(other[, axis]) Wrapper method for sub sum([axis, skipna, level, numeric_only]) Return the sum of the values for the requested axis swapaxes(axis1, axis2[, copy]) Interchange axes and swap values axes appropriately swaplevel(i, j[, axis]) Swap levels i and j in a MultiIndex on a particular axis tail([n]) take(indices[, axis, convert, is_copy]) Analogous to ndarray.take toLong(*args, **kwargs) to_clipboard([excel, sep]) Attempt to write text representation of object to the system clipboard to_dense() Return dense representation of NDFrame (as opposed to sparse) to_excel(path[, na_rep, engine]) Write each DataFrame in Panel to a separate excel sheet to_frame([filter_observations]) Transform wide format into long (stacked) format as DataFrame whose to_hdf(path_or_buf, key, **kwargs) activate the HDFStore to_json([path_or_buf, orient, date_format, ...]) Convert the object to a JSON string. to_long(*args, **kwargs) to_msgpack([path_or_buf]) msgpack (serialize) object to input file path to_pickle(path) Pickle (serialize) object to input file path to_sparse([fill_value, kind]) Convert to SparsePanel to_sql(name, con[, flavor, if_exists, ...]) Write records stored in a DataFrame to a SQL database. transpose(*args, **kwargs) Permute the dimensions of the Panel truediv(other[, axis]) Wrapper method for truediv truncate([before, after, axis, copy]) Truncates a sorted NDFrame before and/or after some particular tshift([periods, freq, axis]) tz_convert(tz[, axis, copy]) Convert the axis to target time zone. tz_localize(tz[, axis, copy, infer_dst]) Localize tz-naive TimeSeries to target time zone update(other[, join, overwrite, ...]) Modify Panel in place using non-NA values from passed var([axis, skipna, level, ddof]) Return unbiased variance over requested axis. where(cond[, other, inplace, axis, level, ...]) Return an object of same shape as self and whose corresponding xs(key[, axis, copy]) Return slice of panel along selected axis