nasa / OnAIR

The On-board Artificial Intelligence Research (OnAIR) Platform is a framework that enables AI algorithms written in Python to interact with NASA's cFS. It is intended to explore research concepts in autonomous operations in a simulated environment.
66 stars 15 forks source link

Python Lists vs NumPy Arrays? #110

Open dragonejt opened 9 months ago

dragonejt commented 9 months ago

Is it worth switching from Python Lists to NumPy arrays as the basis for frames? OnAIR already seems to use NumPy in a lot of places, and NumPy arrays are more static and have more requirements than Python lists, such as the elements all needing to be all of the same type (floats). NumPy arrays are also based in C, which should allow for faster manipulations than with normal lists.

khurrameycon commented 8 months ago

Yes, numpy arrays support vectorized operations thus performance increases alot while using np.arrays instead of conventional lists.