Python Day 24 – functions and datatypes

I started out today trying to do some HackerRank numpy array challenges, but quickly realized that I have a lot more to learn before I should do them. I understood the concept but the syntax was killing me. So I watched a basic YouTube video and learned a few lil things.

I learned:

Float64 and Int8 are to do with the size of files in Python, and Float64 is the base type. In Numpy, some functions operate in place (meaning they directly affect the defined variable), whereas other functions need to be used as the definition for a new variable. For instance np.random.shuffler(arr) forever changes “arr” to be shuffled, but np.reshape will only reshape it in that instance, and one needs to set arr = np.reshape for it to be saved.

Also conceptually I’m getting a better understanding that functions use parenthesis, and .size and .shape are not actually functions! Who woulda guessed.

I finally asked my friend who showed me the simple solution to running all the code when I open a Jupyter notebook is to press the top menu “Kernal” and select “Restart and Run All”. I’m so excited about that!

A little thing I shall soon learn:

Syntax. I know it’ll come with practice and experience but man am I excited to not spend 15 minutes searching for the smallest syntax errors.

Good learning everyone!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: