With Python and Plotly I need to create one plot with 2 lines (for a and for a): However I am getting the following: How to solve this? Answer The data need a title or label. My example uses a pandas dataframe:
Tag: python
tkinter – How can I place this button on the bottom in the middle?
I would like to place the button boutonexcel at the bottom of the window, in the middle (below both frames). I tried many combination of side=… and anchor=… without success. How could I place it as I wish? Answer In this specific case, if you call pack on the button before any other widgets, and y…
Updating boxplot when choosing rows
I need to allow users to choose particular rows in a data frame and generate a boxplot. My implementation does not allow me to update a boxplot when I choose rows. Can somebody please point out what I do wrong? I am interested in only one column which is [‘Phase’]. Here is my implementation. Answe…
How to search by dict keys in ElasticSearch
I am new in elasticsearch and I need to write query described below I have an elasticsearch index with documents like this one Numbers mean entries of words in book I want to search documents by words “cats” (not “cat”), “monkey” and e.g “mous”. How do I write q…
How to rotate a rectangle/bounding box together with an image
I’m working on a data augmentation and im trying to generate synthetic version of every image in my dataset. So i need to rotate images and together with bounding boxes as well in the images. im only going to rotate images by 90, 180, 270 degrees. I’m using pascal-voc annotation format as shown he…
403 Forbidden error when getting cat images
I just finished programming a dog photo program, and after a few issues it works fine. I decided to make a modified version that uses a different api to give cat images instead. It took a second to figure out but after changing the format, I get this error: urllib.error.HTTPError: HTTP Error 403: Forbidden Th…
stable match algorithm for different sizes groups and limited places
I want to write a program that oriented student to their specialty in university depending on their choices and their range in the specialty. each specialty can take multiple student (in this case cnm =1 , dsi=2 , rss=2),and the number of student can be more than the number of places (in this case one student…
Remove rows in a group by until the last row meets some condition
I have the following df We can assume that this data is already sorted. What i need to do is, for every id, I need to remove rows under the following conditions the first entry for every id is type A the last entry for every id is type B the last entry’s B is the last one that appears
How can I get top 5 inventory items from a django model which has lowest quantity?
#This is my inventory model. I want to get the inventory items that have the lowest quantity in the model. Answer To get a number of results with the lowest or highest value you first order by that field order_by(‘quantity’) so that the results you want will be first, then you can slice the querys…
validation of words in a sentence
I am trying to set validation for given sentence (input). These are criteria Word contains letters, hyphens and punctuation only (no digits) Maximum number of hyphen is one per word. If present, hyphens must be placed between letters (“ab-ab” not “-ab” or “ab-” Maximum numb…