# Python-Julia cheat sheet?

**URL:** <https://discourse.julialang.org/t/python-julia-cheat-sheet/65673>\
**Category:** New to Julia\
**Tags:** question, cheatsheets\
**Created:** [August 2, 2021, 10:21am UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673 "2021-08-02T10:21:58Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![feline](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feline/32/27739_2.png) [@feline](https://discourse.julialang.org/u/feline)\
**Post date:** [August 2, 2021, 10:21am UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/1 "2021-08-02T10:21:58Z")

</div>

I am new to Julia but well-versed in Python, and was wondering if there is a Python to Julia mapping chart (similar in concept to this SQL to MongoDB mapping chart: [SQL to MongoDB Mapping Chart - Database Manual - MongoDB Docs](https://docs.mongodb.com/manual/reference/sql-comparison/))?

---

<div class="post-metadata">

**Author:** ![dfdx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dfdx/32/120_2.png) [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Post date:** [August 2, 2021, 10:24am UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/2 "2021-08-02T10:24:42Z")

</div>

See [Noteworthy differences from Python](https://docs.julialang.org/en/v1/manual/noteworthy-differences/#Noteworthy-differences-from-Python).

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [August 2, 2021, 10:44am UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/4 "2021-08-02T10:44:47Z")

</div>

The [QuantEcon cheetsheet](https://cheatsheets.quantecon.org/) may be useful as a quick reference, but nothing replaces actually reading the documentation 😉

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 2, 2021, 11:40am UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/5 "2021-08-02T11:40:44Z")

</div>

just to add more reference:  
[https://github.com/JuliaCN/Py2Jl.jl](https://github.com/JuliaCN/Py2Jl.jl)

---

<div class="post-metadata">

**Author:** ![feline](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feline/32/27739_2.png) [@feline](https://discourse.julialang.org/u/feline)\
**Post date:** [August 2, 2021, 12:18pm UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/7 "2021-08-02T12:18:30Z")

</div>

Thank you! This is by far the best Python-Julia cheatsheet I have seen.

---

<div class="post-metadata">

**Author:** ![feline](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feline/32/27739_2.png) [@feline](https://discourse.julialang.org/u/feline)\
**Post date:** [August 2, 2021, 12:22pm UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/9 "2021-08-02T12:22:52Z")

</div>

Thank you, but I’m not exactly sure how this is relevant to the question.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 2, 2021, 12:43pm UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/10 "2021-08-02T12:43:53Z")

</div>

you want to (learn to) translate Python code to Julia code, this does that for you automatically?

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [August 2, 2021, 12:59pm UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/11 "2021-08-02T12:59:59Z")

</div>

If you really want to do a 1:1 transpile from python to julia, you should be aware of the limitations of such transpiled code, as explained in the FAQ section of the docs:

[Why don’t you compile Matlab/Python/R code to julia?](https://docs.julialang.org/en/v1/manual/faq/#Why-don't-you-compile-Matlab/Python/R/%E2%80%A6-code-to-Julia?)

The short version is - it’s the semantics of julia that makes it fast, not the syntax. A pure transpilation will most likely not take full advantage of those and is in fact likely to be slower, because certain patterns used in those languages are simply not efficient in julia (reasons for this include spurious allocations of memory on the heap, garbage collection, access patterns and more, all of which and more can be avoided by writing more idiomatic julia code).

---

<div class="post-metadata">

**Author:** ![feline](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feline/32/27739_2.png) [@feline](https://discourse.julialang.org/u/feline)\
**Post date:** [August 2, 2021, 5:11pm UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/12 "2021-08-02T17:11:26Z")

</div>

No. I wanted to use a reference for when I need to understand something in Julia since I already know Python. I don’t need to automatically translate from julia to python. A good analogy would be using Google Translate for every sentence you want to say when your objective is to learn how to speak the language; which is not what I’m looking for. I’m thankful for your comment though!

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 2, 2021, 6:46pm UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/14 "2021-08-02T18:46:49Z")

</div>

that’s on me. I changed the title (way earlier), the original title was “mapping”, which I interpreted as some kind of well defined operation to map a python function to julia function so I assumed it meant something automatic.

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [August 2, 2021, 8:30pm UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/15 "2021-08-02T20:30:26Z")

</div>

Anyone know an easy-to-read version of this? I’m lecturing Numerical Analysis in January to 2nd year undergrads who have only been exposed to Python and I’d like to make it as easy for them to pick up as possible

---

<div class="post-metadata">

**Author:** ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Post date:** [August 2, 2021, 8:32pm UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/16 "2021-08-02T20:32:59Z")

</div>

See [https://cheatsheets.quantecon.org/](https://cheatsheets.quantecon.org/) and submit PRs if things are out of date!

---

<div class="post-metadata">

**Author:** ![feline](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feline/32/27739_2.png) [@feline](https://discourse.julialang.org/u/feline)\
**Post date:** [August 2, 2021, 9:04pm UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/18 "2021-08-02T21:04:40Z")

</div>

this is the best reference I have found so far: [https://cheatsheets.quantecon.org/](https://cheatsheets.quantecon.org/)

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [August 2, 2021, 9:10pm UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/20 "2021-08-02T21:10:48Z")

</div>

That is an amazing reference! Absolutely perfect. Thanks!!

---

<div class="post-metadata">

**Author:** ![csango](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/csango/32/23654_2.png) [@csango](https://discourse.julialang.org/u/csango)\
**Post date:** [January 7, 2022, 6:27am UTC](https://discourse.julialang.org/t/python-julia-cheat-sheet/65673/21 "2022-01-07T06:27:16Z")

</div>

There is another one which provides some equivalent expression between multiple languages (Matlab, Julia, Numpy, and Eigen)

[https://www.thewizz.art/2022/01/05/matlab-equivalent-functions-in-julia-numpy-and-eigen/](https://www.thewizz.art/2022/01/05/matlab-equivalent-functions-in-julia-numpy-and-eigen/)
