02-22-2019, 12:23 AM
Hello,
Python has an object type called DICTIONARY that in xcas / hpprime is table(), but python, only manages a few types of data in relation to xcas, which can operate with many more and powerfull math types.
Examples of use
Python has an object type called DICTIONARY that in xcas / hpprime is table(), but python, only manages a few types of data in relation to xcas, which can operate with many more and powerfull math types.
Examples of use
PHP Code:
tblA := table( "float_1" = 5.0 , "integer_2" = 5, "complex_4" = 3+4*i, "identifier_6" = var01, "list_7" = [9,[8,7],[6,5,4]], "symbolic_8" = x+y*i , "rational_9" = 3/4, "string_12" = "Hello", "set_2" = set[ a, b ,a, c ], "polynomial_10" = poly1[ 1, -6, 11, -6 ] , "matrix" = [[1,2],[3,4]], "vector" = [9,8,7,6,5,4], "function_13" = f(x):=x+1 )
[enter] returns
table( … )
tblA[ "float_1" ], tblA[ "integer_2" ], tblA[ "complex_4" ], tblA[ "identifier_6" ], tblA[ "list_7" ], tblA[ "symbolic_8" ], tblA[ "rational_9" ], tblA[ "string_12" ], tblA[ "function_13" ], tblA[ "set_2" ], tblA[ "polynomial_10" ], tblA[ "matrix" ], tblA[ "vector" ]
[enter] returns
5.0,5,3+4*i,var01,[9,[8,7],[6,5,4]],x+i*y,3/4,"Hello", (x)->x+1,set[a,b,c],poly1[1,-6,11,-6],[[1,2],[3,4]],[9,8,7,6,5,4]
type( tblA[ "float_1" ] ), type( tblA[ "integer_2" ] ), type( tblA[ "complex_4" ] ), type( tblA[ "identifier_6" ] ), type( tblA[ "list_7" ] ), type( tblA[ "symbolic_8" ] ), type( tblA[ "rational_9" ] ), type( tblA[ "string_12" ] ), type( tblA[ "function_13" ] ), type( tblA[ "set_2" ] ), type( tblA[ "polynomial_10" ]), type( tblA[ "matrix" ]), type( tblA[ "vector" ]), type( tblA)
[enter] returns
Xcas:
real, integer, complex, identifier, vector, expression, rational, string, func, vector, vector, vector, vector, DOM_MAP
hpprime:
DOM_FLOAT, DOM_INT, DOM_COMPLEX, DOM_IDENT, DOM_LIST, DOM_SYMBOLIC, DOM_RAT, DOM_STRING, DOM_FUNC,DOM_LIST, DOM_LIST, DOM_LIST, DOM_LIST, DOM_MAP
[ type( tblA[ "float_1" ] ), type( tblA[ "integer_2" ] ), type( tblA[ "complex_4" ] ), type( tblA[ "identifier_6" ] ), type( tblA[ "list_7" ] ), type( tblA[ "symbolic_8" ] ), type( tblA[ "rational_9" ] ), type( tblA[ "string_12" ] ), type( tblA[ "function_13" ] ), type( tblA[ "set_2" ] ), type( tblA[ "polynomial_10" ]), type( tblA[ "matrix" ]), type( tblA[ "vector" ]), type( tblA) ] .+ 0
[enter] returns
[1,2,4,6,7,8,10,12,13,7,7,7,7,17]
tblA[ "list_7" ][0] [enter] returns
9
tblA[ "list_7" ][[1]] [enter] returns
9