Giter Club home page Giter Club logo

iterabletables.jl's Introduction

IterableTables

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Build Status Build status Query Query codecov.io

Overview

Iterable tables is a generic interface for tabular data.

A large number of packages are compatible with this interface. The following packages can act as a source iterable table:

The following data sinks are currently supported:

The package is tightly integrated with Query.jl: Any query that creates a named tuple in the last @select statement (and doesn't @collect the results into a data structure) is automatically an iterable table data source, and any of the data sources mentioned above can be queried using Query.jl.

Installation

This package only works on julia 0.5 and newer. You can add it with:

Pkg.add("IterableTables")

Getting started

IterableTables makes it easy to conver between different table types in julia. It also makes it possible to use any table type in situations where packages traditionally expected a DataFrame.

For example, if you have a DataFrame

using DataFrames

df = DataFrame(Name=["John", "Sally", "Jim"], Age=[34.,25.,67.], Children=[2,0,3], Income = [120_000, 20_000, 60_000])

you can easily convert this into any of the supported data sink types by simply constructing a new table type and passing your source df:

using DataTables, TypedTables, IterableTables

# Convert to a DataTable
dt = DataTable(df)

# Convert to a TypedTable
tt = Table(df)

These conversions work in pretty much any direction. For example you can convert a TypedTable into a DataFrame:

new_df = DataFrame(tt)

Or you can convert it to a DataTable:

new_dt = DataTable(tt)

The general rule is that you can convert any sink into any source.

IterableTables also adds methods to a number of packages that have traditionally only worked with DataFrames that make these packages work with any data source type defined in IterableTables.

For example, you can run a regression on any of the source types:

using GLM, DataFrames

# Run a regression on a TypedTable
lm(@formula(Children~Age),tt)

# Run a regression on a DataTable
lm(@formula(Children~Age),dt)

Or you can plot any of these data sources with Gadfly:

using Gadfly

# Plot a TypedTable
plot(tt, x=:Age, y=:Children, Geom.line)

Or with StatPlots:

using StatPlots

# Plot a DataTable
@df dt plot(:Age, :Children)

@df dt scatter(:Age, :Children, markersize = sqrt.(:Income ./ 1000))

Again, this will work with any of the data sources listed above.

iterabletables.jl's People

Contributors

davidanthoff avatar mkborregaard avatar staticfloat avatar tkelman avatar

Watchers

Morten Piibeleht avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.