Assuming rates_frame['close'] returns a numpy array, you could use:
data = torch.from_numpy(rates_frame['close'])

and .clone() it if needed.
Besides that I would assume your approach should work.
PS: you can post code snippets by wrapping them into three backticks, which makes debugging easier