Reading data of different types from a data file with multiple lines and headers for each line

Knowing a bit of Python is certainly good to get started with Julia, but it’s not necessary. You could have a look at this, if you have a background in either MATLAB, R, Python, C or Lisp and need a little help for transitioning:

https://docs.julialang.org/en/v1/manual/noteworthy-differences/

I’ve been using Julia for around a year now, and I’m currently working on my master thesis using Julia, so that helps enormously.

The approach is pretty much the same as in your days: I started by reading the manual and coding up really basic examples and things for fun. It’s of great help to have a kind of ‘toy project’ which you can code up bit by bit, seeing progress when you make it and being able to revise and refactor the code many times. You can be sure that I started writing horrible code (by my current standards) at first :smiley: I think I turned the basic bits of my thesis project inside out for the 3rd time now. (I started the project a while ago and it turned into a thesis eventually, it didn’t start as one, else I would have ran out of time by now). [Edit: I’m still far from writing optimal code, but it’s getting better. You’ll get there, too.]

It’s just a process like learning any language. I like revisiting the docs once in a while, and also looking at the code in Julia Base is often helpful, especially if you implement your own types and need help implementing specialized functions. It’s really helpful to look at how other people solved these problems and digest that.

Oh and reading around the julia discourse here is also pretty helpful, as there are a lot of questions and answers and nice examples here.

Can’t really help with that, sorry, but similar questions have been asked multiple times here. Maybe you find something there:

And finally:

Both are fine. With a dictionary holding different types, you need to make sure to annotate the types when you unpack them (for performance reasons), with Nils’ struct approach that comes for free.

Good luck to you!

[Edit: typing errors]

2 Likes