@ -2912,13 +2912,21 @@ plotly.express.line(df, x=<span class="hljs-string">'Date'</span>, y=<span class
< div > < h2 id = "cython" > < a href = "#cython" name = "cython" > #< / a > Cython< / h2 > < p > < strong > Library that compiles Python code into C.< / strong > < / p > < pre > < code class = "python language-python hljs" > < span class = "hljs-comment" > # $ pip3 install cython< / span >
< span class = "hljs-keyword" > import< / span > pyximport; pyximport.install()
< span class = "hljs-keyword" > import< / span > < cython_script>
< cython_script> .main()
< / code > < / pre > < / div >
< pre > < code class = "python language-python hljs" > cdef < type> < var_name> = < el>
< div > < h3 id = "definitions" > Definitions< / h3 > < ul >
< li > < strong > All < code class = "python hljs" > < span class = "hljs-string" > 'cdef'< / span > < / code > definitions are optional, but they contribute to the speed-up.< / strong > < / li >
< li > < strong > Script needs to be saved with a < code class = "python hljs" > < span class = "hljs-string" > 'pyx'< / span > < / code > extension.< / strong > < / li >
< / ul > < pre > < code class = "python language-python hljs" > cdef < type> < var_name> = < el>
cdef < type> [n_elements] < var_name> = [< el_1> , < el_2> , ...]
cdef < type/void> < func_name> (< type> < arg_name_1> , ...):
< / code > < / pre >
< / code > < / pre > < / div >
< pre > < code class = "python language-python hljs" > cdef < span class = "hljs-class" > < span class = "hljs-keyword" > class< / span > < < span class = "hljs-title" > class_name< / span > > :< / span >
cdef public < type> < attr_name>
< span class = "hljs-function" > < span class = "hljs-keyword" > def< / span > < span class = "hljs-title" > __init__< / span > < span class = "hljs-params" > (self, < type> < arg_name> )< / span > :< / span >
@ -2926,16 +2934,6 @@ cdef <type/void> <func_name>(<type> <arg_name_1>, ...):
< / code > < / pre >
< pre > < code class = "python language-python hljs" > cdef enum < enum_name> : < member_name_1> , < member_name_2> , ...
< / code > < / pre >
< ul >
< li > < strong > All < code class = "python hljs" > < span class = "hljs-string" > 'cdef'< / span > < / code > definitions are optional, but they contribute to the speed-up.< / strong > < / li >
< li > < strong > Script needs to be saved with a < code class = "python hljs" > < span class = "hljs-string" > 'pyx'< / span > < / code > extension.< / strong > < / li >
< / ul >
< div > < h4 id = "runningcythoncode" > Running Cython code:< / h4 > < pre > < code class = "python language-python hljs" > < span class = "hljs-comment" > #!/usr/bin/env python3< / span >
< span class = "hljs-keyword" > import< / span > pyximport; pyximport.install()
< span class = "hljs-keyword" > import< / span > < pyx_script_name>
< pyx_script_name> .main()
< / code > < / pre > < / div >
< div > < h2 id = "basicscripttemplate" > < a href = "#basicscripttemplate" name = "basicscripttemplate" > #< / a > Basic Script Template< / h2 > < pre > < code class = "python language-python hljs" > < span class = "hljs-comment" > #!/usr/bin/env python3< / span >
< span class = "hljs-comment" > #< / span >
< span class = "hljs-comment" > # Usage: .py< / span >