User Jezrael - Stack Overflow

User Jezrael - Stack Overflow

Please don't hesitate to contact me:

import pandas as pd
d = {0: [1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 
         1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0], 
     1: [16, 1, 0, 15, 7, 14, 13, 7, 3, 10, 14, 8, 10, 3,  5, 4, 8, 13, 6, 2, 
         11, 11, 0, 12, 9, 16, 12, 15, 9, 1, 4, 5, 6, 2], 
     2: [32, 32, 32, 32, 32, 33, 46, 64, 97, 97, 99, 99, 100, 101, 101, 102, 103, 
         103, 103, 104, 105, 105, 106, 108, 109, 109, 110, 111, 111, 111, 112, 112, 121, 122]}
print (pd.DataFrame(d).pivot(1,0,2).applymap(chr).agg(''.join))

Most time repeating dupes, not easy find:

pivot dupe

booelan indexing dupe

idxmax + groupby dupe

idxmin + groupby dupe

melt dupe

explode dupe

cumcount dupe

map dupe

groupby+size+unstack dupe


sorting inplace dupe

factorize dupe

groupby+size dupe

groupby+ mean dupe

transform sum dupe

transform size dupe

keyerror dupe

merge/map dupe

value_count dupe

numpy select, where dupe

wide_to_long dupe

reset_index dupe

Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.