Note that there are some explanatory texts on larger screens.

plurals
  1. POfeed empty pandas.dataframe with several files
    text
    copied!<p>I would like to feed a empty <code>dataframe</code> appending several files of the same type and structure. However, I can't see what's wrong here: </p> <pre><code>def files2df(colnames, ext): df = DataFrame(columns = colnames) for inf in sorted(glob.glob(ext)): dfin = read_csv(inf, sep='\t', skiprows=1) print(dfin.head(), '\n') df.append(dfin, ignore_index=True) return df </code></pre> <p>The resulting dataframe is empty. Could someone give me a hand?</p> <pre><code> 1.0 16.59 0.597 0.87 1.0.1 3282 100.08 0 0.953 14.52 0.561 0.80 0.99 4355 - 1 1.000 31.59 1.000 0.94 1.00 6322 - 2 1.000 6.09 0.237 0.71 1.00 10568 - 3 1.000 31.29 1.000 0.94 1.00 14363 - 4 1.000 31.59 1.000 0.94 1.00 19797 - 1.0 6.69 0.199 0.74 1.0.1 186 13.16 0 1 0.88 0.020 0.13 0.99 394 - 1 1 0.75 0.017 0.11 0.99 1052 - 2 1 3.34 0.097 0.57 1.00 1178 - 3 1 1.50 0.035 0.26 1.00 1211 - 4 1 20.59 0.940 0.88 1.00 1583 - 1.0 0.12 0.0030 0.04 0.97 2285 2.62 0 1 1.25 0.135 0.18 0.99 2480 - 1 1 0.03 0.001 0.04 0.97 7440 - 2 1 0.12 0.003 0.04 0.97 8199 - 3 1 1.10 0.092 0.16 0.99 11174 - 4 1 0.27 0.007 0.06 0.98 11310 - 0.244 0.07 0.0030 0.02 0.76 41314 1.32 0 0.181 0.64 0.028 0.03 0.36 41755 - 1 0.161 0.18 0.008 0.01 0.45 42420 - 2 0.161 0.18 0.008 0.01 0.45 42461 - 3 0.237 0.25 0.011 0.02 0.56 43060 - 4 0.267 1.03 0.047 0.07 0.46 43321 - 0.163 0.12 0.0060 0.01 0.5 103384 1.27 0 0.243 0.27 0.014 0.02 0.56 104693 - 1 0.215 0.66 0.029 0.04 0.41 105192 - 2 0.190 0.10 0.005 0.01 0.59 105758 - 3 0.161 0.12 0.006 0.01 0.50 109783 - 4 0.144 0.16 0.007 0.01 0.42 110067 - Empty DataFrame Columns: array([D, LOD, r2, CIlow, CIhi, Dist, T-int], dtype=object) Index: array([], dtype=object) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload