Alright folks, so today I’m gonna walk you through this little project I did – digging into Riga’s October temperatures. Nothing fancy, just a bit of data wrangling and plotting. Let’s dive in!
First off, I grabbed some historical weather data. Found a few different sources online, but ended up using one that seemed pretty reliable, you know, with actual numbers and not just someone’s guesses. I’m not gonna say exactly where, because who knows if they’ll stay up, but a little digging and you’ll find something. The data was in a kinda messy CSV format, typical, right?

Then, I fired up Python. Gotta love Python for quick and dirty data stuff. I used pandas, naturally, to read the CSV into a DataFrame. That’s where the fun began. The dates were all weird, so I had to clean them up and convert them to datetime objects. I used *_datetime()
, and it mostly worked, but there were a few oddballs I had to fix manually. Pain in the butt, but what can you do?
Next, I filtered the data to only include October months. I created a boolean mask based on the month and used that to select the relevant rows. I also checked for missing values, because those are always a pain. Luckily, there weren’t too many, so I just dropped the rows with NAs. Not ideal, but good enough for this little experiment.
After that, I calculated some basic stats. Average temperature, max temperature, min temperature for each October in the dataset. Super simple stuff, just .mean()
, .max()
, and .min()
on the temperature column. I also calculated the average temperature across all the Octobers. I just wanted a general idea of what to expect temperature-wise.
Finally, the fun part: plotting! I used matplotlib to create a line plot of the average October temperature over the years. I added labels to the axes, a title, and a legend. I also added a horizontal line at the overall average temperature, just to see how each year compared. The plot looked pretty cool, showed some year-to-year variation, but no crazy trends or anything.
I also tried a boxplot. That was kinda interesting. It showed the distribution of temperatures within each October month. You could see the median, the quartiles, and any outliers. Used seaborn for that, because it’s just a bit prettier than matplotlib’s boxplot.
Ended up saving the plots as PNG files, just in case I wanted to show them off later. And that’s pretty much it! It wasn’t anything earth-shattering, but it was a fun little exercise in data analysis. And now I have a better idea of what kind of weather to expect if I ever visit Riga in October. Maybe I’ll pack a jacket, just in case.
Lessons learned: data cleaning is always the most time-consuming part, and Python is your friend. And always double-check your dates!
