Saravanan666/pypi-org huggingface dataset:
Package: a-pandas-ex-horizontal-explode
Explode list/tuples in columnspipinstalla-pandas-ex-horizontal-explodefroma_pandas_ex_horizontal_explodeimportpd_add_horizontal_explodepd_add_horizontal_explode()importpandasaspddf=pd.Series([("enabled_previews_v1","type",0),("enabled_previews_v1","version",0),True,("enabled_previews_v1","type",0),("enabled_previews_v1",0),("locale",0),("properties","property_key",0),("properties","property_value",0),("properties",),("resume","package_name",0),("resume","stack",0),("resume","timestamp",0),("resume","external",0),("android_metadata","locale",0),("android_metadata","locale",0),("android_metadata","locale",0),33,("_sync_state","_id",0),])df2=df.to_frame()df2.columns=['aa']dfex=df.ds_horizontal_explode(concat=True)print(dfex.to_string())dfex2=df2.ds_horizontal_explode('aa',concat=False)print(dfex2.to_string())00_00_10_20(enabled_previews_v1,type,0)enabled_previews_v1type01(enabled_previews_v1,version,0)enabled_previews_v1version02True<NA><NA><NA>3(enabled_previews_v1,type,0)enabled_previews_v1type04(enabled_previews_v1,0)enabled_previews_v10<NA>5(locale,0)locale0<NA>6(properties,property_key,0)propertiesproperty_key07(properties,property_value,0)propertiesproperty_value08(properties,)properties<NA><NA>9(resume,package_name,0)resumepackage_name010(resume,stack,0)resumestack011(resume,timestamp,0)resumetimestamp012(resume,external,0)resumeexternal013(android_metadata,locale,0)android_metadatalocale014(android_metadata,locale,0)android_metadatalocale015(android_metadata,locale,0)android_metadatalocale01633<NA><NA><NA>17(_sync_state,_id,0)_sync_state_id0aa_0aa_1aa_20enabled_previews_v1type01enabled_previews_v1version02<NA><NA><NA>3enabled_previews_v1type04enabled_previews_v10<NA>5locale0<NA>6propertiesproperty_key07propertiesproperty_value08properties<NA><NA>9resumepackage_name010resumestack011resumetimestamp012resumeexternal013android_metadatalocale014android_metadatalocale015android_metadatalocale016<NA><NA><NA>17_sync_state_id0
Package: a-pandas-ex-html-view
DataFrame / Series in your browser#Based on pypi.org/project/any-iter-to-html-table/froma_pandas_ex_html_viewimportpd_add_html_viewimportpandasaspdpd_add_html_view()#this adds to new methods to pandasdf=pd.read_csv("https://github.com/pandas-dev/pandas/raw/main/doc/data/titanic.csv")df.ds_html_view()#for whole DataFramedf.Name.ds_html_view()#for SeriesFor DataFrames with MultiIndexIf you create your MultiIndexed DataFrame usinga-pandas-ex-plode-tool Â· PyPIa_pandas_ex_html_view will format the DataFrame in the prettiest way possible :)froma_pandas_ex_plode_toolimportpd_add_explode_toolspd_add_explode_tools()data={"glossary":{"title":"example glossary","GlossDiv":{"title":"S","GlossList":{"GlossEntry":{"ID":"SGML","SortAs":"SGML","GlossTerm":"Standard Generalized Markup Language","Acronym":"SGML","Abbrev":"ISO 8879:1986","GlossDef":{"para":"A meta-markup language, used to create markup languages such as DocBook.","GlossSeeAlso":["GML","XML"],},"GlossSee":"markup",}},},}}df=pd.Q_AnyNestedIterable_2df(data)df.ds_html_view()#if you don't want to open it in browser, just save it to your HDD:df.ds_html_view('f:\\testhtml.html')
Package: a-pandas-ex-imap2df
imap to pandas DataFramepip install a-pandas-ex-imap2dfimportpandasaspdfroma_pandas_ex_imap2dfimportpd_add_imap2dfpd_add_imap2df()df=pd.Q_imap2df(number=10,username="XZXXXXX@outlook.com",password="XXXXX",imap_server="outlook.office365.com",)...347Conten...image/...b'Cont...        Conten...      ([[Con...             2       Messag...\r\n\t...348Conten...image/...b'Cont...        Conten...      ([[Con...             2       Conten...       en-US349Conten...image/...b'Cont...        Conten...      ([[Con...             2       X-MS-H...         yes350Conten...image/...b'Cont...        Conten...      ([[Con...             2       X-Auto...         All351Conten...image/...b'Cont...        Conten...      ([[Con...             2       X-MS-E...          -1352Contenimage/...b'Cont...        Conten...      ([[Con...             2       X-MS-T...353Conten...image/...b'Cont...        Conten...      ([[Con...             2       X-MS-E...           0354Conten...image/...b'Cont...        Conten...      ([[Con...             2       Conten...   multip...355Conten...image/...b'Cont...        Conten...      ([[Con...             2       MIME-V...         1.0356Conten...colors...b'Cont...        Conten...      ([[Con...             2            From   Outloo......
Package: a-pandas-ex-loc-no-exceptions
Search through all columns of a DataFrame without worrying about Exceptions$pipinstalla-pandas-ex-loc-no-exceptionsimportreimportpandasaspdfroma_pandas_ex_loc_no_exceptionsimportpd_add_loc_no_exceptionspd_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 exceptionOperatorscannotbepassedtothefunction!Usedunderslikeintheexamples!<-__lt__<=-__le__==-__eq__!=-__ne__>-__gt__>=-__ge__+-__add__+=-__iadd__--__sub__*-__mul__@-__matmul__/-__truediv__//-__floordiv__%-__mod__**-__pow__<<-__lshift__>>-__rshift__&-__and__^-__xor__|-__or__~-__invert__
Package: a-pandas-ex-logcat2df
ADB logcat to Pandas DataFramepipinstalla-pandas-ex-logcat2dffroma_pandas_ex_logcat2dfimportpd_add_adb_logcat_to_dfimportpandasaspdpd_add_adb_logcat_to_df()adb_path="C:\\Users\\USERNAME\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe"deviceserial="localhost:5745"df=pd.Q_logcat2df(adb_path=adb_path,deviceserial=deviceserial,exit_keys='ctrl+x',timeout=None)....b'12-01 10:05:39.212 24637 24637 E System  :\tat android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1053)\r\n'b'12-01 10:05:39.212 24637 24637 E System  :\tat android.app.ActivityThread.handleBindApplication(ActivityThread.java:5418)\r\n'b'12-01 10:05:39.212 24637 24637 E System  :\tat android.app.ActivityThread.-wrap2(ActivityThread.java)\r\n'b'12-01 10:05:39.212 24637 24637 E System  :\tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1548)\r\n'b'12-01 10:05:39.212 24637 24637 E System  :\tat android.os.Handler.dispatchMessage(Handler.java:102)\r\n'b'12-01 10:05:39.212 24637 24637 E System  :\tat android.os.Looper.loop(Looper.java:154)\r\n'b'12-01 10:05:39.212 24637 24637 E System  :\tat android.app.ActivityThread.main(ActivityThread.ja....# ctrl+xKillingtheprocessdfOut[3]:aa_log_1...aa_whole_log0audio_hw_primary...audio_hw_primary:choosepcmC0D0pfor01InputMethodManagerService...InputMethodManagerService:packageName=com.goo...2InputMethodManagerService...InputMethodManagerService:ime_enabled=false...3InputMethodManagerService...InputMethodManagerService:packageName=com.goo...4InputMethodManagerService...InputMethodManagerService:ime_enabled=false..............345BitmapDrawable...BitmapDrawable:BitmapDrawablecannotdecode346android.widget.GridLayout...android.widget.GridLayout:horizontalconstrai...347View...View:requestLayout()improperlycalledby...348WatchWhileTimeBarController...WatchWhileTimeBarController:isScrubbing:noa...349WatchWhileTimeBarController...WatchWhileTimeBarController:getDisplayCurrent...[350rowsx9columns]
Package: a-pandas-ex-logsplit
Splits a DataFrame/Series logarithmicallypipinstalla-pandas-ex-logsplitfroma_pandas_ex_logsplitimportpd_add_logsplitpd_add_logsplit()importpandasaspddf=pd.read_csv("https://github.com/pandas-dev/pandas/raw/main/doc/data/titanic.csv")df=df[:50]forhindf.ds_logsplit(columns=["Cabin","Fare"],includeindex=False):print(h)forhindf.ds_logsplit(columns="Cabin",includeindex=True):print(h)forhindf.ds_logsplit(columns="Cabin",includeindex=False):print(h)forhindf.Cabin.ds_logsplit(includeindex=True):print(h)[(nan,7.25)][('C85',71.2833),(nan,7.925)][('C123',53.1),(nan,8.05),(nan,8.4583)][('E46',51.8625),(nan,21.075),(nan,11.1333),(nan,30.0708)][('G6',16.7),('C103',26.55),(nan,8.05),(nan,31.275),(nan,7.8542)][(nan,16.0),(nan,29.125),(nan,13.0),(nan,18.0),(nan,7.225),(nan,26.0)][('D56',13.0),(nan,8.0292),('A6',35.5),(nan,21.075),(nan,31.3875),(nan,7.225),('C23 C25 C27',263.0)][(nan,7.8792),(nan,7.8958),(nan,27.7208),('B78',146.5208),(nan,7.75),(nan,10.5),(nan,82.1708),(nan,52.0)][(nan,7.2292),(nan,8.05),(nan,18.0),(nan,11.2417),(nan,9.475),(nan,21.0),(nan,7.8958),(nan,41.5792),(nan,7.8792)][(nan,8.05),(nan,15.5),(nan,7.75),(nan,21.6792),(nan,17.8)][(0,1)][(1,2),(2,3)][(3,4),(4,5),(5,6)][(6,7),(7,8),(8,9),(9,10)][(10,11),(11,12),(12,13),(13,14),(14,15)][(15,16),(16,17),(17,18),(18,19),(19,20),(20,21)][(21,22),(22,23),(23,24),(24,25),(25,26),(26,27),(27,28)][(28,29),(29,30),(30,31),(31,32),(32,33),(33,34),(34,35),(35,36)][(36,37),(37,38),(38,39),(39,40),(40,41),(41,42),(42,43),(43,44),(44,45)][(45,46),(46,47),(47,48),(48,49),(49,50)][nan]['C85',nan]['C123',nan,nan]['E46',nan,nan,nan]['G6','C103',nan,nan,nan][nan,nan,nan,nan,nan,nan]['D56',nan,'A6',nan,nan,nan,'C23 C25 C27'][nan,nan,nan,'B78',nan,nan,nan,nan][nan,nan,nan,nan,nan,nan,nan,nan,nan][nan,nan,nan,nan,nan][(0,nan)][(1,'C85'),(2,nan)][(3,'C123'),(4,nan),(5,nan)][(6,'E46'),(7,nan),(8,nan),(9,nan)][(10,'G6'),(11,'C103'),(12,nan),(13,nan),(14,nan)][(15,nan),(16,nan),(17,nan),(18,nan),(19,nan),(20,nan)][(21,'D56'),(22,nan),(23,'A6'),(24,nan),(25,nan),(26,nan),(27,'C23 C25 C27')][(28,nan),(29,nan),(30,nan),(31,'B78'),(32,nan),(33,nan),(34,nan),(35,nan)][(36,nan),(37,nan),(38,nan),(39,nan),(40,nan),(41,nan),(42,nan),(43,nan),(44,nan)][(45,nan),(46,nan),(47,nan),(48,nan),(49,nan)]
Package: a-pandas-ex-lookupdict
Creates a lookup dict from a Pandas DataFrame (tuples as keys / np as values)pipinstalla-pandas-ex-lookupdictfroma_pandas_ex_lookupdictimportpd_add_lookup_dictimportpandasaspdpd_add_lookup_dict()df=pd.read_csv("https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv")di1=df[:5].d_get_lookup_dict(as_index=["Name","PassengerId"])di2=df[:5].d_get_lookup_dict(as_values=["Cabin","Fare"],as_index=["Name","PassengerId"])di1Out[4]:{('Braund, Mr. Owen Harris',1):array([[0,3,'male',22.0,1,0,'A/5 21171',7.25,nan,'S']],dtype=object),('Cumings, Mrs. John Bradley (Florence Briggs Thayer)',2):array([[1,1,'female',38.0,1,0,'PC 17599',71.2833,'C85','C']],dtype=object),('Heikkinen, Miss. Laina',3):array([[1,3,'female',26.0,0,0,'STON/O2. 3101282',7.925,nan,'S']],dtype=object),('Futrelle, Mrs. Jacques Heath (Lily May Peel)',4):array([[1,1,'female',35.0,1,0,'113803',53.1,'C123','S']],dtype=object)}di2Out[5]:{('Braund, Mr. Owen Harris',1):array([[nan,7.25]],dtype=object),('Cumings, Mrs. John Bradley (Florence Briggs Thayer)',2):array([['C85',71.2833]],dtype=object),('Heikkinen, Miss. Laina',3):array([[nan,7.925]],dtype=object),('Futrelle, Mrs. Jacques Heath (Lily May Peel)',4):array([['C123',53.1]],dtype=object)}
Package: a-pandas-ex-melt-pivot-tools
Some useful melt / pivot stuff for pandas DataFramespipinstalla-pandas-ex-melt-pivot-toolsfroma_pandas_ex_melt_pivot_toolsimportpd_add_stack_melt_toolspd_add_stack_melt_tools()importpandasaspddf=pd.DataFrame({"A":["foo","foo","foo","foo","foo","bar","bar","bar","bar"],"B":["one","one","one","two","two","one","one","two","two"],"C":["small","large","large","small","small","large","small","small","large",],"D":[1,2,2,3,3,4,5,6,7],"E":[2,4,5,5,6,6,8,9,9],})print('___________________________________')print(f'{df}\n\n')print('___________________________________')print(f"{df.ds_pivot_to_list(columns=['A'])}\n\n")print(f"{df.ds_pivot_to_list(columns=['A','B'])}\n\n")print(f"{df.ds_pivot_to_list(columns=['A','B','C'],stack=True)}\n\n")print(f"{df.ds_pivot_to_list_no_old_index_column(columns=['A'])}\n\n")print(f"{df.ds_pivot_to_list_no_old_index_column(columns=['A','B'])}\n\n")print(f"{df.ds_pivot_to_list_no_old_index_column(columns=['A','B','C'],stack=True)}\n\n")print(f"{df.ds_pivot_to_list_no_old_index_column_transposed(columns=['A'],stack=True)}\n\n")print(f"{df.ds_pivot_to_list_no_old_index_column_transposed(columns=['A','B'],stack=True)}\n\n")print(f"{df.ds_pivot_to_list_no_old_index_column_transposed(columns=['A','B','C'],stack=True)}\n\n")___________________________________ABCDE0fooonesmall121fooonelarge242fooonelarge253footwosmall354footwosmall365baronelarge466baronesmall587bartwosmall698bartwolarge79___________________________________bar...old_columnsold_columns...B[one,one,two,two,None]...[B,B,B,B,B]C[large,small,small,large,None]...[C,C,C,C,C]D[4,5,6,7,None]...[D,D,D,D,D]E[6,8,9,9,None]...[E,E,E,E,E][4rowsx3columns]bar...old_columnsone...old_columns...C[large,small,None]...[C,C,C]D[4,5,None]...[D,D,D]E[6,8,None]...[E,E,E][3rowsx5columns]barfooold_columnsonetwoonetwoold_columnsDNaNNaNNaNNaN[D,D]large[4,None][7,None][2,2]NaNNaNsmall[5,None][6,None][1,None][3,3]NaNENaNNaNNaNNaN[E,E]large[6,None][9,None][4,5]NaNNaNsmall[8,None][9,None][2,None][5,6]NaNbarfooB[one,one,two,two][one,one,one,two,two]C[large,small,small,large][small,large,large,small,small]D[4,5,6,7][1,2,2,3,3]E[6,8,9,9][2,4,5,5,6]barfooonetwoonetwoC[large,small][small,large][small,large,large][small,small]D[4,5][6,7][1,2,2][3,3]E[6,8][9,9][2,4,5][5,6]barfooonetwoonetwoDlarge[4][7][2,2]NaNsmall[5][6][1][3,3]Elarge[6][9][4,5]NaNsmall[8][9][2][5,6]barBoneClargeD4E6Bone...fooE5BtwoCsmallD3E6Length:3524,dtype:objectbaroneClargeD4E6ClargeD4...footwoD3E5CsmallD3E6Length:153,dtype:objectbaronelargeD4E6smallD5E8twolargeD7E9smallD6E9fooonelargeD2E4D2E5D2E4D2E5smallD1E2twosmallD3E5D3E6D3E5D3E6dtype:object
Package: a-pandas-ex-memorydump-to-df
ProcDump memory dump to Pandas DataFrame# Download ProcDump: https://learn.microsoft.com/pt-br/sysinternals/downloads/procdump# I had to make some changes to winappdbg# If you get an Exception, download https://github.com/hansalemaos/a_pandas_ex_memorydump_to_df/blob/main/winappdbg.zip# and overwrite all files in Lib\site-packages\winappdbg$pipinstalla-pandas-ex-memorydump-to-dfimportpandasaspdfroma_pandas_ex_memorydump_to_dfimportpd_add_memorydfpd_add_memorydf()df=pd.Q_df_from_memory(pid=9132,procdumppath=r"C:\Program Files\procdump.exe",with_utf8_bytes=False)# with_utf8_bytes=True takes much more time!Themethodwillconvertallbytestoeverypossibleformatwhichmeans,theDataFramemightgethuge.# Notepad.exe#       aa_address1_hex aa_address2_hex  ...  aa_ascii_int_63  aa_ascii_int_66# 0            00000000        00010000  ...               46               46# 1            00000000        00010010  ...               46               46# 2            00000000        00010020  ...               46               46# 3            00000000        00010030  ...               46               46# 4            00000000        00010040  ...               46               46#                ...             ...  ...              ...              ...# 64014        00007ff5        fffb0fc0  ...               46               46# 64015        00007ff5        fffb0fd0  ...               46               46# 64016        00007ff5        fffb0fe0  ...               46               46# 64017        00007ff5        fffb0ff0  ...               46               46# 64018        00007ff5        fffb1000  ...                0                0# [64019 rows x 304 columns]# df.size# Out[16]: 19461776# explorer.exe# df# Out[10]:#         aa_address1_hex aa_address2_hex  ...  aa_ascii_int_63  aa_ascii_int_66# 0              00000000        00010000  ...               46               46# 1              00000000        00010010  ...               46               46# 2              00000000        00010020  ...               46               46# 3              00000000        00010030  ...               46               46# 4              00000000        00010040  ...               46               46#                  ...             ...  ...              ...              ...# 3234712        00007ff5        fffb0fc0  ...               46               46# 3234713        00007ff5        fffb0fd0  ...               46               46# 3234714        00007ff5        fffb0fe0  ...               46               46# 3234715        00007ff5        fffb0ff0  ...               46               46# 3234716        00007ff5        fffb1000  ...                0                0## [3234717 rows x 304 columns]## df.size# Out[11]: 983353968# Location of the temp file (procdump)# df.tmp_file_path# Out[14]: 'C:\\Users\\Gamer\\AppData\\Local\\Temp\\tmpsypcc1g5.dmp'# df.tmp_delete_file()  $ file must be closed beforeLet's compare the converted values with the ones from CheatEngine
Package: a-pandas-ex-mindex-aggregate
Aggregates multiple columns of a DataFramepipinstalla-pandas-ex-mindex-aggregatefroma_pandas_ex_mindex_aggregateimportpd_add_mindex_aggregateimportpandasaspdpd_add_mindex_aggregate()df=pd.read_csv("https://github.com/pandas-dev/pandas/raw/main/doc/data/titanic.csv")PassengerIdSurvivedPclass...FareCabinEmbarked0103...7.2500NaNS1211...71.2833C85C2313...7.9250NaNS3411...53.1000C123S4503...8.0500NaNS.......................88688702...13.0000NaNS88788811...30.0000B42S88888903...23.4500NaNS88989011...30.0000C148C89089103...7.7500NaNQ[891rowsx12columns]df.d_multiindex_aggregate(['Fare','Age'])PassengerIdSurvived...CabinEmbarkedFareAge...0.000019.0[303][0]...[nan][S]25.0[272][1]...[nan][S]36.0[180][0]...[nan][S]38.0[823][0]...[nan][S]39.0[807][0]...[A36][S]...............263.000023.0[89][1]...[C23C25C27][S]24.0[342][1]...[C23C25C27][S]64.0[439][0]...[C23C25C27][S]512.329235.0[259,738][1,1]...[nan,B101][C,C]36.0[680][1]...[B51B53B55][C][815rowsx10columns]
Package: a-pandas-ex-multiloc
Search for multiple values in multiple columns of a Pandas DataFramepipinstalla-pandas-ex-multilocfromrandomimportrandrangefroma_pandas_ex_multilocimportpd_add_multilocimportpandasaspdpd_add_multiloc()df=pd.DataFrame([(randrange(0,256),randrange(0,256),randrange(0,256))forkinrange(100000)],columns=["r","g","b"],)df.d_multiloc(column_and_values=[("==",("r","g","b"),((166,16,169),(1,0,0),(18,38,64),(11,14,45),(11,14,pd.NA)),)],)# the same as:# df.loc[((df['r'] == 166)&(df['g'] == 16)&(df['b'] == 169))|((df['r'] == 1)&(df['g'] == 0)&(df['b'] == 0))|((df['r'] == 18)&(df['g'] == 38)&(df['b'] == 64))|((df['r'] == 11)&(df['g'] == 14)&(df['b'] == 45))|((df['r'] == 11)&(df['g'] == 14)&(df['b'] == pd.NA))]# NaN has to be passed as: pd.NAdf.d_multiloc(column_and_values=[("==",("r","g","b"),((11,14,45),(11,14,pd.NA)))],)# the same as: df.loc[((df['r'] == 11)&(df['g'] == 14)&(df['b'] == 45))|((df['r'] == 11)&(df['g'] == 14)&(df['b'] == pd.NA))]# not all values need to be inside each tupledf.d_multiloc(column_and_values=[("==",("r","g","b"),((11,14,45),(11,),(16,100)))],)# the same as: df.loc[((df['r'] == 11)&(df['g'] == 14)&(df['b'] == 45))|((df['r'] == 11))|((df['r'] == 16)&(df['g'] == 100))]
Package: a-pandas-ex-obj-into-cell
Puts objects into cells / columns of a Pandas Dataframepipinstalla-pandas-ex-obj-into-cellNot best (Pandas) practice, but sometimes very useful :)froma_pandas_ex_obj_into_cellimportpd_add_obj_into_cellsimportpandasaspdpd_add_obj_into_cells()df=pd.read_csv("https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv")d1=df.d_one_object_to_several_cells(column="test1",value=({1:("xx",331,11)}),indexlist=[1,2,3,7],ffill=True,bfill=True,)print(d1)d2=df.d_list_items_to_cells(column="test2",values=[[1,32,4,],{33:"dfd",0:[3,2]},4,(5,34),],indexlist=[1,4,6,9],ffill=False,bfill=False,)print(d2)'''PassengerId  Survived  Pclass  ... Cabin Embarked                 test10              1         0       3  ...   NaN        S  {1: ('xx', 331, 11)}1              2         1       1  ...   C85        C  {1: ('xx', 331, 11)}2              3         1       3  ...   NaN        S  {1: ('xx', 331, 11)}3              4         1       1  ...  C123        S  {1: ('xx', 331, 11)}4              5         0       3  ...   NaN        S  {1: ('xx', 331, 11)}..           ...       ...     ...  ...   ...      ...                   ...886          887         0       2  ...   NaN        S  {1: ('xx', 331, 11)}887          888         1       1  ...   B42        S  {1: ('xx', 331, 11)}888          889         0       3  ...   NaN        S  {1: ('xx', 331, 11)}889          890         1       1  ...  C148        C  {1: ('xx', 331, 11)}890          891         0       3  ...   NaN        Q  {1: ('xx', 331, 11)}[891 rows x 13 columns]PassengerId  Survived  Pclass  ... Cabin Embarked                   test20              1         0       3  ...   NaN        S                    <NA>1              2         1       1  ...   C85        C              [1, 32, 4]2              3         1       3  ...   NaN        S                    <NA>3              4         1       1  ...  C123        S                    <NA>4              5         0       3  ...   NaN        S  {33: 'dfd', 0: [3, 2]}..           ...       ...     ...  ...   ...      ...                     ...886          887         0       2  ...   NaN        S                     NaN887          888         1       1  ...   B42        S                     NaN888          889         0       3  ...   NaN        S                     NaN889          890         1       1  ...  C148        C                     NaN890          891         0       3  ...   NaN        Q                     NaN[891 rows x 13 columns]'''
Package: a-pandas-ex-pairwise-explode
Pairwise explode columns in a pandas DataFrame# Tested with:# Python 3.9.13# Windows 10pipinstalla-pandas-ex-pairwise-explodefroma_pandas_ex_pairwise_explodeimportpd_add_pairwise_explodeimportpandasaspdpd_add_pairwise_explode()df=pd.DataFrame([((244,22,12),(1,3,4),"a"),((2424,221),(1,3),"b"),((26544,22,12,"1"),(1,3,4,"dd"),"c"),((244,22,12),(1,3,4),"d"),])"""0              1  20       (244, 22, 12)      (1, 3, 4)  a1         (2424, 221)         (1, 3)  b2  (26544, 22, 12, 1)  (1, 3, 4, dd)  c3       (244, 22, 12)      (1, 3, 4)  d"""dfnew=df.d_pairwise_explode(columns=[0,1])"""0   1  20    244   1  a0     22   3  a0     12   4  a1   2424   1  b1    221   3  b2  26544   1  c2     22   3  c2     12   4  c2      1  dd  c3    244   1  d3     22   3  d3     12   4  d"""
Package: a-pandas-ex-read-charsep-frames
Reads data separated by any charpip install a-pandas-ex-read-charsep-framesCommon problem:File"pandas\_libs\parsers.pyx",line808,inpandas._libs.parsers.TextReader.read_low_memoryFile"pandas\_libs\parsers.pyx",line866,inpandas._libs.parsers.TextReader._read_rowsFile"pandas\_libs\parsers.pyx",line852,inpandas._libs.parsers.TextReader._tokenize_rowsFile"pandas\_libs\parsers.pyx",line1973,inpandas._libs.parsers.raise_parser_errorpandas.errors.ParserError:Errortokenizingdata.Cerror:Expected4fieldsinline4,saw5Fills up missing values with NaNfroma_pandas_ex_read_charsep_framesimportpd_add_read_charsep_framesimportpandasaspdpd_add_read_charsep_frames()df=pd.Q_read_charsep_frames(encoding="utf-8",file_or_string=r"C:\Users\Gamer\Documents\Downloads\alladd.txt",sep="\t",)print(df)0_0...0_4001001000...<NA>101001001...<NA>201001010...<NA>301001900...UNESP-UniversidadeEstadualJúliodeMesqui...401001901...EdifícioSantaLídia.........73275899975970...AGCSãoJoãoBosco73275999978000...<NA>73276099980000...<NA>73276199980970...ACDavidCanabarro73276299980974...AGCSãoJosédoCapingui[732763rowsx5columns]