+ 2

# How can i represent python dictionary in real math?

For example {'x': 10, 'y': 20,' z': 30} - in what structure it can be converted?

6 Answers

+ 3

When I said matrix, I was meaning a unique row matrix... as your dict in example let be thinking to a 3D triplet coordinates, which can be handle as list, so multi rows matrix ;)
Anyway, it's an conceptual abstract structure for human handle help in programming: you probably cannot just transpose it in "real math"...

+ 3

There's no weird question: iit's weird to not ask if we don't know and want to ;)

+ 2

Maybe a function, defined value-wise: f('x') = 10, f('y')=20, f('z')=30.

+ 2

Vector? Set? Equation system?

+ 1

A matrix with named parameters?
Think at it just as an array indexed by names instead by integers values... It's more useful to handle explicits references names to access to a structure of array like a triplet of 3D coordinates by their names than by an index ( 0 for x, 1 for y, 2 for z: ok, but less readable, more source of mistakes ) ^^

+ 1

Maybe this question is weird, but i've been asked for this question on interview))