본문 바로가기

전체 글195

Pandas에서 loop 로 row 접근하는 방법 속도비교 #%% iloc/ loc import time t0 = time.time() cnt= 0 for i in range(10000): a =df1c.loc[i]['play_days'] if int(a)>5: cnt+=1 print(cnt) print('elapsed. ', time.time() - t0) #%% at import time t0 = time.time() cnt= 0 for i in range(10000): a =df1c.at[i,'play_days'] if int(a)>5: cnt+=1 print(cnt) print('elapsed. ', time.time() - t0) #%% export list of dict t0 = time.time() df_d = df1c.to_dict() print(.. 2020. 4. 14.
[pandas] sql distinct 처럼 unique한 column pair구하기 two column의 고유한 pair 구하기 col1 col2 1 a b 2 d f 3 a b 4 a c 5 d f df.groupby(['col1','col2']).size().reset_index(name='freq') col1 col2 freq 1 a b 2 2 d f 2 3 a c 1 2020. 4. 2.
linux terminal 깨진 한글 폴더 이름 변경하기 서버의 폴더이름이 한글이라 깨져서 접근할수 없을때 로케일 변경 작업을 하기 어려울수 있다. (서버니까..) 깨진 폴더명을 변경하는 스크립트 #!/bin/bash select x in *; do echo -n "new name : " read ASDF mv "$x" "$ASDF" exit done 2020. 4. 1.
tensorflow에 필요한 각종 라이브러리 버전 정보 ubuntu 18.04 LTS 텐서플로 설치안내문 :https://www.tensorflow.org/install/gpu 텐서플로와 gpu 1. nvidia_driver는 418버전으로 sudo apt-get install nvidia-driver-418 2. cuda 10.1 설치 https://developer.nvidia.com/cuda-toolkit-archive sudo ./cudnn10.1~~.run nvcc가 /usr/loca/cuda-10.1 에 설치되는데, 이 nvcc을 /usr/bin 같은데로 link 걸지말자. cudnn에서 nvcc 패스를 찾아서 설치하는데 잘못된 곳에 설치할수 있다 export PATH=$PATH:/usr/local/cuda/bin export LD_LIBRARY_.. 2020. 3. 27.