pemtk.fit._aggUtil
Module Contents
Functions
|
Set complex forms for aggregate results from [mag,phase] columns. |
|
Set aggregate results to matE format (Pandas) |
|
Pull columns from PD dataframe & stack to XR dataset. |
- pemtk.fit._aggUtil.setAggCompData(dataIn, keys={'comp': ['m', 'p'], 'compC': ['n', 'pc']})[source]
Set complex forms for aggregate results from [mag,phase] columns.
- Parameters:
data (pd.dataframe) – Data to convert.
keys (dict, optional, default = {'comp':['m','p'],'compC':['n','pc']}) – Dict of keys for output, and [mag,phase] columns to convert.
TODO (generalise further?) –
- pemtk.fit._aggUtil.setAggMatE(self, key='agg', dataOut=None, compDataLabels={'comp': ['m', 'p'], 'compC': ['n', 'pc']}, simpleForm=False, dropLabelsList=['Cont', 'Targ', 'Total', 'mu', 'it'], dropLevelsList=['Targ', 'Total', 'it'])[source]
Set aggregate results to matE format (Pandas)
If key=’ref’ use self.data[self.subKey][‘matE’] instead of aggregate data
- 18/07/22 - quickly hacked in ref data case for consistent results tabulations, probably already have this stuff elsewhere.
See also pemtk.fit._conv.pdConvRef() and self.setMatEFit()
- pemtk.fit._aggUtil.aggToXR(self, key='agg', cols={'comp': ['m', 'p'], 'compC': ['n', 'pc']}, EkeList=[1.1], dType='matE', conformDims=True, refKey=None, returnType='ds', simpleForm=False)[source]
Pull columns from PD dataframe & stack to XR dataset.
- colsdict, optional, default = {‘comp’:[‘m’,’p’],’compC’:[‘n’,’pc’]}
Dict of keys for output items/columns, and [mag,phase] columns to convert.
TODO: - EkeList from input data subset? - Use existing routines for more flexible dim handling? E.g. pemtk.sym._util.toePSproc - More returnTypes, currently set for single dataset or set of arrays (per col)
- UPDATE 19/07/22 - implemented ep.misc.restack(), which includes dim checking and expansions.
Set conformDims True/False for the latter. Eke dim still handled separately here. NOTE: conformDims=False with refKey only works reliably for da return type, otherwise may fail at dataset stacking.