This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# df : len(unique(index.id1)) 16000, len(unique(index.id1)) 67000 | |
# loop for id2 | |
# test 1. make sub df for id2 | |
A = time.time() | |
for id2 in df.index.get_level_values('id2'): | |
df_id2 = df.loc[df.index.get_level_values('id2') == id2] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pandas DataFrame iterate rows and assign to new column test | |
# - data size : 329 rows | |
# - unique of index one : 91 | |
# - unique of index one : 329 | |
# - iteration way | |
# - using index | |
# - make sub df one depth | |
# - make sub df two depth | |
# - using df index | |
# - groupby one level |
OlderNewer