GithubHelp home page GithubHelp logo

data_utilities's Introduction

data_utilities

A (small) collection of data utilities.

melt.py

Python script that reads a csv and melts by column. Outputs to stdout.

dependencies

usage

test.csv

fips,town,2013,2014
1,boston,1,2
2,cambridge,5,7

cat test.csv | python melt.py --ids fips town

output

fips,town,variable,value
1,boston,2013,1
2,cambridge,2013,5
1,boston,2014,2
2,cambridge,2014,7

parse_date_to_unix

Python script that reads a csv and parses date to column to unix. Outputs to stdout.

dependencies

usage

test.csv

name,birthday
jane dae,01-01-2014
john doe,12-31-2014

cat test.csv | python parse_date_to_unix.py --column birthday --format "%m-%d-%Y"

output

name,birthday
jane dae,1388534400
john doe,1419984000

drop_duplicates

Python script that reads a csv, drops duplicates based on a column. Takes the last duplicate row. Outputs to stdout.

dependencies

usage

test.csv

name,twitter
john doe,@jooohndoe
john doe,@johndoe
jane dae,@janedae

cat test.csv | python drop_duplicates.py --column name

output

name,twitter
john doe,@johndoe
jane dae,@janedae

License

MIT © The Boston Globe

data_utilities's People

Contributors

gabrielflorit avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.