def read_gdf(fname):
gdf_file = open(fname, '<STR_LIT:r>')<EOL>gdf = []<EOL>for l in gdf_file:<EOL><INDENT>data = l.split()<EOL>gdf += [data]<EOL><DEDENT>gdf = np.array(gdf, dtype=object)<EOL>if gdf.size > <NUM_LIT:0>:<EOL><INDENT>gdf[:, <NUM_LIT:0>] = gdf[:, <NUM_LIT:0>].astype(int)<EOL>gdf[:, <NUM_LIT:1>:] = gdf[:, <NUM_LIT:1>:].astype(float)<EOL><DEDENT>return np.array(gdf)<EOL>
Fast line-by-line gdf-file reader.


Parameters
----------
fname : str 
    Path to gdf-file.


Returns
-------
numpy.ndarray
    ([gid, val0, val1, **]), dtype=object) mixed datatype array