Today I continued working on SQL… I learned: To count up certain values or the number of variables in a column, one can use COUNT(*), and attach “AS new_category_name” to create a new category with the count! This was useful in the example data of Nobel laureates to count how many prizes each country won.Continue reading “Python Day 46 – more SQL”
Category Archives: Python Learning
Python Day 45 – progress on SQL!
Today I didn’t think I’d get much done but I actually felt like I understood the bare basics of SQL! I learned: Use * to select all columns from the data. To use a pandas dataframe use the .read_sql() function. I also learned the basics of SELECT, FROM, and conditional statements (for instance how toContinue reading “Python Day 45 – progress on SQL!”
Python Day 44 – intro to databases
Happy 2022! Today I briefly went over databases and learned that SQL is a language that allows us to communicate with relational databases. I didn’t get far today cause I’m spending time with the family but that’s that for now!
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 byContinue reading “Python Day 43 – pandas indexes and augmented assignment”
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!”
