Python Day 56 – regex and datetime

Today I did some more regex crosswords. Still couldn’t figure out the one that stumped me yesterday, although I managed to do a few more until I reached this one which is currently stumping me: So then I moved on into this worksheet for wrangling time series data… I learned: To import datetime. The basicContinue reading “Python Day 56 – regex and datetime”

Python Day 55 – regex crosswords

At first I thought the regex crosswords problems were way too hard. I had no idea what was going on, but for some reason I kept getting them right. I then realized that it was much simpler than I thought and I was actually thinking about them correctly. I subsequently realized I was doing theContinue reading “Python Day 55 – regex crosswords”

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”