728x90
1. dictionary merge/update
a, b : dictionary
c = a|b # merge a with b, right always win if key conflicts, a,b 모두 합치되 common key에 대한 value는 b에 것 사용
a |= b # update a, a와 b모두에 있는 key는 b에서의 value로 update, a에만 있는 key는 그대로 유지
2. remove prefix/suffix of strings
a : string
a.removeprefix(prefix) # a가 입력한 prefix로 시작한다면 그것을 slicing으로 제외한 결과를 return
a.removesuffix(suffix) # a가 입력한 suffix로 끝나면 그것을 slixing으로 제외한 결과를 return
3. Type hinting for built-in generic types
type hinting에서 generic type에 대한 지원이 추가
Type hin
728x90
'ML' 카테고리의 다른 글
[Pandas]Iteration을 특정 index 이상에서부터 하고 싶을 때 (0) | 2020.10.25 |
---|---|
contextual data, contextual features, context features (0) | 2020.10.19 |
Streaming or stateful metric (0) | 2020.10.06 |
[ML] True positive, True negative, False positive, False negative 헷갈리지 않게 하기 (0) | 2020.10.03 |
RNN에 대한 이해 (0) | 2020.09.28 |