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
EventCollectionto aDataFrame.Create a PWA formatted
DataFramefrom anEventCollection.- Parameters
events – The
EventCollectionthat you want to convert.model – Name of the XML file containing the kinematic info or a
Kinematicsinstance. 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
DataFrameto anEventCollection.Create a
PWA formatted DataFramefrom anEventCollectionobject.