We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
simple function to use
using DelimitedFiles, DataFrames function parse_moodys(fn; nomissing::Bool=true) inputarr = readdlm(fn) N,K = size(inputarr) permnos = Int.(inputarr[:,1]) firstyear = Int.(inputarr[:,2]) lastyear = Int.(inputarr[:,3]) y1 = minimum(firstyear) y2 = y1 + K - 4 yrs = y1:y2 dfvec = Vector{DataFrame}(undef,N) for i in 1:N p = convert(Int,inputarr[i,1]) vals = vec(inputarr[i,4:end]) if nomissing vals = replace(vals, -99.99 => missing, -99.999 => missing) end dfvec_i = DataFrame(PERMNO=p,YEAR=yrs,MOODYSBE=vals) nomissing && dropmissing!(dfvec_i) dfvec[i] = dfvec_i end return vcat(dfvec...) end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
simple function to use
The text was updated successfully, but these errors were encountered: