I have a csv file like:
"B/G/213","B/C/208","WW_cis",,
"B/U/215","B/A/206","WW_cis",,
"B/C/214","B/G/207","WW_cis",,
"B/G/217","B/C/204","WW_cis",,
"B/A/216","B/U/205","WW_cis",,
"B/C/219","B/G/202","WW_cis",,
"B/U/218","B/A/203","WW_cis",,
"B/G/201","B/C/220","WW_cis",,
"B/A/203","B/U/218","WW_cis",,
and I want to read it into something like an array or dataframe, so that I would be able to compare elements from one column to selected elements from another columns. At first, I have read it straight into an array using numpy.genfromtxt, but I got stings like '"B/A/203"' with extra quotes " everywhere. I read somewhere, that pandas allows to strip strings of extra " so I tried:
class StructureReader(object):
def __init__(self, filename):
self.filename=filename
def read(self):
self.data=pd.read_csv(StringIO(str("RNA/"+self.filename)), header=None, sep = ",")
self.data
but I get something like so:
<class 'pandas.core.frame.DataFrame'> 0
0 RNA/4v6p.csv
How can I get my CSV file into some kind of a data type that would allow me to search through columns and rows?