Giter VIP home page Giter VIP logo

ipython-csvmagic's Introduction

ipython-csvmagic

Tools for working with CSV files in IPython.

To install, in iPython shell:

%install_ext https://raw.githubusercontent.com/FrankSalad/ipython-csvmagic/master/csvtools.py
%load_ext csvtools

###Importing Data: a.csv

"n","order_number","name"
"0","389","John Snow"
"1","405","Princess Bubblegum"

iPython:

In [7]: %loadcsv a.csv
Loaded 2 values in n,order_number,name

In [8]: n
Out[8]: ['0', '1']
In [9]: order_number
Out[9]: ['389', '405']
In [10]: name
Out[10]: ['John Snow', 'Princess Bubblegum']

Also supports prefixing headers:

In [13]: %loadcsv a.csv col_
Loaded 2 values in col_n,col_order_number,col_name

In [14]: col_n
Out[14]: ['0', '1']

In [15]: col_order_number
Out[15]: ['389', '405']

In [16]: col_name
Out[16]: ['John Snow', 'Princess Bubblegum']

###Exporting Data:

In [23]: title = ['The Origin of Species', 'Oryx and Crake', 'Fahrenheit 451']

In [24]: name = ['Charles Darwin', 'Margaret Atwood', 'Ray Bradbury']

In [25]: n = range(len(title))

In [26]: %storecsv b.csv n name title
$ cat b.csv 
"n","name","title"
"0","Charles Darwin","The Origin of Species"
"1","Margaret Atwood","Oryx and Crake"
"2","Ray Bradbury","Fahrenheit 451"

ipython-csvmagic's People

Contributors

franksalad avatar francisco-ginger avatar

Watchers

Subhash Ramesh 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.