I have a csv and trying to have it as a list of list.
operational_band,alternative_band
V490,null
V550,null
V620,null
V670,null
V708,V710
N740,null
N753,N760
N778,N780
N865,N860
I am reading the file as:
df = pd.read_csv("op_bands.csv")
op_list = df.values.tolist()
print(op_list)
I get op_list as:
[['V620', ' "null"'],
['V670', ' "null"'],
['V708', ' "V710"'],
['N740', ' "null"'],
['N753', ' "N760" '],
['N778', ' "N780"'],
['N865', ' "N860"']]
- My 1st and 2nd entry were ignored, why? And how to fix that?
- The 2nd entries from each list have double quotes and space e.g.
' "N860"'. How to ignore these quotes and extra space/s? - My CSV format is right, isn't it?