Python Day 43 – pandas indexes and augmented assignment

Technically I finished the Pandas module today although I’m learning more and more that there’s a lot I have yet to understand about Pandas hah.

I learned:

You can .set_index(“column name”) of a dataset so the index number becomes any column you choose.

Augmented assignments are a more efficient way of formatting code (usually by combining the operation with an equals sign so it avoids you writing a variable name twice). For instance, instead of writing:

guesses = guesses + 1

…one can write:

guesses +=1

I don’t completely understand how this works in other instances (like with +, *, etc) yet, but I will figure it out sometime soon.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: