Python MOOC – Week 2

I’m going to sum up the experiences of the past week and share what I managed to find out.

First off, I really like the way the MOOC is organised. Especially the way it encourages team work and p2p-learning process. First the instruction was to sign up for OpenStudy, which is very good in terms of mutual help and revision. But there’s a problem there. You can ask questions there alright, but you can ask only one question at a time. That is, after you asked your question, it appears on the questions wire and everyone can see it and answer it. But if you want to ask another question, you’ll have to mark the current one as ‘closed’ and only then you’ll have an option to ask a new one. ‘Closed’ means that it is removed from the wire shown by default (to the list of closed questions) and if you haven’t received the answer so far, there’s a chance you’ll never have it because nobody will notice the question.

2013-06-30 20_32_53-OpenStudy

Ah yes, also OpenStudy is often down, so you sometimes simply can’t use it.

But there are great options outside. First is that the MOOC organisers divided all MOOCsters into teams and provided them with mailing list addresses, so some questions cans be asked and answered in small groups and you have no limitations here.

Finally, there’s one more learning space I discovered only yesterday and haven’t tried yet, but it looks great. I mean Groups at Codecademy (you have to sign in to see the page). Although I’ve been using Codecademy for quite a while now, I didn’t know about their existence. Of course I immediately joined Python for Beginners group. I hope it’ll be a great experience.

Now a couple of words about this week’s homework. This week was rather challenging for me, because I was struggling to understand how loops work, especially the for loop. One of the tasks was to write a code that calculates exponentials using a for loop. Thanks to my team mates who helped me figure out what the task was about in the first place  – that is that the task should be executed without using the in-built exponentiation (**) option.

Now, I had dealt with for loops at Codecademy and found them rather easy. This is what I basically imagined:

for i in range(1, 10, 2):

    print i

So it does what you tell it to with all the items in a range.

But in this case a possible resulting code I got after many efforts (and quite a bit of guesswork, I admit) looks like this:

base = input("Enter base: ")

exp = input("Enter exponent: ")

x = base

for n in range(1, exp):

    x *= base

print x

So after I wrote it, I still had a question: how are for n in range(1, exp): and x *= base connected if there are no obvious operations in which n (the items from the range) are mentioned? The answer is obviously that they don’t have to be mentioned. That is, the for loop in this case is used to show the computer how many times the operation must be repeated.

This is what I realised after reading this awesome article about loops in Python. And I also realised that there’s a great way to see what programme does by adding print statements that reflect the process step by step. Like so:

base = input("Enter base: ")

exp = input("Enter exponent: ")

x = base

for n in range(1, exp):

    x *= base

    print x # This shows what's going on in the process

print x

So for instance if we have base 5 and exp 4, the output will be:

25

125

625

625

Also one of my team mates kindly recommended me to read Learning Python by Mark Lutz (I found out on the way that there’s a whole site about it).

Finally, I played with PyScripter IDE and explored some code sharing options, which I’m going to describe soon.

Oh, by the way, if some peers want to have a look at my whole homework (with the exception of optional tasks I’ll get back to them a bit later), it’s here: https://gist.github.com/ansakoy

Advertisements

Python MOOC – Week 1 UPD

I know by experience that ‘next week’ is always full of unpredictable work, sudden meetings and other distracting stuff, so I decided to do my best at the weekend to play with Python. Kudos to Codecademy, once again. The first week’s homework was really easy (but good for revision), while only a month ago I’d feel totally frightened by it.

Just tried out OpenStudy. I was absolutely resolved to be using IDLE for the rest of my life the course, but one peer there endorsed another IDE (Interpreted Development Environment) called PyScripter. So I went and checked it out. Not that at my level it made a huge difference, but I like it that PyScripter has a compact layout that works in one window instead of two, unlike IDLE that has separate shell and text editor.

PyScripter:

2013-06-23 19_19_51-PyScripter - module1_

 

IDLE:

 

2013-06-23 19_21_19-Python Shell

 

I think I’ll try using both and see which is best for me.

Also we had an illustrative task in natural language processing (exercise 1.11). We were given a sentence Alice saw the boy on the hill with the telescope. And we had to sketch the two possible interpretations of this sentence. Drawing in MS Paint with a mouse – what a pleasure!

Exercise 1

Python MOOC – Week 1

2013-06-23 07_43_22-The Mechanical MOOC – A Gentle Introduction to Python _ Free range open learning

So, a new (the fourth, as far as I understand) sequence of Python Mechanical MOOC officially started a week ago. This week happened to be extremely busy in my case, so I actually had less time for learning than I hoped I would. But thanks to the Codecademy lessons I took some time ago, the first bunch of tasks didn’t contain too much new information for me. But at the same time it contained quite a number of fascinating and revealing details. For one, I found out from this video lecture that some languages allow using false indentation. That is, unlike Python where indentation is the only way to make a script work properly, many other languages use punctuation to separate statements. But indentation is still required by convention to make a programme clearly readable and its semantics more obvious from its structure. So to make people think that the programme does something different from what it really does, some coders may use this false indentation e.g. in Java or C. But not in Python however.

Also, as I think that during these 8 weeks’ period Python is supposed to be my primary learning focus, I decided to take into account some additional Python courses that might provide a better understanding of what’s going on. One of them is Python Programming 101 at P2PU. And actually there’s a lot of additional information there. For instance, there’s a list of Python compatible text editors. What I like best about it is peer reviews of the editors they tried. So I’ll have to save this for the future:

But for now I’m using IDLE, because I don’t have enough time to try all of them right now. Although I’ve installed Notepad ++ just in case.

Also I’m looking forward to getting involved in OpenStudy communication, but I haven’t yet, because I’ve been a bit overloaded (like a + operator) with work.

Making my presentation – part two

(Part one is here)

After I had my draft structure done I had to distribute the content along a 10-minutes’ timeline, because I had only 10 minutes for my presentation. Actually, I had 10-12 minutes, but I decided to leave 2 minutes as a reserve in case something goes wrong.

Now the process of distributing all I wanted to say properly was a real challenge. In order to make it easier, I first drafted a timeline in my notebook.

timeline

Then I typed the text word by word and tried to read it with a stopwatch. Although I managed to fit it into the time frame (at the third attempt), I realized that I have to make it even shorter and, what is most important, to get rid of syntactically complicated constructions. So I ended up having a text divided into parts according to my presentation slides with 3 to 8 sentences for each slide.

Ah yes, regarding slides. Well, I decided not to use the colour scheme I was testing in the previous post, because it seemed to me boring. Instead I took this one by plamenj, which looks like this:

2013-06-23 01_41_53-COLOURlovers.com - Gamebookers

And here’s my presentation at Slideshare (actually longer than it used to be, because I split the animated slides made in PowerPoint into separate slides, as Slideshare doesn’t read animation).

It is originally in Russian of course, but I translated it.

Also, thanks to Jakes from my wonderful Team 10, because he sent me very helpful materials regarding designing presentation. And thanks to Irina (from the same team among all) for also sharing materials and generally being extremely encouraging.

By the way, I found out that PowerPoint and SlideShare are badly compatible. So I had to do some extra editing to make it look similar to its initial ppt version. Maybe next time I’ll try playing with Google and Libre Office equivalents, as well as Presi.com. But hopfully, not too soon, because I want to get back to the wonderful Python MOOC, which has already begun. The 1st week’s tasks don’t look too challenging, but there’s a bunch of some new information that I want to digest before I receive the next portion of tasks.

Preparing the first presentation in my life

This is supposed to be a complaining post. But I’ll also try to make it somehow useful at least due to the links to helpful resources I find on the way. Now, to the point. As I have already mentioned (more than once, I think), I hate visual stuff. And presentations today are all based on slides, so I’ve got to not only think about the structure and opening and closing and hooks for the audience, but also about making some decent background for my presentation.

So, learning again.

A couple of words about the circumstances. I’ve got to prepare this presentation for a conference on social computing that takes place in Moscow this Friday (on 21 June) and my topic is data journalism. Although I’ve got, say, 3 days ahead, I’m very short of time, because during these days I’ll also have to work and learn etc. So my most immediate target is to make at least a draft presentation to have some back-up in case I’m overwhelmed by work during the week.

So, first thing I did, I went web-hunting to find some tips on what to do. And here’s what I’ve found instructive so far.

Now, in order to start the process, I decided to create some structure. And in order to do this, in turn, I first put down some information blocks in order to later arrange them more logically.

Here’s what I’ve got in the end:

data_journalism_copy_small

Feel free to see this monster full-size.

And I was actually testing this palette by GlueStudio (which I downloaded from ColourLovers I mentioned above).

2013-06-18 03_02_33-COLOURlovers.com - Terra_

OK, next I’ll have to fit all this into like 5 slides (I’ve got no more than 12 minutes for my presentation).

Getting started with Python MOOC

idle

Finally I seem to have pulled myself together and started following the instructions of the Python MOOC, which officially begins on 17 June, but has already started sending some tasks for preparation. And they actually turned out to be rather instructive for me. For instance, after about a month of toying with Codecademy, I had a very vague idea of how to work with IDLE. I mean, I tried it, but it didn’t make much sense and I didn’t get into details, because I was quite happy with Codecademy Labs at my disposal. And I also found out that IDLE stands for “Integrated DeveLopment Environment” (but still I suspect it has something to do with Eric Idle from Monty Python Flying Circle). Also, I know there are several versions of Python, but I still can’t understand what it really means. Well, hopefully, I’ll find out later. Right now I had to install Python 2.6 (instead of 3.0 I installed previously), according to the course requirements.

What has been a really bad experience so far is the way to calculate square root by way of raising a number to the 0.5-th power. This procedure just won’t fit into my mind. Not yet anyway.

Now, I’ll just post here some links in order to save them:

Design troubles

I must admit I don’t like infographics. I feel genuinely jealous when people look at a picture and find it more revealing and comprehensive than text, because I never do. I even thought I might need a special tutorial on how to read infographics. I’ve seen quite a number of online instructions about how to read newspapers or how to make yourself read a text on the Internet. I’ve got no problem with it. And having been rather far from design issues until recently, I didn’t bother about ‘reading’ pictures at all. But now, it’s another story, as I’m trying to study data journalism. And data journalism, among all, presupposes visualisation. Not necessarily of course, but still I must learn some basics. Besides, I must learn how to ‘read’ others’ work. In order to do so, I need at least to try using some design elements for expressing or illustrating my ideas from time to time. And not only when it comes to data visualisation as such.

Thankfully, there are people who are willing to share their knowledge. So, when I saw this post by Denise Cheek I took it as a challenge. She actually posted her awesome Creative Process Cheat Sheet and asked her audience what their creative process looks like. Although the easiest way for me would be to simply describe the process word by word, I decided to make it in a kind of a similar cheat sheet format, whatever awkward the result might be. Which I actually did (see below). Not that I really enjoyed the process or the result, but at least I tried. Denise, thanks for providing me with a task.

Now, if someone has ever faced similar problems, please share your methods to deal with them. If, on the contrary, you like infographics, it would be great to hear how exactly you read it.

process2