250x250
Notice
Recent Posts
Recent Comments
Link
목록캐글 (1)
코딩걸음마
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/b1oVsO/btrFoE4SEq4/d0u3bkcBlz6qrEWpT3wOR1/img.gif)
데이터프레임(DataFrame) 메모리 줄이는 코드! 캐글에서 가장 인기있는 코드이다. 불러오는 파일의 크기가 300mb이상이고, numeric정보만 있다면 사용할 때 메모리 감소 효과가 크다 dtype 변경에 따라 일부 모듈에서 오류를 낼 수 있지만, 그때마다 astype으로 교체해주는 귀찮음보다 메모리감소 효과가 너무 크다. def reduce_mem_usage(df): """ iterate through all the columns of a dataframe and modify the data type to reduce memory usage. """ #start_mem = df.memory_usage().sum() / 1024**2 #print('Memory usage of dataframe is..
파이썬_꼭_익혀야하는_기초
2022. 6. 22. 09:36