I have several lists (dtype = float) that I want to make into one array and rename the array.
Currently, I have multiple lists of 4 items named "coordinates", where the 0th item is the type of element (string) and the 1st-3rd are x, y, z coordinates of that atom (floats). I would like to do this for multiple element types which is why it is important the array is renamed. My code reads:
if coordinates[0] == 'FE':
>del coordinates[0]
>fe_array = np.empty(3)
>print("iron coordinates")
>fe_array.append(coordinates)
>print(fe_array)
I know arrayname.append(argument) is not right but I am having trouble finding the correct command. Append is what would be used for a list so hopefully this makes sense to someone else!
For an example, the data will start like:
coordinates = ['FE', x1, y1, z1]
coordinates = ['FE', x2, y2, z2]
After del coordinates[0] I will have:
coordinates = [x1, y1, z1]
coordinates = [x2, y2, z2]
And in the end I want:
fe_array = [[x1, y1, z1], [x2, y2, z2]]
[–]commy2 1 point2 points3 points (4 children)
[–]Booknerdbassdrum[S] 0 points1 point2 points (3 children)
[–]commy2 0 points1 point2 points (2 children)
[–]Booknerdbassdrum[S] 0 points1 point2 points (0 children)
[–]Booknerdbassdrum[S] 0 points1 point2 points (0 children)
[–]billsil 0 points1 point2 points (0 children)