I would like to create 3-dimensional array including coordinates of the points in cartesian axis system. My user input is the following:
import pandas as pd
import numpy as np
rows = int(input("Please Enter the Total Number of Rows : "))
columns = int(input("Please Enter the Total Number of Columns : "))
levels = int(input("Please Enter the Total Number of Levels : "))
dx = int(input("Please Enter the Pitch in x Direction : "))
dy = int(input("Please Enter the Pitch in y Direction : "))
dz = int(input("Please Enter the Pitch in z Direction : "))
x0 = int(input("Please Enter the Origin Coordinate in x Direction : "))
y0 = int(input("Please Enter the Origin Coordinate in y Direction : "))
z0 = int(input("Please Enter the Origin Coordinate in z Direction : "))
I want to start at point with coordinates [x0,y0,z0] and then create the 3D array based on the inserted number of rows,columns, levels (3rd dimension) and spacing between the points (dx,dy,dz)
I am think about the loop
Data=np.zeros(('rows','columns','levels'))
for i in range(rows):
for j in range(columns):
for k in range(levels):
but no idea how to write this code. Can anyone help? Output should be in form of 3D Array.
Many Thanks Lukas