pandas-plots 0.12.17__tar.gz → 0.12.18__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.
- {pandas_plots-0.12.17/src/pandas_plots.egg-info → pandas_plots-0.12.18}/PKG-INFO +1 -1
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/setup.cfg +1 -1
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/src/pandas_plots/hlp.py +30 -2
- {pandas_plots-0.12.17 → pandas_plots-0.12.18/src/pandas_plots.egg-info}/PKG-INFO +1 -1
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/LICENSE +0 -0
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/README.md +0 -0
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/pyproject.toml +0 -0
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/src/pandas_plots/pii.py +0 -0
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/src/pandas_plots/pls.py +0 -0
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/src/pandas_plots/tbl.py +0 -0
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/src/pandas_plots/ven.py +0 -0
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/src/pandas_plots.egg-info/SOURCES.txt +0 -0
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/src/pandas_plots.egg-info/dependency_links.txt +0 -0
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/src/pandas_plots.egg-info/pii.py +0 -0
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/src/pandas_plots.egg-info/requires.txt +0 -0
- {pandas_plots-0.12.17 → pandas_plots-0.12.18}/src/pandas_plots.egg-info/top_level.txt +0 -0
@@ -471,7 +471,7 @@ pd.DataFrame.add_bitmask_label = add_bitmask_label
|
|
471
471
|
ddb.DuckDBPyRelation.add_bitmask_label = add_bitmask_label
|
472
472
|
|
473
473
|
|
474
|
-
def find_cols(all_cols: list[str], stubs
|
474
|
+
def find_cols(all_cols: list[str], stubs: list[str] = None):
|
475
475
|
"""
|
476
476
|
Find all columns in a list of columns that contain any of the given stubs.
|
477
477
|
|
@@ -487,10 +487,38 @@ def find_cols(all_cols: list[str], stubs=list[str]):
|
|
487
487
|
list[str]
|
488
488
|
List of columns that contain any of the given stubs.
|
489
489
|
"""
|
490
|
-
if all_cols is None or
|
490
|
+
if all_cols is None or stubs is None:
|
491
491
|
return "❌ empty lists"
|
492
492
|
return [col for col in all_cols if any(match in col for match in stubs)]
|
493
493
|
|
494
|
+
def find_cols(all_cols: list[str], stubs: list[str] = None) -> list[str]:
|
495
|
+
"""
|
496
|
+
Find all columns in a list of columns that contain any of the given stubs,
|
497
|
+
preserving the order of stubs in the output.
|
498
|
+
|
499
|
+
Parameters
|
500
|
+
----------
|
501
|
+
all_cols : list[str]
|
502
|
+
List of columns to search in.
|
503
|
+
stubs : list[str], optional
|
504
|
+
List of strings to search for in column names.
|
505
|
+
|
506
|
+
Returns
|
507
|
+
-------
|
508
|
+
list[str]
|
509
|
+
List of columns that contain any of the given stubs, ordered by stubs.
|
510
|
+
"""
|
511
|
+
if all_cols is None or not stubs:
|
512
|
+
print("❌ empty lists")
|
513
|
+
return []
|
514
|
+
|
515
|
+
result = []
|
516
|
+
for stub in stubs:
|
517
|
+
result.extend([col for col in all_cols if stub in col])
|
518
|
+
|
519
|
+
return result
|
520
|
+
|
521
|
+
|
494
522
|
# * extend objects to enable chaining
|
495
523
|
pd.DataFrame.find_cols = find_cols
|
496
524
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pandas_plots-0.12.17 → pandas_plots-0.12.18}/src/pandas_plots.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|