Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

NumPyの歴史とPythonの並行処理【PyData.tokyo One-day Conference 2018】

10,229 views

Published on

Published in: Technology

NumPyの歴史とPythonの並行処理【PyData.tokyo One-day Conference 2018】

  1. 1. 1
  2. 2. !2
  3. 3. !3
  4. 4. !4
  5. 5. "Python has arguably become the de facto standard for exploratory, interactive, and computation-driven scientific research” !5
  6. 6. !6
  7. 7. !7
  8. 8. 
 !8
  9. 9. !9
  10. 10. •L[i, j, k] •L[1:2, ..., 2:3] L[i][j][k] L[i,j,k] !10
  11. 11. A = A*2 A *= 2 !11
  12. 12. >>> y = (x >= 0.5) >>> y array([ True, False, False, True, False]) >>> z[y] array([0.23273493, 0.99925692, 0.85635559]) !12
  13. 13. >>> A =[1, 2, 3] >>> A[1] 2 >>> A[np.int64(1)] 2 !13
  14. 14. !14
  15. 15. A @ B np.matmul(A, B) !15
  16. 16.
  17. 17. Stack Overflow Trends !17
  18. 18. !18
  19. 19. !19
  20. 20. !20
  21. 21. from concurrent.futures import * def fib(n): if n < 2: return n return fib(n-2) + fib(n-1) with ProcessPoolExecutor() as e: fibs = e.map(fib, range(10)) for v in fibs: print(v) !21
  22. 22. !22
  23. 23. !23
  24. 24. def func(n): s = 0 for i in range(n): s += i with ThreadPoolExecutor() as e: e.map(func, range(3)) !24
  25. 25. ⇛ ⇛ !25
  26. 26. def func(): while True: s = 0 for i in range(n): s += i print(s) !26
  27. 27. !27
  28. 28. • 10*10, 100*100 40000 • 1000*1000 400 • 1~9 !28
  29. 29. !29
  30. 30. !30
  31. 31. !31
  32. 32. • 10*10, 100*100, 1000*1000 200 • 1~9 !32
  33. 33. !33
  34. 34. !34
  35. 35. !35
  36. 36. !36
  37. 37. !37
  38. 38. !38
  39. 39. !39
  40. 40. !40
  41. 41. 
 !41
  42. 42. 
 
 
 
 !42
  43. 43. !43
  44. 44. !44
  45. 45. !45
  46. 46. !46
  47. 47. !47
  48. 48. !48
  49. 49. !49
  50. 50. !50

×