Код: Выделить всё
class Matrix:
def __init__(self, name: str, maximum: int, upperbound: int, rowcount: int) -> None:
'''
#### parameters:
name (str): Name of the matrix
maximum (int): Maximum value, the highest number in the matrix
upperbound (int): Number of matrix columns
rowcount (int): Number of matrix rows
'''
self.__name: str = name
self.__maximum: int = maximum
self.__upperbound: int = upperbound
self.__rowcount: int = rowcount
self.__data_matrix = []; # matrix of integer data retrieved from a data source
def crosstabulate(self, matrix_y: Matrix) -> list:
'''
cross tabulation functionality,
#### parameters:
matrix_y (Matrix): Matrix to cross tabulate with this class's matrix
'''
Дополнительное примечание. Мне только что пришло в голову, что я мог бы создать класс CrossTabulation, который принимает два класса Matrix в качестве параметров конструктора, если все остальное это не совсем так.
Подробнее здесь: https://stackoverflow.com/questions/769 ... ork-around