Show More
@@ -672,7 +672,7 b'' | |||||
672 | "cell_type": "markdown", |
|
672 | "cell_type": "markdown", | |
673 | "metadata": {}, |
|
673 | "metadata": {}, | |
674 | "source": [ |
|
674 | "source": [ | |
675 |
"Probably the most important magic is the `%cython` magic. This is similar to the `%%cython_pyximport` magic, but doesn't require you to specify a module name. Instead, the `%%cython` magic |
|
675 | "Probably the most important magic is the `%cython` magic. This is similar to the `%%cython_pyximport` magic, but doesn't require you to specify a module name. Instead, the `%%cython` magic manages everything using temporary files in the `~/.cython/magic` directory. All of the symbols in the Cython module are imported automatically by the magic.\n", | |
676 | "\n", |
|
676 | "\n", | |
677 | "Here is a simple example of a Black-Scholes options pricing algorithm written in Cython:" |
|
677 | "Here is a simple example of a Black-Scholes options pricing algorithm written in Cython:" | |
678 | ] |
|
678 | ] | |
@@ -926,14 +926,14 b'' | |||||
926 | "metadata": {}, |
|
926 | "metadata": {}, | |
927 | "source": [ |
|
927 | "source": [ | |
928 | "One can also easily capture the results of %R into python objects. Like R, the return value of this multiline expression (multiline in the sense that it is separated by ';') is the final value, which is \n", |
|
928 | "One can also easily capture the results of %R into python objects. Like R, the return value of this multiline expression (multiline in the sense that it is separated by ';') is the final value, which is \n", | |
929 | "the *coef(lm(X~Y))*. To pull other variables from R, there is one more magic." |
|
929 | "the *coef(lm(X~Y))*." | |
930 | ] |
|
930 | ] | |
931 | }, |
|
931 | }, | |
932 | { |
|
932 | { | |
933 | "cell_type": "markdown", |
|
933 | "cell_type": "markdown", | |
934 | "metadata": {}, |
|
934 | "metadata": {}, | |
935 | "source": [ |
|
935 | "source": [ | |
936 | "There are two more line magics, %Rpull and %Rget. Both are useful after some R code has been executed and there are variables\n", |
|
936 | "To pull other variables from R, there are two more line magics, %Rpull and %Rget. Both are useful after some R code has been executed and there are variables\n", | |
937 | "in the rpy2 namespace that one would like to retrieve. The main difference is that one\n", |
|
937 | "in the rpy2 namespace that one would like to retrieve. The main difference is that one\n", | |
938 | " returns the value (%Rget), while the other pulls it to self.shell.user_ns (%Rpull). Imagine we've stored the results\n", |
|
938 | " returns the value (%Rget), while the other pulls it to self.shell.user_ns (%Rpull). Imagine we've stored the results\n", | |
939 | "of some calculation in the variable \"a\" in rpy2's namespace. By using the %R magic, we can obtain these results and\n", |
|
939 | "of some calculation in the variable \"a\" in rpy2's namespace. By using the %R magic, we can obtain these results and\n", |
General Comments 0
You need to be logged in to leave comments.
Login now