So the problem is this: Design a program that asks the user to enter a store’s sales for each day of the week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week and display the result. This is what I have so far, I know it’s in issue with bounds,
Check value of yaml child -Python
Hey guys I have two yaml files. One yaml with jobs and ther information as childs. other yaml (yaml2) with requirements: and I want to check if the value of the Child “stage” is the same as in the requirements in my code the father node must be generic so it can be different jobs. But it can have …
When i hit the “PUBLISH COMMENT BUTTON” the comments does not get posted in my frontend in django
i am making a comment section in django but when i hit the comment section the comment does get published to the comment section of my website it just refreshed the page and does nothing but when i add a comment from my backend which is the admin section it works perfectly fine and get updated in my front end
Am I able to use AWS EventBridge (or alternative) in order to re-run a lambda after an hour if the past one fails?
I have written a lambda using Python which is dependent upon external APIs which can occasionally go down. This is triggered once a day using EventBridge to gather data from yesterday, and updates a file in S3 at the same time every day. I was wondering how I would be able to re-run the Lambda, which includes…
Using PyTorch tensors with scikit-learn
Can I use PyTorch tensors instead of NumPy arrays while working with scikit-learn? I tried some methods from scikit-learn like train_test_split and StandardScalar, and it seems to work just fine, but is there anything I should know when I’m using PyTorch tensors instead of NumPy arrays? According to thi…
How to get multiple images from Flask request object at once in case of Content-Type:multipart/form-data?
I’m supposed to get multiple image files from the requests, but I can’t find a way to split a byte string request.files[key].read() properly to make np.ndarrays out of them. Answer files[key] gives only one object which has name=key in HTML, and .read() gives data only for this single file. So the…
Find center of blocks of ones in an 2d array
Lets assume I have the following array and want to get the center of each block of ones, so that I can get the following array: I already thought about using means or convolutions, but I couldn’t think of a really simple solution. One in efficient solution that I found is: Answer This is a little less i…
Python project – Writing contents of .txt file to Pandas dataframe
I’m currently working on a Python project where I want to: Loop through subdirectories of a root directory Find .txt files with names starting with ‘memory_’. Txt files are: newline-separated, lines consist of: ‘colName: Value’ pairs. Like this. Appending the contents of the .txt…
Discord.py creating a reaction game
What I’ve tried StackOverflow articles Need help to fix a certain bug in rock, scissor and paper. discord.py documentation How can I add reaction to a message (checked plenty of articles, but I’m not going to add them in order to get into the point) I’ve managed to retrieve the emoji from th…
How to add prefix to the selected records in python pandas df
I have df where some of the records in the column contains prefix and some of them not. I would like to update records without prefix. Unfortunately, my script adds desired prefix to each record in df: How can I ommit records with the prefix? I’ve tried with df[df[‘ids’].str.contains(prefix)…