I'm trying to emulate the bash concept in Python to have data from a CSV as variable-value pairs. I've a CSV file, which can be made anyway as possible (its up to me). Currently it looks like this...
Unit,pixels
AvgVol,87654
AvgLen,5432
and similarly a long list of values. If modifying the CSV will make it work, do suggest that too.
I'm trying to read these in such a way that I can access the values like pixels using Unit or 87654 using AvgVol without having to remember their index, similar to what cat or source would do in bash. Anyways, This is useful so that I can edit my CSV file with the list of variables and their values, without having to worry about their order or anything when referring to a particular variable for its values. I'll later use these for other computations so I can go like
if AvgVol>MaxVol:
print 'something'
Any help is appreciated and I hope its doable without much complexity. Thanks!!