Skip to content

Instantly share code, notes, and snippets.

@eggplants
Last active April 21, 2019 20:09
Show Gist options
  • Save eggplants/d0d663db9be321bc4b6ff85461944e1b to your computer and use it in GitHub Desktop.
Save eggplants/d0d663db9be321bc4b6ff85461944e1b to your computer and use it in GitHub Desktop.
#list(n-D) "data".flatten
sum(data,[])
#uniq
import numpy as np
np.unique(ans, axis=0)
#<<
data.append(line.split())
#chomp
str.strip()
#scan->list
import re
re.findall(regexp,str)
#match->match
import re
re.search(regexp,str)
#extract "list(n-D)[n-row]"s
nD_list=[[1,2,3],[4,5,6],[7,8,9],[10,11,12]]
extracted_row=[x[row_n] for x in nD_list]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment