Package: a-pandas-ex-easy-loc
A tolerant version of df.locSearch and replace values with df.loc without Exceptions due to dtype incompatibility.  If the dtypes of 2 variables don't match, they will be converted until they match.pipinstalla_pandas_ex_easy_locSome examplesimportpandasaspddf=pd.read_csv("https://github.com/pandas-dev/pandas/raw/main/doc/data/titanic.csv")# df.loc[df.Ticket >20000]fromrandomimportrandrangegetrandomlist=lambdax:[[[randrange(1,100),randrange(1,100)]*1]*randrange(1,10)]df["listtest"]=df.PassengerId.map(getrandomlist)getrandomdict=lambdax:{randrange(1,100):randrange(1,100)for_inrange(randrange(1,10))}df["dicttest"]=df.PassengerId.map(getrandomdict)froma_easy_locimportpd_add_easy_locpd_add_easy_loc()df.shortloc_greater_replace('Pclass',2,3000)df.shortloc_equal('Pclass',3)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund...male22.0010A/5211717.2500NaNS[[[44,...{5:8,...2313Heikki...female26.0000STON/O...7.9250NaNS[[[60,...{33:3...4503Allen,...male35.00003734508.0500NaNS[[[99,...{96:1...5603Moran,...maleNaN003308778.4583NaNQ[[[82,...{23:1...7803Palsso...male2.003134990921.0750NaNS[[[14,...{20:8...8913Johnso...female27.000234774211.1333NaNS[[[12,...{96:5...df.shortloc_equal('Ticket',373450)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest4503Allen,...male35.0003734508.05NaNS[[[99,...{96:1...df.shortloc_greater('Pclass',2)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund...male22.0010A/5211717.2500NaNS[[[44,...{5:8,...2313Heikki...female26.0000STON/O...7.9250NaNS[[[60,...{33:3...4503Allen,...male35.00003734508.0500NaNS[[[99,...{96:1...5603Moran,...maleNaN003308778.4583NaNQ[[[82,...{23:1...df.shortloc_greater('Ticket',373450)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest161703Rice,...male2.04138265229.1250NaNQ[[[17,...{46:7...505103Panula...male7.041310129539.6875NaNS[[[30,...{64:2...686913Anders...female17.04231012817.9250NaNS[[[4,...{92:3...777803Moutal...maleNaN003747468.0500NaNS[[[65,...{47:9...858613Backst...female33.030310127815.8500NaNS[[[55,...{5:22...df.shortloc_greater_or_equal('Age',43)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest6701McCart...male54.0001746351.8625E46S[[[47,...{22:17}111211Bonnel...female58.00011378326.5500C103S[[[1,...{35:9}151612Hewlet...female55.00024870616.0000NaNS[[[43,...{40:6...333402Wheado...male66.000C.A.2...10.5000NaNS[[[6,...{50:28}525311Harper...female49.010PC1757276.7292D33C[[[41,...{54:6...df.shortloc_greater_replace('Pclass',2,3000)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103000Braund...male22.0010A/5211717.2500NaNS[[[65,...{76:3...1211Cuming...female38.0010PC1759971.2833C85C[[[1,...{55:3...2313000Heikki...female26.0000STON/O...7.9250NaNS[[[56,...{7:54...3411Futrel...female35.001011380353.1000C123S[[[91,...{51:89}4503000Allen,...male35.00003734508.0500NaNS[[[20,...{39:5...5603000Moran,...maleNaN003308778.4583NaNQ[[[60,...{63:2...6701McCart...male54.00001746351.8625E46S[[[51,...{1:90...df.shortloc_greater_replace('Ticket',5000,888000)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund...male22.0010A/5211717.2500NaNS[[[74,...{40:3...1211Cuming...female38.0010PC1759971.2833C85C[[[67,...{1:8}2313Heikki...female26.0000STON/O...7.9250NaNS[[[62,...{39:79}3411Futrel...female35.001088800053.1000C123S[[[15,...{13:2...4503Allen,...male35.00008880008.0500NaNS[[[81,...{60:90}5603Moran,...maleNaN008880008.4583NaNQ[[[58,...{20:4}6701McCart...male54.000088800051.8625E46S[[[28,...{21:8...7803Palsso...male2.003188800021.0750NaNS[[[25,...{53:8...8913Johnso...female27.000288800011.1333NaNS[[[47,...{19:3...df.shortloc_greater_replace('Cabin','C123',pd.NA)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund...male22.0010A/5211717.2500NaNS[[[74,...{40:3...1211Cuming...female38.0010PC1759971.2833<NA>C[[[67,...{1:8}2313Heikki...female26.0000STON/O...7.9250NaNS[[[62,...{39:79}3411Futrel...female35.001011380353.1000C123S[[[15,...{13:2...4503Allen,...male35.00003734508.0500NaNS[[[81,...{60:90}5603Moran,...maleNaN003308778.4583NaNQ[[[58,...{20:4}6701McCart...male54.00001746351.8625<NA>S[[[28,...{21:8...7803Palsso...male2.003134990921.0750NaNS[[[25,...{53:8...df.shortloc_in_iter('listtest',3)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest192013Masselmani,Mrs....femaleNaN0026497.2250NaNC[[[32,3],[32,...{98:75,69:39,...666712Nye,Mrs.(Eliza...female29.000C.A.2939510.5000F33S[[[3,98],[3,9...{60:81}929301Chaffee,Mr.Her...male46.010W.E.P.573461.1750E31S[[[52,3],[52,...{80:25}10610713Salkjelsvik,Mis...female21.0003431207.6500NaNS[[[85,3],[85,...{62:49}12012102Hickman,Mr.Sta...male21.020S.O.C.1487973.5000NaNS[[[40,3],[40,...{28:85,60:72,...12913003Ekstrom,Mr.Johanmale45.0003470616.9750NaNS[[[3,76],[3,7...{79:2,30:18,...13213303Robins,Mrs.Ale...female47.010A/5.333714.5000NaNS[[[3,68],[3,6...{69:90,1:23,...18418513Kink-Heilmann,M...female4.00231515322.0250NaNS[[[3,88],[3,8...{24:74,30:11,...df.shortloc_in_iter('listtest',[3,4,10])PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest192013Masselmani,Mrs....femaleNaN0026497.2250NaNC[[[32,3],[32,...{98:75,69:39,...222313McGowan,Miss.A...female15.00003309238.0292NaNQ[[[13,4],[13,...{56:86,30:5,...272801Fortune,Mr.Cha...male19.003219950263.0000C23C25C27S[[[4,66],[4,6...{58:98,32:55,...666712Nye,Mrs.(Eliza...female29.0000C.A.2939510.5000F33S[[[3,98],[3,9...{60:81}747513Bing,Mr.Leemale32.0000160156.4958NaNS[[[14,4],[14,...{31:31,64:38,...848512Ilett,Miss.Berthafemale17.0000SO/C1488510.5000NaNS[[[18,10],[18,...{81:64,10:80,...df.shortloc_in_iter('dicttest',[3,4,10])PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest5603Moran,Mr.JamesmaleNaN003308778.4583NaNQ[[[58,72],[58,72]]]{20:4}8913Johnson,Mrs.OscarW(Eli...female27.000234774211.1333NaNS[[[47,12],[47,12]]]{19:3,60:24,9:38}df.shortloc_in_iter('dicttest',[3,4,10])PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest969701Goldschmidt,Mr.GeorgeBmale71.000PC1775434.6542A5C[[[94,4],[94,4],[94,4],[94,4],[94,4],[94,4]]]{67:92,24:19,53:40,66:53,44:81,94:10,34:63,61:45}10310403Johansson,Mr.GustafJoelmale33.00075408.6542NaNS[[[89,10],[89,10],[89,10],[89,10],[89,10]]]{92:23,32:17,53:3,98:94}12913003Ekstrom,Mr.Johanmale45.0003470616.9750NaNS[[[3,76],[3,76],[3,76],[3,76],[3,76],[3,76],[3,76]]]{79:2,30:18,63:10,62:26,91:58,11:44,8:81,6:93,97:5}df.shortloc_in_iter_replace('dicttest',[3,4,10],15151515)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund,Mr.OwenHarrismale22.0010A/5211717.2500NaNS[[[74,68],[74,68],[74,...{40:30,93:84,24:92,7...1211Cumings,Mrs.JohnBradley...female38.0010PC1759971.2833C85C[[[67,64],[67,64],[67,...{1:8}2313Heikkinen,Miss.Lainafemale26.0000STON/O2.31012827.9250NaNS[[[62,65],[62,65],[62,...{39:79}3411Futrelle,Mrs.JacquesHea...female35.001011380353.1000C123S[[[15,96],[15,96],[15,...{13:29,65:59,99:31}4503Allen,Mr.WilliamHenrymale35.00003734508.0500NaNS[[[81,13]]]{60:90}5603Moran,Mr.JamesmaleNaN003308778.4583NaNQ[[[58,72],[58,72]]]151515156701McCarthy,Mr.TimothyJmale54.00001746351.8625E46S[[[28,98],[28,98],[28,...{21:8,31:42,9:40,93:...7803Palsson,Master.GostaLeo...male2.003134990921.0750NaNS[[[25,88],[25,88],[25,...{53:83,49:66,57:95,4...8913Johnson,Mrs.OscarW(Eli...female27.000234774211.1333NaNS[[[47,12],[47,12]]]15151515df.shortloc_isin('Embarked',['C','S'])PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund,Mr.OwenHarrismale22.0010A/5211717.2500NaNS[[[74,68],[74,68],[74,...{40:30,93:84,24:92,7...1211Cumings,Mrs.JohnBradley...female38.0010PC1759971.2833C85C[[[67,64],[67,64],[67,...{1:8}2313Heikkinen,Miss.Lainafemale26.0000STON/O2.31012827.9250NaNS[[[62,65],[62,65],[62,...{39:79}3411Futrelle,Mrs.JacquesHea...female35.001011380353.1000C123S[[[15,96],[15,96],[15,...{13:29,65:59,99:31}4503Allen,Mr.WilliamHenrymale35.00003734508.0500NaNS[[[81,13]]]{60:90}6701McCarthy,Mr.TimothyJmale54.00001746351.8625E46S[[[28,98],[28,98],[28,...{21:8,31:42,9:40,93:...7803Palsson,Master.GostaLeo...male2.003134990921.0750NaNS[[[25,88],[25,88],[25,...{53:83,49:66,57:95,4...8913Johnson,Mrs.OscarW(Eli...female27.000234774211.1333NaNS[[[47,12],[47,12]]]{19:3,60:24,9:38}df.shortloc_isin_replace('Embarked',['C','S'],'CCCCCCCCCCCCCCCCCCCSSSSSSSSSSSSSSSSSSSSSSSSSSSSS')PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund...male22.0010A/5211717.2500NaNCCCCCC...[[[74,...{40:3...1211Cuming...female38.0010PC1759971.2833C85CCCCCC...[[[67,...{1:8}2313Heikki...female26.0000STON/O...7.9250NaNCCCCCC...[[[62,...{39:79}3411Futrel...female35.001011380353.1000C123CCCCCC...[[[15,...{13:2...4503Allen,...male35.00003734508.0500NaNCCCCCC...[[[81,...{60:90}5603Moran,...maleNaN003308778.4583NaNQ[[[58,...{20:4}df.shortloc_isna('Age')PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest5603Moran,Mr.JamesmaleNaN003308778.4583NaNQ[[[25,39],[25,39]]]{97:78,85:88,42:34}171812Williams,Mr.CharlesEugenemaleNaN0024437313.0000NaNS[[[17,6],[17,6],[17,6...{41:6,2:82}192013Masselmani,Mrs.FatimafemaleNaN0026497.2250NaNC[[[11,37],[11,37],[11,...{43:73,50:28,38:47,4...262703Emir,Mr.FarredChehabmaleNaN0026317.2250NaNC[[[48,66],[48,66],[48,...{33:45,82:90}282913O'Dwyer, Miss. Ellen "Nellie"  female  NaN      0      0              330959    7.8792    NaN        Q           [[[3, 53], [3, 53]]]               {29: 90, 84: 86}293003Todoroff,Mr.LaliomaleNaN003492167.8958NaNS[[[67,3],[67,3],[67,3...{57:49,23:71,64:45,1...313211Spencer,Mrs.WilliamAugu...femaleNaN10PC17569146.5208B78C[[[88,94],[88,94],[88,...{4:42,98:58,94:7,39:...df.shortloc_isna_replace('Age',16541)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund,Mr.OwenHarrismale22.0010A/5211717.2500NaNS[[[27,71],[27,71],[27,...{36:67,73:54,56:48,8...1211Cumings,Mrs.JohnBradley...female38.0010PC1759971.2833C85C[[[31,68],[31,68],[31,...{9:77}2313Heikkinen,Miss.Lainafemale26.0000STON/O2.31012827.9250NaNS[[[31,23]]]{49:6,76:22,52:18,6:...3411Futrelle,Mrs.JacquesHea...female35.001011380353.1000C123S[[[96,48],[96,48],[96,...{27:90,9:38,18:94,67...4503Allen,Mr.WilliamHenrymale35.00003734508.0500NaNS[[[60,84],[60,84],[60,...{8:61,37:4,25:43,21:...5603Moran,Mr.Jamesmale16541.00003308778.4583NaNQ[[[25,39],[25,39]]]{97:78,85:88,42:34}6701McCarthy,Mr.TimothyJmale54.00001746351.8625E46S[[[76,5],[76,5],[76,5...{56:51,13:24,84:24,9...df.shortloc_less('Ticket',7534)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest192013Masselmani,Mrs.FatimafemaleNaN0026497.2250NaNC[[[11,37],[11,37],[11,...{43:73,50:28,38:47,4...262703Emir,Mr.FarredChehabmaleNaN0026317.2250NaNC[[[48,66],[48,66],[48,...{33:45,82:90}363713Mamee,Mr.HannamaleNaN0026777.2292NaNC[[[84,24],[84,24],[84,...{39:19,88:50,23:7,53...394013Nicola-Yarred,Miss.Jamilafemale14.0010265111.2417NaNC[[[20,72],[20,72],[20,...{72:91,81:15,89:24,9...484903Samaan,Mr.YoussefmaleNaN20266221.6792NaNC[[[79,85],[79,85],[79,...{35:61}535412Faunthorpe,Mrs.Lizzie(E...female29.0010292626.0000NaNS[[[62,79],[62,79]]]{36:53,38:70,6:1,89:...575803Novel,Mr.Mansouermale28.500026977.2292NaNC[[[86,78],[86,78]]]{28:5,49:22}606103Sirayanian,Mr.Orsenmale22.000026697.2292NaNC[[[24,72]]]{74:59,16:44,30:17,5...656613Moubarek,Master.GeriosmaleNaN11266115.2458NaNC[[[56,96],[56,96],[56,...{5:34,59:97,78:15,76...737403Chronopoulos,Mr.Apostolosmale26.0010268014.4542NaNC[[[78,24],[78,24]]]{96:26,87:73,58:49,3...747513Bing,Mr.Leemale32.0000160156.4958NaNS[[[86,20],[86,20],[86,...{84:87,18:40,17:28,7...df.shortloc_less_replace('Age',30,'less 30')PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund,Mr.OwenHarrismaleless3010A/5211717.2500NaNS[[[27,71],[27,71],[27,...{36:67,73:54,56:48,8...1211Cumings,Mrs.JohnBradley...female38.010PC1759971.2833C85C[[[31,68],[31,68],[31,...{9:77}2313Heikkinen,Miss.Lainafemaleless3000STON/O2.31012827.9250NaNS[[[31,23]]]{49:6,76:22,52:18,6:...3411Futrelle,Mrs.JacquesHea...female35.01011380353.1000C123S[[[96,48],[96,48],[96,...{27:90,9:38,18:94,67...df.shortloc_less_or_equal_replace('Survived',0,'DEAD')PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest01DEAD3Braund,Mr.OwenHarrismale22.0010A/5211717.2500NaNS[[[27,71],[27,71],[27,...{36:67,73:54,56:48,8...1211Cumings,Mrs.JohnBradley...female38.0010PC1759971.2833C85C[[[31,68],[31,68],[31,...{9:77}2313Heikkinen,Miss.Lainafemale26.0000STON/O2.31012827.9250NaNS[[[31,23]]]{49:6,76:22,52:18,6:...3411Futrelle,Mrs.JacquesHea...female35.001011380353.1000C123S[[[96,48],[96,48],[96,...{27:90,9:38,18:94,67...45DEAD3Allen,Mr.WilliamHenrymale35.00003734508.0500NaNS[[[60,84],[60,84],[60,...{8:61,37:4,25:43,21:...56DEAD3Moran,Mr.JamesmaleNaN003308778.4583NaNQ[[[25,39],[25,39]]]{97:78,85:88,42:34}67DEAD1McCarthy,Mr.TimothyJmale54.00001746351.8625E46S[[[76,5],[76,5],[76,5...{56:51,13:24,84:24,9...78DEAD3Palsson,Master.GostaLeo...male2.003134990921.0750NaNS[[[42,52],[42,52],[42,...{71:69,44:14}df.shortloc_not_equal_replace('Survived',0,True)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund,Mr.OwenHarrismale22.0010A/5211717.2500NaNS[[[27,71],[27,71],[27,...{36:67,73:54,56:48,8...12True1Cumings,Mrs.JohnBradley...female38.0010PC1759971.2833C85C[[[31,68],[31,68],[31,...{9:77}23True3Heikkinen,Miss.Lainafemale26.0000STON/O2.31012827.9250NaNS[[[31,23]]]{49:6,76:22,52:18,6:...34True1Futrelle,Mrs.JacquesHea...female35.001011380353.1000C123S[[[96,48],[96,48],[96,...{27:90,9:38,18:94,67...4503Allen,Mr.WilliamHenrymale35.00003734508.0500NaNS[[[60,84],[60,84],[60,...{8:61,37:4,25:43,21:...5603Moran,Mr.JamesmaleNaN003308778.4583NaNQ[[[25,39],[25,39]]]{97:78,85:88,42:34}df.shortloc_not_in_iter('listtest',list(range(0,90)))PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest83283303Saad,Mr.AminmaleNaN0026717.2292NaNC[[[95,94],[95,94],[95,...{82:66,84:5}48448511Bishop,Mr.DickinsonHmale25.0101196791.0792B49C[[[97,92],[97,92],[97,...{20:34,2:23,98:37,1:...58158211Thayer,Mrs.JohnBorland...female39.01117421110.8833C68C[[[91,90],[91,90]]]{48:98,3:98,93:4,97:...33633701Pears,Mr.ThomasClintonmale29.01011377666.6000C2S[[[90,98],[90,98]]]{6:7}11611703Connors,Mr.Patrickmale70.5003703697.7500NaNQ[[[92,99],[92,99],[92,...{60:79,75:71,28:68,5...525311Harper,Mrs.HenrySleeper...female49.010PC1757276.7292D33C[[[96,94],[96,94],[96,...{20:53,93:11,83:79,5...43944002Kvillner,Mr.JohanHenrik...male31.000C.A.1872310.5000NaNS[[[95,98],[95,98],[95,...{58:11,89:23,22:66,1...565712Rugg,Miss.Emilyfemale21.000C.A.3102610.5000NaNS[[[92,92],[92,92],[92,...{45:1,37:98}df.shortloc_not_in_iter_replace('listtest',list(range(0,20)),27)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund,Mr.OwenHarrismale22.0010A/5211717.2500NaNS27{36:67,73:54,56:48,8...1211Cumings,Mrs.JohnBradley...female38.0010PC1759971.2833C85C27{9:77}2313Heikkinen,Miss.Lainafemale26.0000STON/O2.31012827.9250NaNS27{49:6,76:22,52:18,6:...3411Futrelle,Mrs.JacquesHea...female35.001011380353.1000C123S27{27:90,9:38,18:94,67...4503Allen,Mr.WilliamHenrymale35.00003734508.0500NaNS27{8:61,37:4,25:43,21:...5603Moran,Mr.JamesmaleNaN003308778.4583NaNQ27{97:78,85:88,42:34}6701McCarthy,Mr.TimothyJmale54.00001746351.8625E46S[[[76,5],[76,5],[76,5...{56:51,13:24,84:24,9...df.shortloc_regex('Fare',r'^\d?7\.').to_string(max_colwidth=30)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund,Mr.OwenHarrismale22.010A/5211717.2500NaNS[[[27,71],[27,71],[27,...{36:67,73:54,56:48,8...2313Heikkinen,Miss.Lainafemale26.000STON/O2.31012827.9250NaNS[[[31,23]]]{49:6,76:22,52:18,6:...141503Vestrom,Miss.HuldaAmand...female14.0003504067.8542NaNS[[[40,57],[40,57],[40,...{54:39,8:35,76:84,20...192013Masselmani,Mrs.FatimafemaleNaN0026497.2250NaNC[[[11,37],[11,37],[11,...{43:73,50:28,38:47,4...262703Emir,Mr.FarredChehabmaleNaN0026317.2250NaNC[[[48,66],[48,66],[48,...{33:45,82:90}282913O'Dwyer, Miss. Ellen "Nellie"  female   NaN      0      0              330959   7.8792    NaN        Q           [[[3, 53], [3, 53]]]               {29: 90, 84: 86}293003Todoroff,Mr.LaliomaleNaN003492167.8958NaNS[[[67,3],[67,3],[67,3...{57:49,23:71,64:45,1...303101Uruchurtu,Don.ManuelEmale40.000PC1760127.7208NaNC[[[91,32],[91,32],[91,...{1:29,54:93,96:7}df.shortloc_not_regex('Fare',r'^\d?7\.').to_string(max_colwidth=30)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest1211Cumings,Mrs.JohnBradley...female38.0010PC1759971.2833C85C[[[31,68],[31,68],[31,...{9:77}3411Futrelle,Mrs.JacquesHea...female35.001011380353.1000C123S[[[96,48],[96,48],[96,...{27:90,9:38,18:94,67...4503Allen,Mr.WilliamHenrymale35.00003734508.0500NaNS[[[60,84],[60,84],[60,...{8:61,37:4,25:43,21:...5603Moran,Mr.JamesmaleNaN003308778.4583NaNQ[[[25,39],[25,39]]]{97:78,85:88,42:34}6701McCarthy,Mr.TimothyJmale54.00001746351.8625E46S[[[76,5],[76,5],[76,5...{56:51,13:24,84:24,9...7803Palsson,Master.GostaLeo...male2.003134990921.0750NaNS[[[42,52],[42,52],[42,...{71:69,44:14}8913Johnson,Mrs.OscarW(Eli...female27.000234774211.1333NaNS[[[92,21],[92,21],[92,...{61:17,72:44,81:74,3...91012Nasser,Mrs.Nicholas(Ade...female14.001023773630.0708NaNC[[[88,97],[88,97],[88,...{69:43}df.shortloc_str('Pclass',r'3').to_string(max_colwidth=30)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund,Mr.OwenHarrismale22.0010A/5211717.2500NaNS[[[27,71],[27,71],[27,...{36:67,73:54,56:48,8...2313Heikkinen,Miss.Lainafemale26.0000STON/O2.31012827.9250NaNS[[[31,23]]]{49:6,76:22,52:18,6:...4503Allen,Mr.WilliamHenrymale35.00003734508.0500NaNS[[[60,84],[60,84],[60,...{8:61,37:4,25:43,21:...5603Moran,Mr.JamesmaleNaN003308778.4583NaNQ[[[25,39],[25,39]]]{97:78,85:88,42:34}7803Palsson,Master.GostaLeo...male2.003134990921.0750NaNS[[[42,52],[42,52],[42,...{71:69,44:14}8913Johnson,Mrs.OscarW(Eli...female27.000234774211.1333NaNS[[[92,21],[92,21],[92,...{61:17,72:44,81:74,3...101113Sandstrom,Miss.Marguerit...female4.0011PP954916.7000G6S[[[28,63],[28,63],[28,...{12:80,63:96,79:99,5...121303Saundercock,Mr.WilliamH...male20.0000A/5.21518.0500NaNS[[[34,91],[34,91],[34,...{42:68,46:90,66:96,3...131403Andersson,Mr.AndersJohanmale39.001534708231.2750NaNS[[[3,47],[3,47],[3,47...{94:60,73:33,59:32,3...141503Vestrom,Miss.HuldaAmand...female14.00003504067.8542NaNS[[[40,57],[40,57],[40,...{54:39,8:35,76:84,20...161703Rice,Master.Eugenemale2.004138265229.1250NaNQ[[[24,8],[24,8],[24,8...{20:91,56:55,11:16,3...df.shortloc_str_replace('Pclass',r'3',4).to_string(max_colwidth=30)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0104Braund,Mr.OwenHarrismale22.0010A/5211717.2500NaNS[[[27,71],[27,71],[27,...{36:67,73:54,56:48,8...1211Cumings,Mrs.JohnBradley...female38.0010PC1759971.2833C85C[[[31,68],[31,68],[31,...{9:77}2314Heikkinen,Miss.Lainafemale26.0000STON/O2.31012827.9250NaNS[[[31,23]]]{49:6,76:22,52:18,6:...3411Futrelle,Mrs.JacquesHea...female35.001011380353.1000C123S[[[96,48],[96,48],[96,...{27:90,9:38,18:94,67...4504Allen,Mr.WilliamHenrymale35.00003734508.0500NaNS[[[60,84],[60,84],[60,...{8:61,37:4,25:43,21:...5604Moran,Mr.JamesmaleNaN003308778.4583NaNQ[[[25,39],[25,39]]]{97:78,85:88,42:34}6701McCarthy,Mr.TimothyJmale54.00001746351.8625E46S[[[76,5],[76,5],[76,5...{56:51,13:24,84:24,9...7804Palsson,Master.GostaLeo...male2.003134990921.0750NaNS[[[42,52],[42,52],[42,...{71:69,44:14}8914Johnson,Mrs.OscarW(Eli...female27.000234774211.1333NaNS[[[92,21],[92,21],[92,...{61:17,72:44,81:74,3...91012Nasser,Mrs.Nicholas(Ade...female14.001023773630.0708NaNC[[[88,97],[88,97],[88,...{69:43}101114Sandstrom,Miss.Marguerit...female4.0011PP954916.7000G6S[[[28,63],[28,63],[28,...{12:80,63:96,79:99,5...df.loc_positive_and(("Pclass","==",3),("Sex","!=","male"),("Age",">=",1),("Pclass",">=",3),("listtest","in_iter",[11,22,33,44,55,66,77,88,99]),("Sex","in",["female","male"]),("Name","re",r"Miss\."),("Ticket",">",5000),("Embarked","str","S"),)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest242503Palsson,Miss.TorborgDanirafemale8.03134990921.0750NaNS[[[44,33],[44,33],[44,...{98:85,8:23,21:77,85...14114213Nysten,Miss.AnnaSofiafemale22.0003470817.7500NaNS[[[44,30]]]{25:15,24:14,16:26,5...19219313Andersen-Jensen,Miss.Car...female19.0103500467.8542NaNS[[[39,55],[39,55],[39,...{1:44,16:59,80:13,81...63463503Skoog,Miss.Mabelfemale9.03234708827.9000NaNS[[[11,22]]]{40:7}df.loc_positive_and(('Ticket','==',373450),('Pclass','==',3))PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest4503Allen,Mr.WilliamHenrymale35.0003734508.05NaNS[[[60,84],[60,84],[60,...{8:61,37:4,25:43,21:...df.loc_positive_or(('Ticket','==',373450),('Pclass','==',3))PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest0103Braund,Mr.OwenHarrismale22.0010A/5211717.2500NaNS[[[27,71],[27,71],[27,...{36:67,73:54,56:48,8...2313Heikkinen,Miss.Lainafemale26.0000STON/O2.31012827.9250NaNS[[[31,23]]]{49:6,76:22,52:18,6:...4503Allen,Mr.WilliamHenrymale35.00003734508.0500NaNS[[[60,84],[60,84],[60,...{8:61,37:4,25:43,21:...5603Moran,Mr.JamesmaleNaN003308778.4583NaNQ[[[25,39],[25,39]]]{97:78,85:88,42:34}7803Palsson,Master.GostaLeo...male2.003134990921.0750NaNS[[[42,52],[42,52],[42,...{71:69,44:14}df.loc_positive_and(('Age','>=',13),('Age','<=',19))PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest91012Nasser,Mrs.Nicholas(Ade...female14.01023773630.0708NaNC[[[88,97],[88,97],[88,...{69:43}141503Vestrom,Miss.HuldaAmand...female14.0003504067.8542NaNS[[[40,57],[40,57],[40,...{54:39,8:35,76:84,20...222313McGowan,Miss.Anna"Annie"female15.0003309238.0292NaNQ[[[85,85],[85,85],[85,...{80:2,70:5,27:24,10:...272801Fortune,Mr.CharlesAlexa...male19.03219950263.0000C23C25C27S[[[7,96],[7,96],[7,96...{60:4,22:96,55:28,97...383903VanderPlanke,Miss.Augus...female18.02034576418.0000NaNS[[[82,50],[82,50],[82,...{70:41,90:86,46:95,3...394013Nicola-Yarred,Miss.Jamilafemale14.010265111.2417NaNC[[[20,72],[20,72],[20,...{72:91,81:15,89:24,9...444513Devaney,Miss.MargaretDeliafemale19.0003309587.8792NaNQ[[[97,1],[97,1],[97,1...{89:44,58:86,48:54,9...495003Arnold-Franchi,Mrs.Josef...female18.01034923717.8000NaNS[[[64,68],[64,68]]]{67:59,96:34,8:64,45...676803Crease,Mr.ErnestJamesmale19.000S.P.34648.1583NaNS[[[30,77],[30,77],[30,...{37:56,52:5,80:12,86...df.loc_positive_and(('Ticket','!=',373450),('Pclass','!=',3))PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest1211Cumings,Mrs.JohnBradley...female38.0010PC1759971.2833C85C[[[31,68],[31,68],[31,...{9:77}3411Futrelle,Mrs.JacquesHea...female35.001011380353.1000C123S[[[96,48],[96,48],[96,...{27:90,9:38,18:94,67...6701McCarthy,Mr.TimothyJmale54.00001746351.8625E46S[[[76,5],[76,5],[76,5...{56:51,13:24,84:24,9...91012Nasser,Mrs.Nicholas(Ade...female14.001023773630.0708NaNC[[[88,97],[88,97],[88,...{69:43}111211Bonnell,Miss.Elizabethfemale58.000011378326.5500C103S[[[66,84],[66,84]]]{87:7,75:62,84:22,94...151612Hewlett,Mrs.(MaryDKing...female55.000024870616.0000NaNS[[[93,7],[93,7],[93,7...{17:96,7:68,74:5,97:...df.loc_negative_and(('Age','>=',13),('Sex','str','female'))PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest38638703Goodwin,Master.SidneyLe...male1.0052CA214446.9000NaNS[[[32,26],[32,26],[32,...{42:33,97:56,33:73,7...26126213Asplund,Master.EdvinRoj...male3.004234707731.3875NaNS[[[40,73],[40,73],[40,...{7:23,93:3,18:66,96:...7803Palsson,Master.GostaLeo...male2.003134990921.0750NaNS[[[42,52],[42,52],[42,...{71:69,44:14}161703Rice,Master.Eugenemale2.004138265229.1250NaNQ[[[24,8],[24,8],[24,8...{20:91,56:55,11:16,3...78778803Rice,Master.GeorgeHughmale8.004138265229.1250NaNQ[[[32,90],[32,90],[32,...{5:17,83:1,82:16,21:...78878913Dean,Master.BertramVeremale1.0012C.A.231520.5750NaNS[[[27,72],[27,72],[27,...{58:65,42:92,61:72}27827903Rice,Master.Ericmale7.004138265229.1250NaNQ[[[48,59],[48,59],[48,...{16:64,97:83,66:91,9...df.shortloc_regex('Name','^Ab').shortloc_not_equal('Sex','male').shortloc_equal('Age',35)PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest27928013Abbott,Mrs.Stanton(Rosa...female35.011C.A.267320.25NaNS[[[93,85],[93,85],[93,...{37:16,68:58,42:7,20...df.shortloc_in_iter('dicttest',65).shortloc_not_in_iter('listtest',[77,65,80,83])PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest51551601Walker,Mr.WilliamAndersonmale47.0003696734.0208D46S[[[55,13],[55,13],[55,...{67:25,73:76,93:74,6...77277302Mack,Mrs.(Mary)female57.000S.O./P.P.310.5000E77S[[[3,67],[3,67],[3,67...{20:62,88:78,22:65,1...51851912Angle,Mrs.WilliamA(Flo...female36.01022687526.0000NaNS[[[78,94],[78,94]]]{32:53,48:66,20:5,67...101113Sandstrom,Miss.Marguerit...female4.011PP954916.7000G6S[[[28,63],[28,63],[28,...{12:80,63:96,79:99,5...27527611Andrews,Miss.KorneliaTh...female63.0101350277.9583D7S[[[84,21]]]{31:95,27:48,89:25,6...78878913Dean,Master.BertramVeremale1.012C.A.231520.5750NaNS[[[27,72],[27,72],[27,...{58:65,42:92,61:72}df.shortloc_not_isna("Cabin").shortloc_str("Cabin","C").shortloc_not_regex("Cabin","^.{4,}$")PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest1211Cumings,Mrs.JohnBradley...female38.010PC1759971.2833C85C[[[31,68],[31,68],[31,...{9:77}26927011Bissette,Miss.Ameliafemale35.000PC17760135.6333C99S[[[89,54],[89,54],[89,...{50:9,91:60,30:67,46...52752801Farthing,Mr.JohnmaleNaN00PC17483221.7792C95S[[[9,72],[9,72],[9,72...{41:24,63:10}15115211Pears,Mrs.Thomas(Edith...female22.01011377666.6000C2S[[[24,98],[24,98],[24,...{80:92,25:89,32:82,1...41241311Minahan,Miss.DaisyEfemale33.0101992890.0000C78Q[[[2,41]]]{57:41}54454501Douglas,Mr.WalterDonaldmale50.010PC17761106.4250C86C[[[55,21],[55,21],[55,...{51:49,16:20}55055111Thayer,Mr.JohnBorlandJrmale17.00217421110.8833C70C[[[37,20],[37,20],[37,...{17:85,49:77}43043111Bjornstrom-Steffansson,Mr...male28.00011056426.5500C52S[[[14,61],[14,61],[14,...{62:40}df.shortloc_in_iter('listtest',[99,77]).shortloc_regex('listtest',r"7\b,\s*\b9"))PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedlisttestdicttest11111203Zabour,Miss.Hilenifemale14.510266514.4542NaNC[[[27,99],[27,99],[27,...{76:81,62:60,98:43,5...#all methods can also be used against Series#Two examplesdf.Pclass.shortloc_regex('^2$')Out[54]:92152172202212..df.Pclass.shortloc_regex_replace('^3$',2000)Out[56]:0200011220003142000...