Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading ddmmyyy date format fails #112

Open
xiaodaigh opened this issue Jan 31, 2019 · 2 comments
Open

Reading ddmmyyy date format fails #112

xiaodaigh opened this issue Jan 31, 2019 · 2 comments

Comments

@xiaodaigh
Copy link

I can't read dd/mm/yyy date formats in CSV. Here is my csv fiel

31/12/2018,-80
31/12/2018,10528.13
27/12/2018,2269.69
25/12/2018,-19.95
21/12/2018,-1.25
21/12/2018,-41.81
20/12/2018,-8.69
18/12/2018,-509.75
18/12/2018,-10000
18/12/2018,6022.5
18/12/2018,-19.95
16/12/2018,-110.48
14/12/2018,-1162
11/12/2018,17543.96
11/12/2018,-0.58
11/12/2018,-19.46
10/12/2018,-124.98
7/12/2018,-5.2
6/12/2018,-38.4
6/12/2018,-8.69
5/12/2018,-82.07
5/12/2018,-47.33
4/12/2018,-20.24
4/12/2018,-3.63
4/12/2018,-121.16
4/12/2018,-6.29
1/12/2018,-10
1/12/2018,-658.33
1/12/2018,-1425
1/12/2018,-10190
1/12/2018,-8.3
1/12/2018,-24.99
30/11/2018,-1162
30/11/2018,16.99
29/11/2018,1280.94
29/11/2018,-16.8
27/11/2018,-80
27/11/2018,-9.5
22/11/2018,-40.85
22/11/2018,-16.99
21/11/2018,7528.13
21/11/2018,-23398
21/11/2018,8000
21/11/2018,7000
21/11/2018,-440
21/11/2018,-59
21/11/2018,-1.24
21/11/2018,-41.32
20/11/2018,-108.9
17/11/2018,-0.42
17/11/2018,-13.92
16/11/2018,-1162
16/11/2018,-186.43
15/11/2018,-40.85
14/11/2018,-19525.55
14/11/2018,27528.13
14/11/2018,-476.76
13/11/2018,-0.58
13/11/2018,-19.32
12/11/2018,-825
11/11/2018,-18000
11/11/2018,-479
10/11/2018,22592.83
9/11/2018,-124.98
8/11/2018,-65.85
6/11/2018,-3.87
6/11/2018,-128.88
6/11/2018,-6.48
6/11/2018,-49.31
3/11/2018,-35
3/11/2018,-105
2/11/2018,-1162
1/11/2018,-50
1/11/2018,-658.33
1/11/2018,-1425
1/11/2018,-10190
1/11/2018,-10
31/10/2018,-22.15
31/10/2018,-24.99
29/10/2018,-4200
29/10/2018,11078.76
27/10/2018,-400
26/10/2018,-78.95
26/10/2018,-821.07
26/10/2018,-170.56
25/10/2018,-80
25/10/2018,-37.9
23/10/2018,-1.27
23/10/2018,-42.21
19/10/2018,-1162
16/10/2018,-104.76
11/10/2018,-44.85
9/10/2018,-124.98
6/10/2018,-48.18
5/10/2018,-1162
5/10/2018,-0.59
5/10/2018,-19.55
5/10/2018,-6.4
4/10/2018,-150
4/10/2018,-3.68
4/10/2018,-122.52
3/10/2018,-273.9
2/10/2018,14524.68
2/10/2018,-24.99
1/10/2018,-658.33
1/10/2018,-1425
1/10/2018,-10190
1/10/2018,-10

When I read it on my Australian PC it says

ArgumentError: Month: 31 out of range (1:12)
Dates.Date(::Int64, ::Int64, ::Int64) at types.jl:207
tryparsenext(::TextParse.DateTimeToken{Dates.Date,Dates.DateFormat{Symbol("mm/dd/yyyy"),Tuple{Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'y'}}}}, ::TextParse.VectorBackedUTF8String, ::Int64, ::Int64, ::TextParse.LocalOpts{UInt8,UInt8,UInt8}) at field.jl:511
macro expansion at util.jl:27 [inlined]
tryparsenext(::TextParse.Field{Dates.Date,TextParse.DateTimeToken{Dates.Date,Dates.DateFormat{Symbol("mm/dd/yyyy"),Tuple{Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'y'}}}}}, ::TextParse.VectorBackedUTF8String, ::Int64, ::Int64, ::TextParse.LocalOpts{UInt8,UInt8,UInt8}) at utf8optimizations.jl:204
parsefill!(::TextParse.VectorBackedUTF8String, ::TextParse.LocalOpts{UInt8,UInt8,UInt8}, ::TextParse.Record{Tuple{TextParse.Field{Dates.Date,TextParse.DateTimeToken{Dates.Date,Dates.DateFormat{Symbol("mm/dd/yyyy"),Tuple{Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'y'}}}}},TextParse.Field{Float64,TextParse.Numeric{Float64}}},Tuple{Dates.Date,Float64}}, ::Int64, ::Tuple{Array{Dates.Date,1},Array{Float64,1}}, ::OrderedCollections.OrderedDict{Union{Int64, String},AbstractArray{T,1} where T}, ::Int64, ::Int64, ::Int64, ::Int64) at util.jl:27

which seems to suggest that it wants to read it as mm/dd/yyyy

This is a download from a major Australia bank. So pretty common format in Aus and NZ I assume.

@shashi
Copy link
Collaborator

shashi commented Jan 31, 2019

try colparsers=Dict(1=>dateformat"dd/mm/yyyy") keyword argument

@xiaodaigh
Copy link
Author

Ok. But is it possible for it to automatically detect it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants