전체 글165 Python - pip install shap 오류 발생 시. MacBook환경에 shap 패키지 설치 중 의존성 오류 발생 시 해결방법. shap 패키지 설치 python -m pip install shap 다음의 오류 발생 ERROR: Failed building wheel for numba Running setup.py clean for numba Building wheel for llvmlite (setup.py) ... error ERROR: Command errored out with exit status 1: ... 중략 ... ERROR: Failed building wheel for llvmlite Running setup.py clean for llvmlite Successfully built shap Failed to build numba llv.. 2022. 9. 30. Go - 배열 초기화 및 사용 방법 1. Array 초기화 var x [10]int // 제로값으로 초기화 fmt.Println("x의 값은?", x)x의 값은? [0 0 0 0 0 0 0 0 0 0]2. 리터럴을 사용한 초기화 var fruits = [3]string{"apple", "banana", "kiwi"} // 배열 리터럴 사용 fmt.Println("fruits의 값은?", fruits) fruits의 값은? [apple banana kiwi]3. 비교 var x1 = [3]int{1, 2, 3} var x2 = [...]int{1, 2, 3} fmt.Println(x1 == x2) // true4. 배열 크기 확인 fmt.Println(len(x1)) // 35. 값 할당 위 x1 array 변수에 값을 할당한다. x1[0].. 2022. 9. 28. Go - 문제해결: Error loading workspace: gopls was not able to find modules in your workspace. VSCode에서 go 파일을 열면 다음과 같은 오류와 함께 package main 에 빨간 줄이 생겼다. (해당 오류가 발생해도 go run 은 문제없이 동작한다.) VSCode 하단에 다음과 같은 알림을 확인하였다. Error loading workspace: gopls was not able to find modules in your workspace. When outside of GOPATH, gopls needs to know which modules you are working on. You can fix this by opening your workspace to a folder inside a Go module, or by using a go.work file to specify multip.. 2022. 9. 27. Go - 숫자(int)를 문자열(string)로 변환 ( 함수 별 벤치마킹 ) int -> string 변환 방법 1. strconv.Itoa package main import ( "fmt" "strconv" ) func main() { var fruits [3]string fmt.Println(fruits, len(fruits)) for i := 0; i < len(fruits); i++ { fruits[i] = strconv.Itoa(i) fmt.Println(i, fruits[i]) } } 다른 변환 함수에 비해 제일 나은 성능을 보인다. 2. strconv.FormatInt for i := 0; i < len(fruits); i++ { fruits[i] = strconv.FormatInt(int64(i), 10) fmt.Println(i, fruits[i]) } 두 번째 .. 2022. 9. 13. 이전 1 ··· 8 9 10 11 12 13 14 ··· 42 다음