Python Day 54 – intro to regex

Went through some tutorials for regex today… I learned: \d can be used to replace any digit from 0 to 9 . is a wildcard To use normal period. use \. To specify characters use [] ex: [abc]an To match any value that starts with a or b or c, and ends in β€˜an’ ToContinue reading “Python Day 54 – intro to regex”

Python Day 53 – Pandas array operators

Update from yesterday’s problem: to take the mean one simply needs to call which column first, for instance data[‘column_name’].mean(). Today… I learned: How to use basic string operators in arrays with pandas. I learned that one just needs to specify a column, and the add the .str attribute to whatever operation they want to do.Continue reading “Python Day 53 – Pandas array operators”

Python Day 51 – formatting .txt in Pandas

Success! In a matter of minutes I solved the problem that was vexing me yesterday. I sense a pattern here… yay for a fresh mind. I learned: When getting data from a .txt file, one can still use the pd.read_csv function. The issue I was running into yesterday was that it was reading the columnContinue reading “Python Day 51 – formatting .txt in Pandas”

Python Day 50 – Pandas practice problems

Today I practiced importing various data into Python with Pandas, and looking at it in different ways. I learned: To use the pd.read_csv(“folder/data_name.csv”) command to define a dataset from an outside source. And then use .sort_values(by = ‘category’, ascending = False) to sort the values however I wish. Also to chart data, use the df3.plot(xContinue reading “Python Day 50 – Pandas practice problems”

Python Day 49 – finishing my SQL practice problems

It took me less than 2 minutes from sitting down at my computer to solve the practice problem that had completely stumped me yesterday. I guess time does heal all wounds :’) I learned: In general in SQL, but especially when joining two tables, the ordering of commands matters. The main issues I was runningContinue reading “Python Day 49 – finishing my SQL practice problems”

Python Day 48 – the roller coaster of SQL

I started off the day very frustrated. The smallest syntax errors were messing me up. I learned the hard way to always put a comma after SELECTing a category in SQL, and to make sure to put a backslash if I’m separating lines. After these initial frustrations I was almost ready to put the computerContinue reading “Python Day 48 – the roller coaster of SQL”

Python Day 47 – oof

Today was a day of frustration. Mostly conceptual frustration. Before we get to that though. I did learn some stuff… I learned: In SQLite one can ORDER BY category_name DESC to order the data by that category. One can also JOIN tables together. There are three types of joining: INNER JOIN, LEFT JOIN, and OUTERContinue reading “Python Day 47 – oof”

Python Day 46 – more SQL

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”

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!”