ModelFlowIb 2.68__tar.gz → 2.69__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {modelflowib-2.68 → modelflowib-2.69}/ModelFlowIb.egg-info/PKG-INFO +1 -1
- {modelflowib-2.68 → modelflowib-2.69}/PKG-INFO +1 -1
- {modelflowib-2.68 → modelflowib-2.69}/modelmf.py +38 -38
- {modelflowib-2.68 → modelflowib-2.69}/pyproject.toml +1 -1
- {modelflowib-2.68 → modelflowib-2.69}/ModelFlowIb.egg-info/SOURCES.txt +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/ModelFlowIb.egg-info/dependency_links.txt +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/ModelFlowIb.egg-info/requires.txt +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/ModelFlowIb.egg-info/top_level.txt +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelBLfunk.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/model_Excel.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/model_cvx.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/model_doable.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/model_dynare.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/model_financial_stability.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/model_ifrs9.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/model_latex.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/model_latex_class.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/model_run_numba.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelclass.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelclass2.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelconstruct.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modeldash.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modeldashboot.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modeldashsidebar.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modeldekom.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modeldiff.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modeldisplay.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelestimation.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelfeedback.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelgrab.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelgrabwf2.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelhelp.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelinvert.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modeljupyter.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modeljupytermagic.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelmacrograb.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelmanipulation.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelnet.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelnewton.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelnormalize.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelpattern.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelpatternrev.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelreport.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelsandbox.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelsandbox_Mixin.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modeltodo.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modeluserfunk.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modeluserfunk_old.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelvis.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelwidget.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelwidget_input.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelwidget_input_old.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/modelwidget_shinypy.py +0 -0
- {modelflowib-2.68 → modelflowib-2.69}/setup.cfg +0 -0
|
@@ -230,48 +230,48 @@ if not hasattr(pd.DataFrame,'mf'):
|
|
|
230
230
|
print('hello from ibloc')
|
|
231
231
|
return
|
|
232
232
|
|
|
233
|
-
def
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
233
|
+
def mfquery_0(pat, df):
|
|
234
|
+
'''
|
|
235
|
+
Returns a DataFrame with columns matching the pattern(s), case-insensitive.
|
|
236
|
+
The pattern can be a string or a list of patterns.
|
|
237
|
+
Wildcards: * and ?
|
|
238
|
+
|
|
239
|
+
Args:
|
|
240
|
+
pat (string or list of strings)
|
|
241
|
+
df (DataFrame)
|
|
242
|
+
Returns:
|
|
243
|
+
DataFrame subset
|
|
244
|
+
'''
|
|
245
|
+
if isinstance(pat, list):
|
|
246
|
+
patterns = pat
|
|
247
|
+
else:
|
|
248
|
+
patterns = [pat]
|
|
249
|
+
|
|
250
|
+
# Lowercase lookup for case-insensitive matching
|
|
251
|
+
col_map = {str(c) .lower(): c for c in df.columns}
|
|
252
|
+
lower_cols = list(col_map.keys())
|
|
253
|
+
|
|
254
|
+
seen = set()
|
|
255
|
+
names = []
|
|
256
|
+
|
|
257
|
+
for p in patterns:
|
|
258
|
+
for up in p.lower().split():
|
|
259
|
+
for v in fnmatch.filter(lower_cols, up):
|
|
260
|
+
orig = col_map[v]
|
|
261
|
+
if orig not in seen:
|
|
262
|
+
seen.add(orig)
|
|
263
|
+
names.append(orig)
|
|
264
|
+
|
|
265
|
+
return df.loc[:, names]
|
|
266
|
+
|
|
267
|
+
|
|
268
268
|
@pd.api.extensions.register_dataframe_accessor("mfquery")
|
|
269
|
-
class
|
|
269
|
+
class mfquery:
|
|
270
270
|
def __init__(self, pandas_obj):
|
|
271
271
|
self._obj = pandas_obj
|
|
272
|
-
|
|
272
|
+
|
|
273
273
|
def __call__(self, pat):
|
|
274
|
-
return
|
|
274
|
+
return mfquery_0(pat, self._obj)
|
|
275
275
|
|
|
276
276
|
|
|
277
277
|
def f(a):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|