在Python中以最佳比率压缩? [英] Compression with best ratio in Python?

查看:167
本文介绍了在Python中以最佳比率压缩?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python中哪种压缩方法具有最佳的压缩率?

Which compression method in Python has the best compression ratio?

常用的 zlib.compress()最好还是有更好的选择?我需要获得最佳的压缩率。

Is the commonly used zlib.compress() the best or are there some better options? I need to get the best compression ratio possible.

我正在压缩字符串并通过UDP发送它们。我压缩的典型字符串大约有1,700,000字节。

I am compresing strings and sending them over UDP. A typical string I compress has about 1,700,000 bytes.

推荐答案

我敢肯定,压缩效果更好的格式可能有些晦涩难懂,但是lzma是最好的,它得到了良好的支持。在此处

I'm sure that there might be some more obscure formats with better compression, but lzma is the best, of those that are well supported. There are some python bindings here.

编辑

未经测试就不要选择格式,某些算法根据数据集的效果更好。

Don't pick a format without testing, some algorithms do better depending on the data set.

这篇关于在Python中以最佳比率压缩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆