 Okay. So, yeah, we'll start with Jupyter because it is something we'll be using throughout the course. Yeah. And... Why do we choose Jupyter for the course? It has, I guess, an intuitive user interface for most people when they're starting up. So if you're not that familiar with Python and with programming in general, it will feel, or it will be more quickly obvious what's happening than if you are writing these text files that contain some program code. Yeah. So that's probably the main reason, but it's also something that researchers use quite a lot to share their research, share their computational things with each other. So and there's several reasons for that, but what Jupyter is really good for is actually sharing a story with some computational content inside the story. So it's a kind of a narrative. So it can contain text that's formatted like this website here, and then it can contain some code, some Python code or essentially almost any other language in there that... And it displays the results. So yeah, it's a great way of sharing your results with others. So I guess it gets around this problem of taking and like sending results to your supervisor and they see the plots, but they have no idea how they came and then you're sort of going back and forth and sending code and you have no idea what code goes to what figures and so on. The other reason researchers use it a lot is that it's really easy to quickly change something to fiddle around with things and then execute the code and see what the change is, what happens when you change this little thing here. So it's easy for... It's a good interface for quickly developing some research program, right? Yeah. Should we do a demo? Should we start with the stuff? I believe that is... Yeah, do you want to do that? Yeah. Okay. I will switch to my screen again. Here we go. And yeah. So on my computer, I'm activating Anaconda manually. So in the installation, you should have found the way to start Jupiter on your own computer. I'll demonstrate my way here. I'm also going to make a directory and then go to this directory. And then I should be able to run, let's see. It says Jupiter lab, right? Now your prompt is already quite long. That's a little bit shorter. Okay. Yeah. And I'm going to do no browser because I wanted to start in this particular window here. And otherwise it's going to be starting in... Who knows which web browser I have open. I have so many. Wait, this is actually not where I wanted it to start. I need to start another web browser here. My demo web browser. So if you run it without no browser, it will automatically pop up in a web browser window that you have or start a new one, which is usually what you want to happen. Yeah. Not in my case, because... Yeah. Okay. Here we go. So what do we see here in Jupiter lab? What are the main points? Okay. So what you are looking at now is, well, it's a website, but inside that website you have two panels and on the right side is a launcher. So that's what you would want most of the time. That has a Python tree option. So you can start a Python tree notebook from there. So that would just create a new empty notebook. Interestingly, there's a file browser, which looks familiar to most people on the left. And it didn't start in the folder that you just created. Yeah. So it actually changed to a different directory of mine. I'm going to restart. So let's see. Here we go. So if you want to know what happened, it changed to a Git directory automatically. Okay. Here we go. I didn't know that it would do that. Yeah. Okay. So here we go. So now it's in an empty folder. Okay. So, I mean, that's useful only if you have files there. So right now you don't. So it's probably, you might as well hide the, yeah, hide it from there. This way. Okay. Yeah. Okay. What else? Well, then you have some options in the launcher. You can create a Python tree notebook, but you can also open a terminal, which we might need at some point. Yeah. At least tomorrow I think we start needing it. And you can also, well, you can create a markdown file, which is also useful. Yeah. But we'll come back to that. So you are using markdown in HackMD at the moment. Yeah. But we'll demonstrate that as well. But yeah, probably right now we want to create a new Python tree notebook. Yeah. Okay. There we go. And it worked. Yeah. So I can hide it down here, right? Yeah. You can type Python code. We do our standard greeting and it works. Okay. Okay. How did you just run the code? So I pushed, first I pushed control enter and it stays on the same cell, then I pushed shift enter and it makes a new cell down below or moved down. You can also click this play button up here. And there's a plus button for creating a new cell as well. Oh yes. So in the election materials, there's a bunch of shortcuts. And yeah, I always have to check somewhere, but it is useful to use the keyboard or it's much faster to use the keyboard. Yeah. Let's see, can we create a markdown cell just to show? So we have a new cell. We switch between cell types and markdown is one option. Oh, it didn't change. I changed something weird with my web browser here. Okay. Okay. You can use the keyboard shortcuts though. Okay. So yeah, you can type formatted text in. Well, if you are interested in the details of how to write markdown, there is a reference in the election materials. It's right above running code in Jupiter section. Yeah. There's a link in the second paragraph. Yeah. And when I click play, we see it gets rendered. Yeah. So when you execute, when you run a markdown cell, it gets written as, it gets formatted and yeah, it looks like a nice text, nice formatted text. But if you want to edit it again, you will need to double click on this markdown cell. And then you can change it. Yes. Okay. Let me see. Okay. What else is important here? Well, you saw when you ran the Hello World cell, it printed something and the output comes just below the cell. So I can do like five and it comes below. Yeah. Okay. Okay. So should we do some examples for all of them? Sure. Some. Okay. Yeah. Let's see for, what should we do in here? Print i. Okay. Print i squared. Print squares. Yeah. When you call print, it goes, when you call print inside the loop, it does actually print it. If you didn't call print, and then it wouldn't print it because it only prints the last line. This is something special to, yeah, special to Jupiter, it prints the last line. Yeah. Okay. So let's try that actually. Let's do some range five. For example. Oh, yeah. Okay. So this will sum up numbers between one and five and it prints it. Yeah. You can also put print in front or put that inside a print, inside the print function and that will work. Okay. Let's try that. All right. You're missing a parenthesis between print and sum, so it's complaining that print sum doesn't exist. Yeah. Okay. There we go. All right. Now, there's something called magics that we should also introduce for moving into the exercises. So magics are just essentially commands you can give Jupiter. They are not Python commands, but they are other types of code. So they always start with a percentage sign. And in this case, you start with a double percent sign. So that means that the entire cell is now magic code. It's not Python code. Bash is the usual, the most common Linux terminal. So that's just what the word there means. And yeah, you can write some bash code here. Yeah. And I guess we should emphasize this might only work on Mac and Linux. Does it work on Windows now? I expect not. But if you are running from maybe Git for Windows, it might work. Yeah. There is probably something that runs on the Windows command line. Yeah. Let's say it's very possible this doesn't work on you because this is actually not running in Python. It's calling some other program. And if that other program is not available, then, well, what can you do? It just won't work. Okay. Yeah. So should we go to the exercises? Yeah. So should we take maybe how long do we have for exercises? I mean, we have 20 minutes or half an hour before the break. Say 20 minutes. So are we doing exercises one here? Exercise. Oh, yeah. One and two. We did everything before exercise two. And then we come back for a little bit of commentary. Yeah. Yeah. So breaks in 20 minutes. Should we say like 15-ish minutes? 15 minutes makes sense. Okay. And just quick note about the order. So in exercise one, there's two optional things. And it makes sense to do exercise two before going back for the optional things. They are slightly more complicated. Yeah. And these exercises will be really simple. So basically, it's just a little bit of time to make sure everyone's on the same page before we go to more complex things. So if you're new with Jupyter, play around. Try the keyboard shortcuts to everything you can think of. And if you're not new to Jupyter, then try to find something new. Yeah. So we'll see in 15 minutes. Yeah. And in this dream, there is at the bottom here linked to the exercises. And it will say what to do when we're back and all that. You can keep asking questions. Hello, please. It's time to come back. Hello, hello. Hey. So, um, let's see any interesting questions into HackMD. Let's take a look. There was one interesting one up here. Is there any advantage of Jupyter over regular code? And that's actually what we will discuss next. Um, there was this collab offer the same as Jupyter. And yeah, I mean, it's, I think it's roughly a very similar interface. So I'm not sure if they re-implemented it, but it uses the same notebook format. And also, um, a lot of the same software kind of things. It's slightly different because it's focused on the cloud. And it does have some additional tools that Jupyter doesn't have. And there are a lot of the, the plug-ins that you can. So Jupyter is very, a Jupyter lab is very extensible. You can extend it a lot, whereas co-lab doesn't have quite the same, um, same amount of extensions. Let's see. Yeah, it's basically the same idea. We see interesting comments about the Bash magic working on some Windows 10. Yeah. Some, uh, it doesn't work on some. Um, do I sound any better now? Some people were complaining about my volume. Hopefully it's louder now. Yeah, I guess the important thing is that we are relatively close to each other in volume. Yeah. Okay, hopefully I'm a bit louder now. Um, should we go to the lesson and talk about why Jupyter and why not Jupyter? And then we'll come back to. Yeah, let's do that. Save this question. So I think we'll be answering a number of good questions in the HackMD. Yeah. So, where is it? So why Jupyter? What are its advantages and disadvantages? Yeah. So I already mentioned, um, a couple of things. So it is, I mean, compared to writing a, um, writing Python in a text file, um, you can, you can create this story with, um, form a text and with the outputs of your computation directly visible. Uh, so for each step. So, um, then this can be plots, for example, this can be images. So you can tell the story, um, in a clearer way than with just text. That is one major advantage. Uh, now, Jupyter is, um, for all of you, almost certainly Jupyter Lab is running in a web browser. Um, it is designed to run, um, in a server in the background and be accessed through the web browser, which makes it really easy to share online. So there's several ways of sharing your work online when you have written a Jupyter notebook. Um, yeah, what else? Well, and others can then run your notebook. So, um, it's not just that they can see your result. They can actually run the code and verify that it produces the same or similar output. Um, what else? Um, I mean, it's the whole, you can put the whole story in one place. Um, from the beginning, the end, um, it's a kind of a linear way of, uh, including, um, all the elements. Again, it's like a paper with equations, but instead of equations, you can also have code. Um, anything else? I mean, yeah. Yeah, I mean, it's interesting. Yeah, like it's, so it's great for this getting started kind of stuff. And why is it not good? Yeah, it's very easy to share. Easy to share. So if you put it on GitHub, there's a section on Binder on the last day. Um, Binder is a quick and easy way of putting a sharing your notebook online without really having to set up the server yourself or going to go through, um, all that much, um, work to share it. But yeah, why not Jupiter? Um, there's, uh, people will run during this course, people will run into problems where they execute the cells out of order, they go and change something, execute something and, um, the state is somehow different from what you expect. And then the solution is to run it from beginning to the end. Um, it's not linear. And that makes it, that's a good thing, but it's also a bad thing. It makes it confusing. Um, they don't promote modularity. So what does that mean? It's, um, hard to take a piece of code, a function, for example, from a notebook and, um, use it in a different project. Whereas if you write it as, um, code file, it's much easier. Um, this testing is not straightforward, version control is not straightforward. Um, those are important things when doing serious software development. Um, there are ways of doing it, but there's limitations in, uh, both of those. Yeah. Um, what else? It's almost time for our break. Actually, it is time for our break now. Should we wrap up? There's plenty more people can read about, um, things here. Um, and you can discuss a little bit more. And let's see, were there any more HackMD questions we should comment on? Um, yeah. Well, I think most of these questions are being answered there well enough. So let's go on. You can keep reading and we'll see. So yeah. Um, okay. Break time. HackMD will have the break announcement and we'll be back at the top of the hour. So see you. See you. See you later. Bye.