Skip to content

Tag: python

Could this selenium code be recreated using scrapy?

I’m interested in getting a better idea of what scrapy can do. Here is a very simple selenium code that interacts with a website, fills in some boxes, clicks some elements and downloads a file. Could this code be replicated using scrapy?, so that a code is written using scrapy that does the exact same t…

Merging pandas get_dummies back to categorical values

I have a pandas dataframe which I have one hot encoded with get_dummies, the data previously had a ‘type’ column which contained the values small_airport, large_airport, medium_airport, I split the type column in to each different type of airport with 1s and 0s where the frequencies matched. After…

Can yfinance download 2 columns only?

Right now, I want to download historical prices for some tickers but I don’t need the full download, only the date and close price. Currently I am doing this way : As you can see, I download the whole “package” then delete the useless columns. The future problem with this way is : if I need …

How to draw rectangles from a list in pygame

It says rect argument is invalid but when I give the same rect without a variable it works, here is the part of a code responsible for it I also tried self.obstacleses(0) in pygame.draw.rect but then i get list object is not callable. Answer You have to draw the rectangles in a loop: