0

My data is in csv format with columns as i (0 to 149) [which is x direction), j (0 to 149) [which is y direction), k (5 to 50) [which is depth direction], and value (continuous values between 4000 to 6000) and rows from 0 to 1,012.500 [150*150*(50-5)].

The i-col starts from 0 to 149, while j-col and k-col remain at their initial position. When the i-col reached 149, it is now j-col to start going to its next number (2), while k-col still at its initial position (5) and i-col starts its loops again from 0 to 149 (attached snapshot).

In the second snapshot, you can see that in the desired visualization that I am looking for. In this, the i spans every grid cell from 1 to 150 in the i direction, the j spans 1 to 150 for every grid cell in the y direction, and the z spans the layer of the structure from 5 to 50.

I have tried matplotlib and other existing packages to plot my data but they are not the best when it comes to interactive 3D data visualization (including cross section) of especially large data. Does anyone have used a better package to visualize numeric data? Perhaps similar to the healthcare for visualizing CT scans where I can visualize by slicing through each i [1 to 150] values and j [1 to 150] layer or each i [1 to 150] values and k [5 to 50] layer or each k layer for example from top view.

import numpy as np
import pandas as pd

#---------
#i_col

x = np.arange(1, 151, 1)
i_col = np.tile(x, 150 * 45)

#---------

#j_col

y = np.arange(1, 151, 1)
j_col_1 = np.repeat(y, 150)
j_col = np.repeat(j_col_1, 45)

#---------

#k_col
z = np.arange(5, 50, 1)
z_1 = np.repeat(z, 150)
k_col = np.repeat(z_1, 150)

#---------

#actual_values [forth_column]

actual_values = np.random.randint(low=4000, high = 6000, size = (1012500))


df_i = pd.DataFrame(i_col)
df_j = pd.DataFrame(j_col)
df_k = pd.DataFrame(k_col)
df_actual_values = pd.DataFrame(actual_values)
my_df = pd.concat([df_i, df_j, df_k, df_actual_values], axis=1)
my_df.columns =['i', 'j', 'k', 'actual_values']

enter image description here enter image description here

Stuart Berg
  • 17,026
  • 12
  • 67
  • 99
Bluee Skyy
  • 43
  • 4
  • Your test data occupies only a single diagonal slice of a 3D space. Is that correct? If so, can you just flatten it to a 2D slice (say, by eliminating the `k` dimension) and then visualize it as an ordinary image? That seems like the most straightforward approach. – Stuart Berg Oct 11 '22 at 13:35

0 Answers0