julia> using DataFrames, CSV, Chain;
julia> t = """
a, b
"a1", "b1"
, "b2"
""";
julia> @chain t begin
IOBuffer
CSV.read(DataFrame)
end
2ร2 DataFrame
Row โ a b
โ String3? String3
โโโโโโผโโโโโโโโโโโโโโโโโโโ
1 โ a1 b1
2 โ missing b2
Thereโs something funky going on on row 121 of the file:
julia> using CSV, DataFrames, Downloads
julia> CSV.read(Downloads.download("https://www-nds.iaea.org/nuclearmoments/magn_mom_recomm.csv"), DataFrame; limit = 120)
120ร12 DataFrame
Row โ z n.n+n.z symbol energy [keV] halflife spin magnetic dipole [nm] method description nsr journal indc
โ Int64 Int64 String3 Int64 String15 String7 String31 String15 String String31 String String15
โโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1 โ 0 1 NN 0 10.2 m 1/2+ -1.9130427(5) R Re-evaluated by N.J. Stone (2013โฆ 2014Ol01 Chin. Phys. C38 090001 (2014) indc-nds-0794
2 โ 1 1 H 0 stable 1/2+ +2.792847351(9) R Re-evaluated by N.J. Stone (2013โฆ 2014Ol01 Chin. Phys. C38 090001 (2014) indc-nds-0794
Opening the plain text file it looks like the next row has a value of "PRL 96 in the journal column, so maybe thatโs the culprit that throws parsing off?
Ok. Yesterday in the evening I was trying to load the file as CSV.File("magn_mom_recomm.csv")|>DataFrame and it gave me the cryptic errors I described.
Now, I have tried to do load("magn_mom_recomm.csv")|>DataFrame, and I see the error is about the row 121 indeed. It looks like an extra double quotes, which throws parsing off the course.