Skip to main content

My second try on the Titanic problem

Titanic 2 - New try

Comments

Popular posts from this blog

Unwrapping someone's face to make wrapping paper

Unwrapping someone's face to make wrapping paper My first step image processing with OpenCV for Python So this last weekend I was pretty bored at home with nothing to do and no one to climb with. During the last days, I made a Twitter bot and I had quite a lot of fun doing it. After some research of the most useful or popular libraries in Python I came across OpenCV, which seems to be a very powerful library for image processing and many other much more complex things. I decided to give it a try and remember watching this William Osman's video. He explained more or less the process to create his code and even made his code public in his blog, well he was using a library called PIL but I wanted to learn to use OpenCV so it served for nothing. So well here is my code and a brief explanation of what it does. Be gentle, I am a newbie, I do this to amuse myself as I find it quite entertaining and educative. import cv2 as cv import numpy as np video = cv.VideoCapture( 'C:/Users/U...

Advent of Code, day 2

We made it to Day 2 of Advent of Code I have kept my promise for 2 days in a row. As weird as it seems for this day and age, I have kept my promise and today is the day 2 of the Advent of Code, this time with elves involved. There you go, the statement of today's first problem down below: And usual, my solution: import pandas as pd import re import numpy as np filepath = "/content/input 1.txt" with open (filepath, 'r' ) as file :     lines = [line.strip() for line in file .readlines()] lines_split = [] for line in lines:   token = re.findall(r '\w+|[^\s\w]' , line)   lines_split.append(token) blue_list = [] green_list = [] red_list = [] for line in lines_split:   blue,green,red = 0 , 0 , 0   for ix, word in enumerate (line):     if word == "blue" :       if blue < int (line[ix -1 ]):         blue = int (line[ix -1 ])     if word == "green" :       if green < int (...

Web Scraping to feed @CastroTiempo Twitter Bot

Web Scraping to feed @CastroTiempo Twitter Bot A program that crawls a webpage, grabs some weather information of my city, and then feeds a Twitter bot (@CastroTiempo) I also coded by myself. Tweets by CastroTiempo Follow @CastroTiempo This week's entry is dedicated to something I learnt some weeks ago and that I wanted to implement in any of my projects but that until now I didn't have any idea worth spending my time on (not saying that this one was). It will be tweeting for some time, I have not decided how much time yet, I have a "computer" dedicated to run the code forever, so it's basically until: I get tired of it or Don't get much feedback or  There is an error in the code that makes it stop (this one will likely happen the first one) or I pull the electric cord and the "computer" switches off (I guess this is the second most probable one) or * Follow @CastroTiempo So I ...