Created
June 22, 2024 00:50
-
-
Save ZSendokame/efb15d4f0f6eb907c90ef198e9f7052b to your computer and use it in GitHub Desktop.
Make dictionaries by list segments.
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
def relindex_value(iterable: list, column: list) -> list[dict]: | |
result = [] | |
aux = {} | |
for index, item in enumerate(iterable): | |
aux[column[index % len(column)]] = item | |
if (index % len(column)) == (len(column) - 1): | |
result.append(aux) | |
aux = {} | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment