In-class discussion: Introductory workshop

hey @PranY do i need to create my own custom ami to install my anaconda env on aws instance?

has anybody else not heard back from paperspace yet? It’s been about 2 hours since I signed up and tried to create a machine . . .

I just got approves 5 min ago . So have patience.

I understand your concern and to a great extent python code is not written in this manner. In fact PEP8 is strictly followed in almost all python scripts/codes.

However, for DS, we often experiment with small data in a very ‘loosely’ formed syntax which is quick and easy to read. So, a numpy/pandas initialization and printing in the same line is a hack. After we have developed a code that does something meaningful, we remove those print() calls from the code and convert it to script. So its only about saving time and not writing print(something) in the next line and saving some screen real-estate to view more code.

1 Like

Thanks :slight_smile: Was just worried!

I am also waiting. No emails (yes, I checked junk) and no access at all. Not sure if we needed to be on the spreadsheet to get access. Somehow my entry on the classlist spreadsheet keeps “disappearing” but I am on the AWS spreadsheet. No issues with any of the other sign ups for today.

I think Eric is suggesting that this does not follow PEP8 style guidelines, and is not a good template for new users to follow.

I’ve just got a working paperspace machine and I can ping the public address.
I’ve started a notebook server but I can’t login from my pc. Maybe changing the default port will help.

I created a custom AMI to make it work, I didn’t think of any other way.

1 Like

I would recommend it for jupyter notebooks, unless you’ll get in trouble with your colleagues :slight_smile: Software eng practices and jupyter notebook data science practices need not be the same.

Jeremy

3 Likes

Anyone tried Jeremy’s class example successfully, if so can you see what error I have made in my attempt?

class Hello():
def init(self, to_say):
self.to_say = to_say

def say_it(self):
    print(f'hello {self.to_say}')

In [17]:

h = Hello()

TypeError Traceback (most recent call last)
in ()
----> 1 h = Hello()

TypeError: init() missing 1 required positional argument: ‘to_say’

Totally agree…just trying to clear up some earlier confusion!

@chris_palmer I think you need to put something in the parentheses

You’re missing the parameter to Hello(). It should be Hello('jeremy') for instance.

Just close the paperspace tab(s) in browser and login again. I think its done by now. I did the same when mine’s was showing inaccessible.

Link for the presentation?

2 Likes

init requires ‘to_say’ parameter.

try
h = Hello(‘world’)
h.say_it()

__init__ 

Had to specially format it to show properly

Change h=Hello() to h = Hello("some_string")

When you call Hello(), internally python is calling __init__() method. __init__ method expects two arguments self and to_say. self is automatically passed by python and you need to pass value to to_say.

1 Like

The default constructor in Python is __init__ and not init.