🔆 یک سری مثال برای کاربرد آرایه های numpy در cython شامل
- loop over numpy array
- passing numpy array as argument
- indexing over numpy array (better optimization)
- disabling bounds checking (bounds of indices)
- passing numpy array and returnding numpy array
https://github.com/Ziaeemehr/cython/tree/master/examples/example_5_numpy
using numpy array in #Cython
#Mixed_programming
using numpy array in #Cython
#Mixed_programming
مرجع مثال ها همراه با توضیحات بیشتر در فایل Readme
هر مثال قرار دارد.
بسته به هر مثال سرعت اجرا تا ۳۰۰ برابر نسبت به کد پایتون سریع تر شده است.
تا 1000x speedup هم گاهی معمول هست.
- loop over numpy array
- passing numpy array as argument
- indexing over numpy array (better optimization)
- disabling bounds checking (bounds of indices)
- passing numpy array and returnding numpy array
https://github.com/Ziaeemehr/cython/tree/master/examples/example_5_numpy
using numpy array in #Cython
#Mixed_programming
using numpy array in #Cython
#Mixed_programming
مرجع مثال ها همراه با توضیحات بیشتر در فایل Readme
هر مثال قرار دارد.
بسته به هر مثال سرعت اجرا تا ۳۰۰ برابر نسبت به کد پایتون سریع تر شده است.
تا 1000x speedup هم گاهی معمول هست.
GitHub
Ziaeemehr/cython
cython examples. Contribute to Ziaeemehr/cython development by creating an account on GitHub.
🔆 برای دادن python list به عنوان آرگومان به تابع و برگرداندن لیست از تابع cython در اینجا توضیح داده شده است.
مثال ها به ساده ترین شکل ممکن هست و تنها هدف آموزشی دارد.
1️⃣ هر مثال شامل یک فایل با پسوند pyx است که تابع cython در آن نوشته می شود.
2️⃣ فایل setup.py که برای ساخت تابع کتابخانه با پسوند so به کار میرود. در ویندوز فایل pyd ساخته می شود.
3️⃣ فایل run.py که برای فراخوانی و اجرای کد استفاده می شود.
4️⃣ فایل makefile هم برای اجرای فایل setup و ساخت ماژول به کار می رود.
مثال ها به ساده ترین شکل ممکن هست و تنها هدف آموزشی دارد.
1️⃣ هر مثال شامل یک فایل با پسوند pyx است که تابع cython در آن نوشته می شود.
2️⃣ فایل setup.py که برای ساخت تابع کتابخانه با پسوند so به کار میرود. در ویندوز فایل pyd ساخته می شود.
3️⃣ فایل run.py که برای فراخوانی و اجرای کد استفاده می شود.
4️⃣ فایل makefile هم برای اجرای فایل setup و ساخت ماژول به کار می رود.
GitHub
Ziaeemehr/cython
cython examples. Contribute to Ziaeemehr/cython development by creating an account on GitHub.
example.pdf
21.8 KB
می توان cython را در jupyter notebook به صورت interactive هم استفاده کرد و نیاز به کامپایل کردن جداگانه ندارد. همه مراحل کامپایل در پشت صحنه انجام می شود.
github
github
Watch "David Higgins, Robert Schwarz - Introduction to Julia for Scientific Computing and Data Science" on YouTube
https://youtu.be/4kKp_3kOZIg
https://youtu.be/4kKp_3kOZIg
YouTube
David Higgins, Robert Schwarz - Introduction to Julia for Scientific Computing and Data Science
Description
Developed at MIT, with a focus on fast numerical computing, Julia has a syntactical complexity similar to that of Python or Matlab but a performance orders of magnitude faster. We will present an introduction to the language, followed by a sampling…
Developed at MIT, with a focus on fast numerical computing, Julia has a syntactical complexity similar to that of Python or Matlab but a performance orders of magnitude faster. We will present an introduction to the language, followed by a sampling…
Watch "Intro to solving differential equations in Julia" on YouTube
https://youtu.be/KPEqYtEd-zY
https://youtu.be/KPEqYtEd-zY
YouTube
Intro to solving differential equations in Julia
On February 6 (10AM PST/1 PM EST/19:00 CET) Chris Rackauckas gave an introductory tutorial on solving differential equations in Julia. This tutorial targets new Julia users and goes over the Julia package DifferentialEquations.jl.
You can follow along and…
You can follow along and…