반응형
* Python Data를 pickle format을 활용하여 저장할 경우 버젼별로 다르게 나오기 때문에 라이브러리 버젼의 차이로 Data무결성이 보장되지 않는다.
* When saving Python data using pickle format, the data integrity is not guaranteed due to the difference in the library version
* HDF5(Hierarchical Data Format) 형식
- 대량 과학 계산용 배열 Data 저장을 위하여 고안된 포맷
- C, Java, Julia, Matlab, Python 인터페이스 제공
- On the fly(실시간) 압축방식 제공 => Pattern 있는 Data를 더 효과적으로 저장한다.
- pandas를 활용하여 저장 : pd.HDFStore('File_Name')
- 데이터 로딩시 : pd.read_hdf('File_Name', 'Schema_Name', format='table or 'fixed')
- HDF5는 DB가 아니다. 한번 기록하고 자주 읽는 Data에 최적화되어 있다. 자주 기록해야하고 읽을 경우 성능 하락
- Data는 파일에 추가 가능하지만 만약 여러곳에 동시에 추가할 경우 파일이 깨질수 있으니 주의해야한다.
- Data분석에 CPU보다 IO성능에 의존적일 경우 file format으로 성능향상이 가능하다.
* HDF5
- A format designed for storing array data for large-scale scientific calculations.
- Provides C, Java, Julia, Matlab, and Python interfaces
- Provides on-the-fly compression => more efficient storage of patterned data.
- Store using Pandas: pd.HDFStore('File_Name')
- When loading data: pd.read_hdf('File_Name', 'Schema_Name', format='table or 'fixed')
- HDF5 is not a database. It is optimized for data that is written once and read frequently. The performance will be decreased if it needs to be written and read frequently
- Data can be added to a file, but the file may be broken if you add it to multiple places simultaneously.
- If your data analysis depends on IO performance rather than CPU, you can improve performance with the file format.
728x90
반응형