Internals

Internal API

The functions, methods and types listed on this page are internal to DataFrames and are not considered to be part of the public API.

DataFrames.gennamesFunction
gennames(n::Integer)

Generate standardized names for columns of a DataFrame. The first name will be :x1, the second :x2, etc.

source
DataFrames.getmaxwidthsFunction
DataFrames.getmaxwidths(df::AbstractDataFrame,
                        io::IO,
                        rowindices1::AbstractVector{Int},
                        rowindices2::AbstractVector{Int},
                        rowlabel::Symbol,
                        rowid::Union{Integer, Nothing},
                        show_eltype::Bool,
                        buffer::IOBuffer)

Calculate, for each column of an AbstractDataFrame, the maximum string width used to render the name of that column, its type, and the longest entry in that column – among the rows of the data frame will be rendered to IO. The widths for all columns are returned as a vector.

Return a Vector{Int} giving the maximum string widths required to render each column, including that column's name and type.

NOTE: The last entry of the result vector is the string width of the implicit row ID column contained in every AbstractDataFrame.

Arguments

  • df::AbstractDataFrame: The data frame whose columns will be printed.
  • io::IO: The IO to which df is to be printed
  • `rowindices1::AbstractVector{Int}: A set of indices of the first chunk of the AbstractDataFrame that would be rendered to IO.
  • `rowindices2::AbstractVector{Int}: A set of indices of the second chunk of the AbstractDataFrame that would be rendered to IO. Can be empty if the AbstractDataFrame would be printed without any ellipses.
  • rowlabel::AbstractString: The label that will be used when rendered the numeric ID's of each row. Typically, this will be set to "Row".
  • rowid: Used to handle showing DataFrameRow.
  • show_eltype: Whether to print the column type under the column name in the heading.
  • buffer: buffer passed around to avoid reallocations in ourstrwidth

```

source
DataFrames.ourshowFunction
DataFrames.ourshow(io::IO, x::Any, truncstring::Int)

Render a value to an IO object compactly using print. truncstring indicates the approximate number of text characters width to truncate the output (if it is a non-positive value then no truncation is applied).

source
DataFrames.ourstrwidthFunction
DataFrames.ourstrwidth(io::IO, x::Any, buffer::IOBuffer, truncstring::Int)

Determine the number of characters that would be used to print a value.

source