<p dir="auto">Working with real world data, it is common to encounter poorly formatted files and such. One thing I find myself frequently doing is something like this in DataFrames:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; int(df[&quot;Age&quot;])
ERROR: ArgumentError(&quot;'F' is not a valid digit (in \&quot;F\&quot;)&quot;)
 in parseint at string.jl:1209
 in int at string.jl:1242
 in map_to2 at abstractarray.jl:1450
 in map at abstractarray.jl:1459
 in int at /Users/viral/.julia/DataFrames/src/dataarray.jl:746"><pre class="notranslate"><code class="notranslate">julia&gt; int(df["Age"])
ERROR: ArgumentError("'F' is not a valid digit (in \"F\")")
 in parseint at string.jl:1209
 in int at string.jl:1242
 in map_to2 at abstractarray.jl:1450
 in map at abstractarray.jl:1459
 in int at /Users/viral/.julia/DataFrames/src/dataarray.jl:746
</code></pre></div>
<p dir="auto">The Age column should been integers, but there is some bad data in the column, as a result of which <code class="notranslate">readtable</code> left the column as a string. When I try to use <code class="notranslate">int</code>, it is obvious that the data is corrupt, but I have no idea where it is corrupt.</p>
<p dir="auto">I often find myself doing something like:</p>
<p dir="auto"><code class="notranslate">[ try int(df["Age"][i]) catch end for i in 1:nrow(df) ]</code></p>
<p dir="auto">I think that an <code class="notranslate">isconvertible</code> function would be generally useful, which takes the same arguments as <code class="notranslate">convert</code>, but returns a boolean based on whether the conversion is possible or not.</p>
<p dir="auto">I've tried to run Julia (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/JuliaLang/julia/commit/d4b825a5e6220f54569d633d6badd86b2e8a00d3/hovercard" href="https://github.com/JuliaLang/julia/commit/d4b825a5e6220f54569d633d6badd86b2e8a00d3"><tt>d4b825a</tt></a>) tests and it failed on linalg. The problem is in <code class="notranslate">@test_approx_eq</code> macro since epsilon is too small in this case.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; include(&quot;runtests.jl&quot;)
     * core
     * keywordargs
     * numbers
     * strings
     * unicode
     * collections
     * hashing
     * remote
     * iobuffer
     * arrayops
     * linalg
exception on 1: ERROR: assertion failed: |:(\(W,v)) - iFv| &lt;= 7.105427357601002e-10
  :(\(W,v)) = -105.1618383308551
30.132386546280248
103.10478249210304
85.5026629379321
42.8100069344292

  iFv = -105.16183834007155
30.132386548803957
103.10478250114792
85.50266294548928
42.81000693815962

  difference = 9.21644982554426e-9 &gt; 7.105427357601002e-10
 in error at error.jl:22
 in test_approx_eq at test.jl:68
 in anonymous at no file:459
 in runtests at /home/magistere/projects/git/julia/test/testdefs.jl:5
 in anonymous at multi.jl:613
 in run_work_thunk at multi.jl:575
 in remotecall_fetch at multi.jl:647
 in remotecall_fetch at multi.jl:662
 in anonymous at multi.jl:1382
while loading linalg.jl, in expression starting on line 384
ERROR: assertion failed: |:(\(W,v)) - iFv| &lt;= 7.105427357601002e-10
  :(\(W,v)) = -105.1618383308551
30.132386546280248
103.10478249210304
85.5026629379321
42.8100069344292

  iFv = -105.16183834007155
30.132386548803957
103.10478250114792
85.50266294548928
42.81000693815962

  difference = 9.21644982554426e-9 &gt; 7.105427357601002e-10
 in error at error.jl:22
 in test_approx_eq at test.jl:68
 in anonymous at no file:459
 in runtests at /home/magistere/projects/git/julia/test/testdefs.jl:5
 in anonymous at multi.jl:613
 in run_work_thunk at multi.jl:575
 in remotecall_fetch at multi.jl:647
 in remotecall_fetch at multi.jl:662
 in anonymous at multi.jl:1382
while loading linalg.jl, in expression starting on line 384
while loading /home/magistere/projects/git/julia/test/runtests.jl, in expression starting on line 22"><pre class="notranslate"><code class="notranslate">julia&gt; include("runtests.jl")
     * core
     * keywordargs
     * numbers
     * strings
     * unicode
     * collections
     * hashing
     * remote
     * iobuffer
     * arrayops
     * linalg
exception on 1: ERROR: assertion failed: |:(\(W,v)) - iFv| &lt;= 7.105427357601002e-10
  :(\(W,v)) = -105.1618383308551
30.132386546280248
103.10478249210304
85.5026629379321
42.8100069344292

  iFv = -105.16183834007155
30.132386548803957
103.10478250114792
85.50266294548928
42.81000693815962

  difference = 9.21644982554426e-9 &gt; 7.105427357601002e-10
 in error at error.jl:22
 in test_approx_eq at test.jl:68
 in anonymous at no file:459
 in runtests at /home/magistere/projects/git/julia/test/testdefs.jl:5
 in anonymous at multi.jl:613
 in run_work_thunk at multi.jl:575
 in remotecall_fetch at multi.jl:647
 in remotecall_fetch at multi.jl:662
 in anonymous at multi.jl:1382
while loading linalg.jl, in expression starting on line 384
ERROR: assertion failed: |:(\(W,v)) - iFv| &lt;= 7.105427357601002e-10
  :(\(W,v)) = -105.1618383308551
30.132386546280248
103.10478249210304
85.5026629379321
42.8100069344292

  iFv = -105.16183834007155
30.132386548803957
103.10478250114792
85.50266294548928
42.81000693815962

  difference = 9.21644982554426e-9 &gt; 7.105427357601002e-10
 in error at error.jl:22
 in test_approx_eq at test.jl:68
 in anonymous at no file:459
 in runtests at /home/magistere/projects/git/julia/test/testdefs.jl:5
 in anonymous at multi.jl:613
 in run_work_thunk at multi.jl:575
 in remotecall_fetch at multi.jl:647
 in remotecall_fetch at multi.jl:662
 in anonymous at multi.jl:1382
while loading linalg.jl, in expression starting on line 384
while loading /home/magistere/projects/git/julia/test/runtests.jl, in expression starting on line 22
</code></pre></div>