As you read through this question, you will see I am new to Python and NumPy, so please excuse any incorrect terminology.
I am currently working with two NumPy arrays, let's call them x
and y
.
x = numpy.array(0)
y = numpy.array(0)
I am operating on these arrays with functions that have these arrays as input and output.
x, y = function1(x, y)
x, y = function2(x, y)
...
This seems inelegant because if I could just make them parts of the same object, then I would only have a single input and output to these functions. I just want to make my code simpler, if possible.
x = function1(x)
x = function2(x)
...
As it turns out, y
describes the data in x
(not in this toy example, but with my actual arrays) so I figured I would set y
as a property of x
. My native language is MATLAB and I figured I could use syntax similar to creating struct hierarchies like so.
x.y = y
This doesn't work and, unfortunately, I don't know enough Python terminology to know what to look for online to find a solution to my problem.
Please let me know if you have any suggestions and/or if I can provide any clarification on this problem.