Numpy, the Python foundation for number crunching

1,076 views
873 views

Published on

Talk by Didrik Pinte, MD at Enthought at Data Science London meetup 18/10/12

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,076
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Numpy, the Python foundation for number crunching

  1. 1. Numpy, the Python foundation for number crunching Didrik Pinte, Enthought London Data Science meetupMonday 22 October 2012
  2. 2. Number crunching? •High-level api •Interactivity & visualization •Performance •Low-level accessMonday 22 October 2012
  3. 3. Evidence ? Clyther PyOpenGL PyCuda PyAlgoTrade PyTrilinos Joblib numpy-boost petsc4pyMonday 22 October 2012
  4. 4. Evidence ? Clyther PyOpenGL PyCuda PyAlgoTrade PyTrilinos Joblib numpy-boost petsc4pyMonday 22 October 2012
  5. 5. Why then? •The API ... •Simple but powerful memory model •Open access to the dataMonday 22 October 2012
  6. 6. Array data structureMonday 22 October 2012
  7. 7. Let’s look at the code! •Examples: – API / interactivity – memory management with stride_tricks – pikos – extensions with talib –(joblib, memmap/multiprocessing, ipython //)Monday 22 October 2012
  8. 8. API / interactivityMonday 22 October 2012
  9. 9. Memory management 1 2 3 4 5 6 7 8 9 10 11 12 = 1 2 3 4 2 3 4 5 3 4 5 6 4 5 6 7 5 6 7 8 6 7 8 9 7 8 9 10 8 9 10 11 ...Monday 22 October 2012
  10. 10. Memory managementShape 12,Strides 8, 1 2 3 4 5 6 7 8 9 10 11 12 = 1 2 3 4Shape 9,4, 2 3 4 5Strides 8,8 3 4 5 6 4 5 6 7 5 6 7 8 6 7 8 9 7 8 9 10 8 9 10 11 ...Monday 22 October 2012
  11. 11. Memory management - pikosMonday 22 October 2012
  12. 12. Memory management - chacoMonday 22 October 2012
  13. 13. Low level access %timeit talib.moving_average(adj_close, optInTimePeriod=5) 100000 loops, best of 3: 7.67 us per loop %timeit as_strided(adj_close, shape=(len(adj_close)-4, 5), strides=(8, 8)).mean (axis=1) 10000 loops, best of 3: 28.2 us per loopMonday 22 October 2012
  14. 14. Conclusion •It’s obvious, no?Monday 22 October 2012
  15. 15. Q&A?Monday 22 October 2012

×