I’m working on a Flask app to return a zip file to a user of a directory (a bunch of photos) but I don’t want to include my server directory structure in the returned zip. Currently, I have this : This works great for creating and returning the zip but the file includes the structure of my server …
Tag: python
Upload multiple files pandas
I need help, I can’t figure out what I need to do. The task is as follows, I need to be able to select multiple xlsx files and convert them to csv. In my code I got the ability to do this with only one file. I hope for your help and advice. Thanks Answer Without option no_window=True, it will
Need to add an element to a set and I need the resulting set to be returned
I see that the ‘+’ operation is not supported in sets but supported for lists If I add an element to set using .add() func it modifies the original set but doesn’t return the result instead returns None type object. I don’t want to modify the original set but I just need the resultant …
How to extract a segmented object or change the background of the original image?
I am doing a detection with Mask R-CNN of one model available at Train Mask R-CNN for Image Segmentation. Code I First attempt After training I tried to change the background color of the image using the code available at Change the Background of Any Image with 5 Lines of Code. Although it is working, it is n…
Show names of positional arguments inlayed
I’ve recently been doing some programming in Rust using Clion. This provides a utility whereby when you pass positional arguments to a function it will show you which argument will pick up each value (as if you had passed them in as keyword arguments) see below: I’ve found this to be a very nice f…
How to use a dictionary to modify an array in python
I am trying to use a dictionary (created by reading the content of a first file) to modify the content of an array(created by reading the content of a second file) in order to return as many modified arrays as their are keys in the dictionary with the modification corresponding the position and change in the …
Update pandas cell in one dataframe from looked up value in second dataframe
Update pandas cell in one Dataframe from looked up value in second Dataframe I have a case where I need to update a cell in one Dataframe, ‘Stock’, which holds records of stock on-hand, looking up its value in a second Dataframe, ‘Items’, which is the table of all items. This is a simp…
How would I sort averages by row and/or column of an array?
I’ve been having trouble with finding the average of an array of lists, specifically by row and by column. I know what I want to do with it, but I’m struggling with finding what kind of code to write for it. The array is as follows: By row, I want to essentially find the averages of each individua…
How to datetime parse a non-standardized time format
I would like to create datetime objects from a list of string timecodes like these. However, parse interprets incorrectly for my use case. The list above comes from YouTube’s transcript timecodes. When copied from the site, they use a variable format to designate hours, minutes, and time, based on elaps…
get the number of involved singer in a phase
I have a dataset like this name date singer language phase 1 Yes or No 02.01.20 Benjamin Smith en 1 2 Parabens 01.06.21 Rafael Galvao;Simon Murphy pt;en 2 3 Love 12.11.20 Michaela Condell en 1 4 Paz 11.07.19 Ana Perez; Eduarda Pinto es;pt 3 5 Stop 12.01.21 Michael Conway;Gabriel Lee en;en 1 6 Shalom 18.06.21 …