Skip to content

Describe array of Any by trying to convert? #952

Description

@xgdgsc

Sometimes when we do quick dirty scripts we don' t specify types on Vector initialization. So the output is simple. What if we try to convert Vector of Any to number vector like:

function describeTry(io::IO, a::AbstractArray)
    try
        describe(io, convert(Array{Float64}, a))
    catch e
        println(e)
        println(io, "Summary Stats:")
        println(io, "Length:         $(length(a))")
        println(io, "Type:           $(string(eltype(a)))")
        println(io, "Number Unique:  $(length(unique(a)))")
    end

    return
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions