Converting a column from a Pandas dataset to Tensor; get a KeyError Exception

I read data into a Pandas dataset, which I split into 3 via a utility function I wrote.
I want to extract a column (name of Close) from the dataset and convert it into a Tensor.

path = os.path.join(self.config.data_dir, self.config.company_file)
        data = pd.read_csv(path)
        train_data, val_data, test_data = utilz.split_into_train_val_test(data, 0.7, 0.15, 0.15)
        train_data = T.tensor(train_data["Close"])

When I run the code I get a “Exception has occurred: KeyError 1”
The column with the name “Close” does exist.
How do I fix this?

The error is most likely raised by the indexing with "Close" so I don’t think it exists.
Could you print the type of it without using any PyTorch methods?

data = pd.read_csv(path)
train_data, val_data, test_data = utilz.split_into_train_val_test(data, 0.7, 0.15, 0.15)
print(type(train_data["Close"]))