Skip to content

Instantly share code, notes, and snippets.

View cuckookernel's full-sized avatar
🎯
Focusing

Mateo Restrepo Mejía cuckookernel

🎯
Focusing
View GitHub Profile
@cuckookernel
cuckookernel / pythontojulia.md
Last active March 20, 2023 04:02
Python to Julia Quick translation / conversion reference Guide

A quick and dirty syntax translation / conversion reference guide to ease the transition between Python and Julia. This is not meant as a reference to the language. For that you should read the manual.

Some important differences

  • Arrays in Julia are indexed starting from 1.
  • In Julia classes (i.e. types) don't own methods. Methods are implementations of generic functions and are invoked in a "static style", i.e. instead of Python's str1.rstrip(), we will have rstrip( str1 ), instead of file1.close(), close( file1 ).

Some important similarities.

@cuckookernel
cuckookernel / matlabtojulia.md
Last active March 18, 2018 20:20
MATLAB to Julia quick translation/conversion reference guide

A quick and dirty MATLAB to Julia translation/conversion reference guide.

This is not meant as a reference to the language. For that you should read the manual

Important Diferences

The first few are drawn from here

  • Use brackets to index into vectors and matrices, i.e. do v[i] instead of v(i).
  • Array assigment is done by reference, i.e after A = B modifying A will modify B!
  • One dimensional vectors are column vectors by default.
  • [17, 42, 25] and [17;42;25] both create a column vector. To create a row vector do [17 42 25], this is really a 1-by-3 (two-dimensional matrix).