I'm accessing a remote machine via SSH (Putty). A dataset is stored in a directory on that machine, which I need to read with pandas in Python on my local computer. I am trying to use dataframe=pandas.read_hdf(path, key="data") but I don't know which path to specify which would direct towards the dataset stored on the remote machine in my local Python code since it's not stored locally. As I mentioned I am accessing the dataset using Putty. What should the path look like? I tried replacing C: with the host name followed by the path which I use in Putty to access the file.

Thanks in advance.

1 Answers

0
azertguigui On

I don't know what you mean precisely by read, but you can display the dataframe with the following:

  1. SSH to your remote server
  2. Navigate to the directory your dataframe is stored in: cd /directory/of/dataframe
  3. Launch a Python or iPython interpreter: python or ipython
  4. Execute those python commands:
>>> import pandas as pd
>>> dataframe=pandas.read_hdf("hdf_file.h5", key="data")
# This should work because `hdf_file.h5 is 
# in the directory you launched the python command
  1. Print your dataframe: print(dataframe)