当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python Sympy Partition.as_ferrers()用法及代码示例


Partition.as_ferrers():as_ferrers()是一个sympy Python库函数,根据所提到的字符返回分区的ferrer图。

用法: sympy.combinatorics.partitions.Partition.as_ferrers(char)

返回:分区的费雷图


代码1:as_ferrers()示例

# Python code explaining 
# SymPy.as_ferrers() 
  
# importing SymPy libraries 
from sympy.combinatorics.partitions import Partition 
from sympy.combinatorics.partitions import IntegerPartition 
  
# Using from sympy.combinatorics.partitions.Partition.as_ferrers() method  
print(IntegerPartition([5, 2, 5]).as_ferrers())

输出:

#####
#####
##

代码2:as_ferrers(char ='*')示例

# Python code explaining 
# SymPy.as_ferrers() 
  
# importing SymPy libraries 
from sympy.combinatorics.partitions import Partition 
from sympy.combinatorics.partitions import IntegerPartition 
  
# Using from sympy.combinatorics.partitions.Partition.as_ferrers() method  
print(IntegerPartition([1, 2, 3, 4]).as_ferrers(char = '*'))

输出:

****
***
**
*



相关用法


注:本文由纯净天空筛选整理自noobestars101大神的英文原创作品 SymPy | Partition.as_ferrers() in Python。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。