Search through all columns of a DataFrame without worrying about Exceptions
Project description
Search through all columns of a DataFrame without worrying about Exceptions
$pip install a-pandas-ex-loc-no-exceptions
import re
import pandas as pd
from a_pandas_ex_loc_no_exceptions import pd_add_loc_no_exceptions
pd_add_loc_no_exceptions()
df=pd.read_pickle('f:\\dafasdfaf.pkl')
print(df.d_loc_no_exception('str.contains','youtube',na=False,flags=re.I))
print(df.d_loc_no_exception('__eq__','Non-Data Actions'))
print(df.d_loc_no_exception('__gt__',print)) #wont throw exception
Operators cannot be passed to the function!
Use dunders like in the examples!
< - __lt__
<= - __le__
== - __eq__
!= - __ne__
> - __gt__
>= - __ge__
+ - __add__
+= - __iadd__
- - __sub__
* - __mul__
@ - __matmul__
/ - __truediv__
// - __floordiv__
% - __mod__
** - __pow__
<< - __lshift__
>> - __rshift__
& - __and__
^ - __xor__
| - __or__
~ - __invert__
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for a_pandas_ex_loc_no_exceptions-0.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 040732cdbd898f820d82cb3d5ab9c3905c6db7825519b6ab762d0d071e734c11 |
|
MD5 | 2822ea15d51d504fe18cbf4603926ce3 |
|
BLAKE2b-256 | 6ae03c471fc5f2896d1508a0891db0949d264c4af19db0da54dd0561df43f231 |
Close
Hashes for a_pandas_ex_loc_no_exceptions-0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 207677e89c9f38ff41392504aeb86e703bbd28325bbbf9961f3472793417e230 |
|
MD5 | 5579ec320d2860b24e90895cbf115515 |
|
BLAKE2b-256 | 13e80c90704ade10ae96ef1cdbe3467ff8c96a1dddfecf164f3ea0a7162132c1 |