I like to put some values from a csv file into a dict. An example is:
TYPE, Weldline
Diam, 5.0
Num of Elems, 4
and I end up after reading into a dictionary (for later use in an API) in:
{'TYPE':'Weldline' , 'Diam':'5.0','Num of Elems':'4'}
Since the API expects a dictionary i provided all the necessary keywords like 'TYPE', 'Diam', ... according to the API doc.
The problem I have is, that the API expects a float for Diam
and an integer for Num of Elems
Since I have a large number of entries: is there an simple automatic way for string conversion into float or int? Or do I have to write something on my own?