Data loader for columnar data


I am using PyTorch for implementing neural net for my columnar (structural) data with mix of categorical and continuous variables. But I am getting TypeError: zip argument #16 must support iteration error while trying to iterate through my dataloader. I have seen below thread but it didn’t help me (as mine is structural data as opposed to images data)

Below is code for creating dataset. I am trying to return a list of df with categorical vars (to be passed into embedding layer) + df with continuous vars and target var.

train_dataset = taxi_dataset_from_df(train_feat, cat_vars, train_target) train_loader =, batch_size=200, shuffle=True) it = iter(train_loader); next(it)[0]

It throws TypeError: zip argument #16 must support iteration error.

I am sorry if this has been discussed before, but I couldn’t find solution on any thread.

thanks in advance :slight_smile:

Solved the issue. self.y[idx] in return of getitem was a dataframe with lists as each element. It doesn’t work. So I split it into 2 columns