# CSV.read() faults on exponentially notated integers

**URL:** https://discourse.julialang.org/t/csv-read-faults-on-exponentially-notated-integers/7936
**Category:** General Usage
**Created:** [December 23, 2017, 2:15am UTC](https://discourse.julialang.org/t/csv-read-faults-on-exponentially-notated-integers/7936 "2017-12-23T02:15:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![r-handsfield](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@r-handsfield](https://discourse.julialang.org/u/r-handsfield)
#### Post date: [December 23, 2017, 2:15am UTC](https://discourse.julialang.org/t/csv-read-faults-on-exponentially-notated-integers/7936/1 "2017-12-23T02:15:18Z")

</div>

Trying to read the Credit Card Fraud [data set](https://www.kaggle.com/dalpozz/creditcardfraud/data) on Kaggle. The first column represents times of transactions counted in milliseconds, which Julia interprets as `Int64`. This is fine until it encounters `1e+05` in line 153759, which gets parsed as `Float64` and causes an error.

Is there a kwarg to handle this, or a workaround _other than_ specifying a vector of types for all columns?

`julia> CSV.read("creditcard.csv")`  
`ERROR: CSV.ParsingException("error parsing a Int64 value on column 1, row 153759; encountered 'e'")`

---

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [December 23, 2017, 5:49am UTC](https://discourse.julialang.org/t/csv-read-faults-on-exponentially-notated-integers/7936/2 "2017-12-23T05:49:06Z")

</div>

[CSVFiles.jl](https://github.com/davidanthoff/CSVFiles.jl) reads the file successfully with the following code:

```julia
using FileIO, CSVFiles, DataFrames

df = load("creditcard.csv") |> DataFrame

```

The `Time` column ends up with element type `Float64`, but you can then obviously easily change that.

I would have thought that `load("creditcard.csv", colparsers=Dict(:Time=>Int))` would force the `Time` column to be of type `Int`, but that doesn’t seem to work. I’ve opened an [issue](https://github.com/JuliaComputing/TextParse.jl/issues/37) in the underlying parser repo, lets see what @shashi thinks of this.

---

<div class="post-metadata">

### Author: ![r-handsfield](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@r-handsfield](https://discourse.julialang.org/u/r-handsfield)
#### Post date: [December 28, 2017, 2:16am UTC](https://discourse.julialang.org/t/csv-read-faults-on-exponentially-notated-integers/7936/3 "2017-12-28T02:16:46Z")

</div>

@davidanthoff

Thanks for the reply; all great solutions.

The most expedient temporary solution turned out to be:

```julia
using CSV
df = CSV.read("creditcard.csv"; types=Dict(:Time=>Float64))

```
