convert¶
Deprecated since version 0.1.3: Use QRules, AmpForm, and TensorWaves instead.
import pycompwa.data.convert
Conversion tools between from ComPWA objects and pandas.DataFrame
.
This module contains functions that help convertion from ComPWA objects like
EventCollection
and DataSet
to a
DataFrame
and back.
- events_to_pandas(events: EventCollection, model: Optional[str] = None) DataFrame [source]¶
Convert an
EventCollection
to aDataFrame
.Create a PWA formatted
DataFrame
from anEventCollection
.- Parameters
events – The
EventCollection
that you want to convert.model – Name of the XML file containing the kinematic info or a
Kinematics
instance. Required if you want to rename the PIDs!
- Raises
ConfigurationConflict – Number of final state particles in XML does not agree with number of final state particles in
PwaAccessor
.
- pandas_to_events(frame: DataFrame, model: str) EventCollection [source]¶
Convert
DataFrame
to anEventCollection
.Create a
PWA formatted DataFrame
from anEventCollection
object.