Question: this is for python. i want to be able to print just the first components of each numpy array within the list. like 0.5, 0.8,-4.1,10.7,-2.0
au = 1.49be+11 # in meters masses = [1.0e24, 40.0e24, 50.0e24, 30.0e24, 2.0e24] # in kg positions = [np.array([ 0.5, 2.6, 0.05])*au, np.array([ 0.8, 9.1, 0.10])*au, np.array([-4.1, -2.4, 0.80]) *au, np.array([10.7, 3.7, 0.00]) *au, np.array([-2.0, -1.9, -0.40])*au] 4. In a new code cell, write code to print a nicely formatted table that includes each particle, its mass, and its x, y, z positions. Use a for loop to step through and positions lists to make this table. It should look something like the follow Note that you will need to extract the x and y values from your positions list of numpy arrays. You can either plot point-by-point using a for loop or you can extract the x and y values before plotting using a for loop or list comprehension
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
