本文整理汇总了Python中matrix.Matrix.size方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.size方法的具体用法?Python Matrix.size怎么用?Python Matrix.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matrix.Matrix
的用法示例。
在下文中一共展示了Matrix.size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Matrix
# 需要导入模块: from matrix import Matrix [as 别名]
# 或者: from matrix.Matrix import size [as 别名]
import pygame
from pygame.locals import *
from dot import Dot
from matrix import Matrix
from board import Board
# TODO: get image from API
mars_map = Matrix()
mars_map.open()
mars_map.edit()
mars_map.save()
map_pixel = mars_map.size()
pygame.init()
# GLOBAL VARIABLES
MAX_ANTS = 500
speed = 10
tp = 0
ant_lst = []
# pygame CONFIG
screen_size = mars_map.size()
screen = pygame.display.set_mode(screen_size)
clock = pygame.time.Clock()
done = False
run = False
can_change = True
示例2:
# 需要导入模块: from matrix import Matrix [as 别名]
# 或者: from matrix.Matrix import size [as 别名]
print 'imported matrix'
print matrix
matrix.normalize_min_max()
print 'min-max normalized'
print matrix
matrix.normalize_mean()
print 'mean-normalized'
print matrix
print 'max'
print matrix.max()
print 'min'
print matrix.min()
print 'size'
print matrix.size()
print 'identity'
print Matrix.identity(5)
print -Matrix.identity(5)
print 'zeros'
print Matrix.zeros(2,3)
print 'ones'
print Matrix.ones(3,2)
print 'equal?'
print Matrix.ones(3,3) == Matrix.zeros(3,3)
print Matrix.ones(3,3) == Matrix.ones(3,3)
print 'not equal?'