DataFrames.jl

Tools for working with data in Julia

Table of Contents
Why Use the DataFrames Package?
Getting Started
I/O - Reading and Writing Data
Subsets of DataFrames
Database-Style Joins and Indexing
Split-Apply-Combine Operations
Reshaping and Pivoting
Streaming Data Analysis
The Formula, ModelFrame and ModelMatrix Types
Representing Factors using the PooledDataArray Type

View the Project on GitHub juliastats/DataFrames.jl

DataFrames I/O

Importing data from tabular data files

To read data from a CSV-like file, use the readtable function:

df = readtable("data.csv")

df = readtable("data.tsv")

df = readtable("data.wsv")

df = readtable("data.txt", separator = '\t')

df = readtable("data.txt", header = false)

readtable requires that you specify the path of the file that you would like to read as a String. It supports many additional keyword arguments: these are documented in the section on advanced I/O operations.

Exporting data to a tabular data file

To write data to a CSV file, use the writetable function:

df = DataFrame(A = 1:10)

writetable("output.csv", df)

writetable("output.dat", df, separator = ',', header = false)

writetable("output.dat", df, quotemark = '\'', separator = ',')

writetable("output.dat", df, header = false)

writetable requires the following arguments:

Additional advanced options are documented below.

Advanced Options for Reading CSV Files

readtable accepts the following optional keyword arguments:

Advanced Options for Writing CSV Files

writetable accepts the following optional keyword arguments: