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 byContinue reading “Python Day 43 – pandas indexes and augmented assignment”
Tag Archives: coding
Python Day 42 – more pandas
Went through some more intro stuff with Pandas today… I learned: To import a CSV file with the pd.read_csv(“file path”) function. One can look at the shape of data with .shape operation (yay numpy!). To show data in reverse order put .sort_values(ascending=False). I’m still confused on: What exactly is the significance of figuring out theContinue reading “Python Day 42 – more pandas”
Python Day 41 – Pandas!!
Today I worked on a different course curated by my fantastic friend. We started out by going over broad view of the data science process, and delved in a bit with obtaining data and pandas. I learned: A majority of data science is collecting and cleaning data. Pandas is a module that allows for easierContinue reading “Python Day 41 – Pandas!!”
Python Day 40 – random numbers and infinite guesses
Today I learned how to generate random numbers with the random model. You set a variable with a range equal to: random.randint(low#, high#) I used this in a practice exercise with the while loop to have a user input guess a randomly generated number until they get it right. Here’s the code: highest = 10answerContinue reading “Python Day 40 – random numbers and infinite guesses”
Python Day 39 – while loops
Today I learned that while loops are the same as for loops except they continuously run until a condition is met. So one must be extra careful to use break or other criteria for certain while loops otherwise they’ll continue to run forever! This could be very useful for the choose your own adventure story.Continue reading “Python Day 39 – while loops”
Python Day 38 – iterating ranges and continue/break
Today learned that you can quickly print out a lot of numbers with loops and a range() function. You can also nest for loops inside of loops! The basic example I got for this was to create a multiplication table, but I assume there will be many more uses for this. We also delved intoContinue reading “Python Day 38 – iterating ranges and continue/break”
Python Day 37 – loops!
Today I learned how to take out irregular separators from a string of numbers and return an integer value. First you need to define a variable separators, then use a for loop to go through the list of numbers and reassign the non numeric values to the separator variable. number = “9,234:233:212 4321,432:212” separators =Continue reading “Python Day 37 – loops!”
Python Day 36 – truthy truths in and not in
A “truthy” truth are various ways to get boolean True/False from other variables. For instance, 0 is false and 1 is true. If there are no string or other values inside () or {}, it will evaluate to false. One can use “in” to detect whether a certain character is inside a string. This canContinue reading “Python Day 36 – truthy truths in and not in”
Python Day 35 – you can not a boolean??
Today my Udemy course went more in depth with “and” and “or” inside if statements. I learned that one can use greater than (>) or less than (<) signs to determine whether a line prints, and that you can combine multiple of these together. I also learned that you can put “not” in front ofContinue reading “Python Day 35 – you can not a boolean??”
Python Day 34 – making a decision tree
Today I started doing some groundwork for a potential mini narrative choose your own adventure coded story. I got stuck for a bit trying to figure out what story to write, but then decided that it was better to just start writing something very rough to practice the coding. So here’s the super random codeContinue reading “Python Day 34 – making a decision tree”
