I'm currently parsing CSV tables and need to discover the "data types" of the columns. I don't know the exact format of the values. Obviously, everything that the CSV parser outputs is a string. The data types I am currently interested in are:
Dateutil comes to mind for parsing dates.
For integers and floats you could always try a cast in a try/except section
>>> f = "2.5" >>> i = "9" >>> ci = int(i) >>> ci 9 >>> cf = float(f) >>> cf 2.5 >>> g = "dsa" >>> cg = float(g) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: invalid literal for float(): dsa >>> try: ... cg = float(g) ... except: ... print "g is not a float" ... g is not a float >>>