[Python] 2d-array 관련 팁

SCY·2022년 12월 10일

Python

목록 보기
2/2

그때 그때, 추가할 예정.

1. 2d-array를 1d로 펼치는 방법

output = sum(arr ,[])

2. 2d-array 내 max value 찾기

# method 1
output = max(map(max, arr))

# method 2
output = max([max(line) for line in arr])
profile
ML/DL

0개의 댓글