本文整理汇总了Python中skbio.stats.distance.DissimilarityMatrix.read方法的典型用法代码示例。如果您正苦于以下问题:Python DissimilarityMatrix.read方法的具体用法?Python DissimilarityMatrix.read怎么用?Python DissimilarityMatrix.read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类skbio.stats.distance.DissimilarityMatrix
的用法示例。
在下文中一共展示了DissimilarityMatrix.read方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_io
# 需要导入模块: from skbio.stats.distance import DissimilarityMatrix [as 别名]
# 或者: from skbio.stats.distance.DissimilarityMatrix import read [as 别名]
def test_io(self):
# Very basic check that read/write public API is present and appears to
# be functioning. Roundtrip from memory -> disk -> memory and ensure
# results match.
fh = StringIO()
self.dm_3x3.write(fh)
fh.seek(0)
deserialized = DissimilarityMatrix.read(fh)
self.assertEqual(deserialized, self.dm_3x3)
self.assertTrue(type(deserialized) == DissimilarityMatrix)
示例2: print
# 需要导入模块: from skbio.stats.distance import DissimilarityMatrix [as 别名]
# 或者: from skbio.stats.distance.DissimilarityMatrix import read [as 别名]
#!/usr/bin/env python
from __future__ import print_function
from skbio.stats.distance import DissimilarityMatrix
from os import path
import sys
for distfile in sys.argv[1:]:
prefix = path.splitext(distfile)[0]
print(prefix)
dist = DissimilarityMatrix.read(distfile)
fig = dist.plot(title=prefix)
fig.tight_layout()
fig.savefig("{prefix}.pdf".format(prefix=prefix))