data

Deprecated since version 0.1.3: Use QRules, AmpForm, and TensorWaves instead.

import pycompwa.data

Data I/O of the pycompwa package.

This module forms the bridge between ComPWA data samples (or, more generally, collections of 4-momentum tuples) to the world of pandas. Additional PWA tools are available through a dataframe accessor named pwa (see PwaAccessor).

class PwaAccessor(pandas_object)[source]

Bases: object

DataFrame accessor for PWA properties.

Additional namespace to interpret DataFrame as PWA style dataframe, see here.

property energy

Get a dataframe containing only the energies.

property has_weights

Check if dataframe contains weights.

property intensities

Alias for weights() in the case of a fit intensity sample.

property mass

Compute the invariant masses.

property mass2

Compute the square of the invariant masses.

property momentum_labels: list

Get list of momentum labels contained in the data frame.

property other_columns: list

Get list of non-particle column names.

property p_xyz

Get a dataframe containing only the 3-momenta.

property particles: list

Get list of non-particle columns contained in the data frame.

property rho

Compute absolute value of the 3-momenta.

property rho2

Compute quadratic sum of the 3-momenta.

property top_columns: list

Get a list of the top layer column names.

property weight_label: str

Get the label of the weight column.

You need to know this string when adding weights.

property weights

Get list of weights, if available.

append(pwa_frame: DataFrame, other: DataFrame) DataFrame[source]

Append another DataFrame to a PWA DataFrame.

Parameters
  • pwa_framePWA DataFrame to which you want to append additional columns.

  • other – Other DataFrame from which you take the columns.

Raises

InvalidPwaFormat – If the input pwa_frame is not a PWA DataFrame.

Submodules and Subpackages