 So the first lesson is Jupyter and I guess one big reason to talk about Jupyter is that we will use it a lot, it's a convenient way of teaching and showing things. Diana, do you want to say anything about why Jupyter is good to learn before we start? I think it's great at the very beginning when you're starting to write your Python scripts, it's easier, it's more readable, I find it easier to debug as well, but if you're used to Python or just running it from the command line, that is great as well. So it's really a matter of preference. If you are used to Python and you have a favorite way of using it, then just go ahead and use that instead. So getting started with Jupyter, so let's just show one way of opening it, this is how I will use it. And just to note, so in the installation instructions that you hopefully did take a look at before the course, if you didn't just ask questions, but if you did there is also instructions for how to open Jupyter for whatever method of installing it you chose. So I will activate a conda environment in my terminal. And while Diana is doing this, I will mention that you can also open it from the Anaconda navigator, so if you prefer that, that's perfectly okay. And if you're using Anaconda and did not create a special environment, then you don't need to activate anything, you just run this command, JupyterLab. And this opens a new browser window or a new tab in the browser. And there's a lot of stuff here. That's probably not the most useful information at this point. So oh, I'm running it in my main folder. Is there a way of easily going to another folder here or should I just restart? Maybe I'll just go to Python for Psycho, okay, that works. So there is a file browser here. You can clearly go into folders. I will use it to delete my previous version of this session. Okay, so now I have no files in the folder. And if you have nothing open, it will automatically open this launcher, which will show you what kinds of programming languages you can use in Jupyter basically. So this is a Python tree kernel and it's the only one I have. So I can open a Python tree notebook here. If you don't see this, you can open this view by pressing this plus button here. Okay, so I will open a new one and immediately I will rename it. So right-clicking here and rename, I will call it demo. Yeah, that's always a good practice. Although I have a lot of untitled documents as well. Yeah, so it will automatically, oh, it's showing like it didn't save it. Okay, well, I mean that blue dot in my mind means it didn't save it. But maybe it's because it's empty. Okay, so we have this notebook and what we can do here, we can write Python code and run it and it will show the output immediately. Or we can use markdown to write a narrative. So you can essentially you can make this a document where you write some description and then you write the code and then you write some more description and then some more code and so on. So that makes it nicer for sharing your code or sharing your work flow with other people. They can immediately see what you've done and see the code actually in the document. So it says code here. It refers to this one, well, they could have multiple cells here. It's a plus button, so now you have multiple cells. So this code refers to this particular cell that I have selected. I will change it into markdown. Markdown is the language that we use in the collaborative document. So in the notes. So it should look relatively straightforward if it doesn't, that's fine. The point is not to learn markdown, but you can do formatting in addition to text with markdown. So this one hash means title. This is actually the biggest title available. So this is a title. And I should add that it's the same markdown that we are using for the notes document. And you don't have to be great at it to use it. I mean, I think you can just learn a few syntaxes and that's okay. So this is some text, I'll just write that and maybe I'll do like we do the question. So bullet point. So it actually does some, just like the notes, it does some syntax highlighting here so that you see there's a title and the bullets are there different. But now if I press play here, it will actually run this markdown code, which means generate a formatted text area here. Okay, now I can also do a Python code. So this is just markdown code or raw text. Code in this case means Python code because this was a Python notebook. So let's just do a simple one, one plus one run that. And if you install a different kernel, let's say you work with Julia instead, then the kernel is going to interpret what the cell that you are marking as code will be interpreting by the kernel that you have chosen. Yeah, actually I will steal this notes from here for a while. Okay, so what else should we try? So just a quick intro to Python, I suppose. So we can do a for loop and if we do for loop for starting from the value of i starts from zero and goes up to two, we use the range function and actually write the number three. So it's zero, one, two, that's three different numbers. So that's kind of the logic. And let's just print the number and run this cell. So I should print the number zero, one and two. You can do some of the range from zero to five. So now I'm not using print, but it will still print the last thing that happens. The output of the last line. So just like here in one plus one, it printed two, it prints 10 here. Okay, so this is essentially most of Jupiter. Let's quickly also show a magic function. So there are a few commands that don't exist in Python but are very useful in Jupiter and they start with a percentage. So we can print the directory we are at. So this stands for print working directory and if you use a Unix terminal in Linux or in Mac OS, this will be a familiar command. So this is where we are right now in my file system. But not all Unix commands exist here. So there's another command called bash, which will run. So bash is essentially a terminal. So you can run any terminal command here to host name, for example. So this will print the name of my computer, which is some string of numbers and characters. But I guess the thing I want to demonstrate is that even though this doesn't exist as a magic command, so this is what an error looks like, it does exist inside this bash command. Also everything now in this cell is this magic command because it starts with two percentage signs. So that changes how the cell works in general. Yeah, exactly. For one line it's one percentage for the whole cell. You should use two percentages followed by the magic. And maybe I could add that. I mean, using these magic commands is a great way of integrating bash and running other programs that you have compiled within your Jupyter notebook. So you could integrate, for example, R or C or Fortron and run it from the cell. But you just need to make sure that you do have the correct environment when you're trying to do that. But yeah, one command which I think is very nice as well is the LS magic one. If you could show it. And that will print all the magic commands that are available to you. Just one word. LS magic one word. It's always one word for the command. And then you may have options following. And then if you just expand, then you can see everything that is available as line magic or cell magic. So line magic is with one percentage sign and cell magic is for two. Exactly. And this may not be so instructive, but you could use, for example, magic or quick breath, one word to know more about them. Or you can just Google for them or check in the documentation. So that's, I find it quite a very long cheat sheet. But was there a magic command called pip? Let's see. So I mean, sometimes it is very useful to be able to also install packages from. So yeah, there is. There is. And there is content as well as a magic command. OK. Should we demonstrate the biggest problem that people will run into or should we just go to the exercises first? We have one minute. OK. So let's just show one thing that might. This is something you might run into. That might be a problem. So here we have run a follow that sets a value for the variable i. So here I can run an i equals 2. OK. What if I add a cell here and run this? What do you think should happen? What do you think will happen? Well, the way Jupiter works is that it just, it runs the cells in the order that you run them in. It doesn't care about what order they're written in. So this will still be equal to 2, this i here. What did I do? OK. So that might be a problem. If somebody else now gets your notebook, if you take your notebook and send it to someone else and they try to run it. So there is this very convenient button here that will run all the restart the kernel. Just forget everything and run all the cells from the beginning. So this is basically what will happen when you give you a notebook to someone else. They will run it every cell from the beginning. So now it ran this cell correctly. But this cell, i doesn't mean anything. So it just failed and gave an error. It's a very useful name. i is not defined. So you know what's happening. So I will just delete this cell because this is a problem. It shouldn't be there. It should be here. And let's try again. So it's always useful to do this restart kernel and rerun all the cells in order before sending your notebook to anyone. Oh. Hostname not found. That's interesting. OK. Right. Because that was actually I was showing you that it doesn't exist. OK. Let's remove that error as well. OK. Now everything worked. All the cells worked correctly. OK. So I guess we'll go to the exercises then. So let's do exercise one is almost at the top. So starting and exploring Jupiter. And if you are new to Jupiter, it's very much enough to just do that. There are some I mean it's good if you get to this first one which is run some code in Jupiter. The rest are some a bit more slightly more complicated exercises. And if you get all the way to the end, I mean I don't really expect you to get all the way to the end necessarily. If you if you do then go on to exercise three. It's an optional discussion exercise. So you can write things into the notes or you can discuss with people close to you if they are also done with all the exercises. So we'll give you 15 minutes. And then we'll do a quick grab up. So go ahead. Should we write some information in the notes about the exercise time? Yes, I heard. OK. Well, come back. I hope you had a good time with the exercises and got Jupiter running. So we had a couple of questions and I think the biggest issue is that bash indeed doesn't work on Windows. It's an operating system specific thing. So there is a magic command with the percentage sign there called cmd that should work on Windows. So you can use that one instead. It will not work on my system. So you can try running it. But yeah, it does not exist. Yeah. But sorry, yes, we missed that. So but bash equivalent in Windows should be cmd. So whatever we tried in the bash magic in the bash then you could try that with cmd. OK. So that's everything about Jupiter for now. We will be using it for a lot of the course. So you will get used to it. Is there any other notable questions to bring up? There's a lot of questions and a lot of answers, which is great. Yes, I think most of them are answered. So yeah, maybe we can just wrap up with one to use Jupiter and one is it not so great. Yeah. So do you use Jupiter a lot? It's actually mostly for teaching and for visualizing plots. Yeah. It's really useful for visualizing because you can it can display the plots or any images inside the notebook. So it's kind of inlining it. So that's useful. It's good for quickly changing a single cell. You don't have to rerun the whole thing. So if you have a really, if you have a processor takes a few minutes to run and you want to work on the very last 10 seconds of it, you may not want to run the whole thing every time you're testing it. So just run the last couple of cells. And why should you not use Jupiter? There's a few actually a few good reasons to not use Jupiter as well. I think the main most important one is the top most one here. So they don't promote modularity. So yeah, writing functions into the notebooks or moving things into importable files is, I mean, it doesn't happen automatically. It's something you need to think about when you're writing the notebooks. Yes. And one thing I would mention here. It's also written in the material is that the NVIDIA extension. That's really great if you are versioning and controlling your notebooks and you should do that. So that will allow you to see differences between different notebooks, which is not straightforward. Or rather version controls the tool. Okay. And yeah, there's some other things written down here. So you can read on your own time. Now it's time for a break. So do take a break. You can come back to the exercises or any part of this later. But it is it's actually very useful for or very important for learning that you also take breaks if you were really working on this one. Then take some time off too. Take your hands off your keyboard and walk around and then come back. So we'll take nine minutes and then we'll come back at the short. Let's come back. Two minutes past. And we'll continue. Yeah. Yeah. We'll continue in number. Yeah. All right. So see you after the break. Bye.