Save 37% off PRO during our Black Friday Sale! »

Pandas Loves Ponies

4550dc81109cd4a3f46e15eef96b1811?s=47 lexual
July 05, 2013

Pandas Loves Ponies

Pandas do love ponies.
Talk about getting Django & Pandas code working together.

4550dc81109cd4a3f46e15eef96b1811?s=128

lexual

July 05, 2013
Tweet

Transcript

  1. PANDAS LOVES PONIES Lex Hider @LexualChocolate github.com/lexual

  2. DJANGO PONY

  3. PANDAS

  4. PANDAS • Like R, but better • DataFrame • In

    Memory SQL • Awesome Builds On Numpy/ Scipy Stack
  5. PANDAS LOVES PONIES

  6. None
  7. import pandas as pd Like: • R frame • In

    memory SQL • Excel spreadsheet Does: • SQL like JOINs in memory • groupby • pivot tables • plotting • reads csvs, excel, SQL
  8. FROM CSV df = pd.read_csv('foo.csv')

  9. None
  10. FROM SQL

  11. WHAT ABOUT DJANGO ???

  12. FROM DJANGO

  13. TO HTML df.to_html() HTML table outputted. {{ df.to_html }}

  14. TO CSV df.to_csv('/tmp/foobar.csv')

  15. TO DJANGO github.com/lexual/pandas-love-ponies • 1st Released 2013-02-14 • Valentine's Day

    ;)
  16. github.com/lexual/pandas-love-ponies import pandas_love_ponies as plp # monkey patch. pd.DataFrame.to_django =

    plp.to_django df = pd.DataFrame(some_data) df.to_django(MyDjModel) # OR plp.to_django(df, MyDjModel)
  17. github.com/lexual/pandas-love-ponies from myapp.models import Sale df = pd.read_csv('sales.csv') df.to_django(Sale) #

    OR plp.to_django(df, Sale)
  18. FROM GOOGLE ANALYTICS (GA)

  19. 2 LINES FROM WEB SERVICE TO DB

  20. FROM ADOBE MARKETING CLOUD • Adobe's "GA" product. • aka

    SiteCatalyst or Omniture • github.com/lexual/sitecat-py Similar to read_ga() read_sc()
  21. None
  22. SECURITY IS OVERRATED ;) COME SEE MY SALT TALK TOMORROW

    MORNING (There will be jokes)
  23. linkd.in/12Kgg5K WE'RE HIRING! • Django/Python Developer • Melbourne Work with

    some cool tech: • Salt • Riak (no-SQL db) • Pandas/Numpy/Scipy • git • AWS
  24. THE END