I am pretty new to ML and completely new to creating my own models. I have went through tensorflows time-series forecasting tutorial and other LSTM time series examples on how to predict with multi-variate inputs. After trying multiple examples I think I realized that this is not what I want to achieve. My pr…
Tag: python
Merge two rows and put the results in the same columns
I would like to join two files by key but I would like some columns to be joined together for example: File1: File2: I would like to merge with primary key List (from file1) and Cod (from file2), to get: I think we need something like a left join and an agragation but I don’t know how. In the final
How to press button?
I’m pretty new with the selenium module in python and I’m not able to press a button. Here the HTML-Code: Here’s a minimal example: what am I doing wrong? Context I want to automatically select the language of the website. Answer It seems to be your locator strategy is correct. You can short…
Python: need efficient way to set column value based on another column value
New Python user here, so I appreciate any ideas for best practices in addition to the issue I’m seeking advice on. I have code that works for a small number of records, but when I run it on a large dataframe, it takes too long. I’ve done a lot of reading on this issue, and there are several simila…
python manage.py collectstatic error: cannot find rest_framework bootstrap.min.css.map (from book ‘Django for APIs’)
I am reading the book ‘Django for APIs’ from ‘William S. Vincent’ (current edition for Django 4.0) In chapter 4, I cannot run successfully the command python manage.py collectstatic. I get the following error: I have the exact same settings like in the book in settings.py: I couldnR…
simple Neural Network gives random prediction result
I have been trying to build a simple neural network myself (3 layers) to predict the MNIST dataset. I referenced some codes online and wrote some parts my own, the code runs without any errors, but something is wrong with the learning process. It seems like the prediction result is all “random”. A…
My code caused the kernel to restart. Why is the kernel restarting?
I wrote this for python code and got an unexpected output. The output was a number of zeros then it said “restarting kernel”. Why is the kernel restarting? On the other hand, I tried with if and there was no problem: So why is it not working with for? Answer In your code above, each function call …
pytube (python) video stops playing video after few seconds
I have been using pytube to create my youtube video downloader and after the video is done downloading and compiling and i play it, it plays for only a few seconds then just displays a still image while the audio continues in background These are the functions in file “module.py” And this is the &…
Select Rows Based on Time Difference [Before or After] In Columns
I have the following dataset of students taking 2 different exams: I want to select those students whose two exams are 10 days apart from each other in either direction. I am trying Timedelta, but I’m not sure if it’s optimal. Desired Output: Is there any better way of getting the desired output? …
vscode + python + interactive mode + variable explorer slow and inaccurate
I’m trying to switch from Spyder to VScode in order to integrate git into my workflow. However I’m running into some (I think related?) issues that I’d love some help with. Interactive mode and the variable explorer can take up to 20 seconds to define a=5 the variable explorer really struggl…