disclaimer: know other people on site have had error it's been in different contexts , fixes don't seem work here. hey stackoverflow, i've been making sideways space invaders game, ship follows mouse's y position stays on left, , clicking shoots bullet. enemies spawn randomly right , fly left, , objects removed once each side of screen. works fine, when tried implement collision detection see when shot hits enemy, error: typeerror: argument must rect style object. it points line "return hitbox.colliderect(target.rect)". try , work out causing made 'print' lines below see 'target.rect' (and whether proper rect object), , seemed same style shot's own rect, i'm lost why colliderect doesn't accept it. i've annotated pretty everything, sorry if it's insult intelligence should make things easier. class causes problems: class gameobject: def __init__(self, image, height, speed): self.speed = speed self.image...
i have couple of libsvm files have implement clustering in spark using python. file has space delimiter , first column represents type [ 1 or -1] , rest features in format [1:2.566]. there lot of columns , perform feature selection on [preferably implement chisquaretest model] , use pca or svd perform feature reduction process. but, not find decent tutorial python in spark implement these processes. i found link online had sample script implement chisqtest in python. used same logic implement model , not done. under hypothesis testing division in link, code parallelizes rdd[labeledpoint] before passing chisqtest model. tried same logic in different manner , got different errors. data = mlutils.loadlibsvmfile(sc, "path/filename.txt") label = data.map(lambda x: x.label) features = data.map(lambda x: x.features) obs = sc.parallelize(labeledpoint(label,features)) this gave me error stating typeerror: float() argument must string or number then, normalized data using...
Comments
Post a Comment