Skip to content

Instantly share code, notes, and snippets.

@zainabnazari
Last active June 23, 2023 04:02
Show Gist options
  • Save zainabnazari/098899a867e79dc56500ea1c8d342db7 to your computer and use it in GitHub Desktop.
Save zainabnazari/098899a867e79dc56500ea1c8d342db7 to your computer and use it in GitHub Desktop.
#In python instead of
my_list=[]
for i in range(len(my_files)):
my_list=my_list+[my_function(my_files.iloc[i][0])]
my_list;
#use:
my_list = [my_function(my_files.iloc[i][0]) for i in range(len(bl_files))]
#It's faster and more concise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment