Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix NDPandasProcessor
  • Loading branch information
kushalkolar committed May 11, 2026
commit 2465a3a323c7ce1a94e39f264b032a965dbba23e
21 changes: 15 additions & 6 deletions fastplotlib/widgets/nd_widget/_nd_positions/_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def data(self, data: pd.DataFrame):
if not isinstance(data, pd.DataFrame):
raise TypeError

self._data= data
self._data = data

@property
def columns(self) -> list[tuple[str, str] | tuple[str, str, str]]:
Expand Down Expand Up @@ -79,14 +79,23 @@ async def get(self, indices: dict[str, Any]) -> dict[str, np.ndarray]:

# assume no additional slider dims
self._dw_slice = self._get_dw_slice(indices)
gdata_shape = len(self.columns), self._dw_slice.stop - self._dw_slice.start, 3

column_stacks = [
np.column_stack(
[self.data[c][self._dw_slice] for c in col]
) for col in self.columns
]
if len(column_stacks) > 0:
n_samples = column_stacks[0].shape[0]
else:
n_samples = 0

gdata_shape = len(self.columns), n_samples, 3

graphic_data = np.zeros(shape=gdata_shape, dtype=np.float32)

for i, col in enumerate(self.columns):
graphic_data[i, :, :len(col)] = np.column_stack(
[self.data[c][self._dw_slice] for c in col]
)
for i, (col, column_stack) in enumerate(zip(self.columns, column_stacks)):
graphic_data[i, :, :len(col)] = column_stack

data = self._finalize(graphic_data)
other = self._get_other_features(data, self._dw_slice)
Expand Down