SymPy | Partition.as_ferrers() in Python
Partition.as_ferrers() : as_ferrers() is a sympy Python library function that returns the ferrer diagram of a partition as per the character mentioned.
Syntax : sympy.combinatorics.partitions.Partition.as_ferrers(char)
Return : ferrer diagram of a partition
Code #1 : as_ferrers() Example
from sympy.combinatorics.partitions import Partition
from sympy.combinatorics.partitions import IntegerPartition
print (IntegerPartition([ 5 , 2 , 5 ]).as_ferrers())
|
Output :
#####
#####
##
Code #2 : as_ferrers(char = ‘*’) Example
from sympy.combinatorics.partitions import Partition
from sympy.combinatorics.partitions import IntegerPartition
print (IntegerPartition([ 1 , 2 , 3 , 4 ]).as_ferrers(char = '*' ))
|
Output :
****
***
**
*
Last Updated :
26 Aug, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...