I need to feed to pandas read_csv the output of one command I execute with Popen.
p = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
pandas.read_csv(stdout,index_col=0)
But obviously stdout is a string and it's interpreted as a path. In the API documentation it says that "any object with a read() method (such as a file handle or StringIO)" can be an input to the read_csv function. How can I get such an object out of the Popen commmand? The final objective is to not write to disk.
Also when I write to disk the contents of stdout I can see that the csv has double quotes for each line
alvarobrandon$ head csvfile.csv
"1507109453,<,java,12447,a3e9c495869d,docker,9.0.4.130,9.0.2.131,9.0.2.131,9.0.4.130,56182,9092,9092,56182,tcp"
"1507109453,<,java,1244,a3e9c495869d,docker,9.0.4.130,9.0.2.131,9.0.2.131,9.0.4.130,56182,9092,9092,56182,tcp"
"1507109453,<,java,12447,a3e9c495869d,docker,9.0.4.130,9.0.2.131,9.0.2.131,9.0.4.130,56182,9092,9092,56182,tcp"