NumPy - Array Manipulation
What is the main difference between
flatten() and ravel() in NumPy?flatten() and ravel() in NumPy?flatten() behaviorflatten() always returns a new 1D copy of the array, so changes to the result do not affect the original.ravel() behaviorravel() returns a 1D view if possible, meaning it shares data with the original array and changes affect the original. If a view is not possible, it returns a copy.flatten() returns a copy, ravel() returns a view if possible. -> Option Dflatten() returns a copy, ravel() returns a view if possible. [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions