Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a_pandas_ex_loc_no_exceptions-0.10.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page