« first day (1836 days earlier)      last day (1529 days later) » 

5:49 AM
I am having a list of labels and categories. Each category can have multiple lavels. Is there a data structure/function in python that when given an input value (label) returns the category?
 
you mean a data structure that maps labels to categories?
hm....
 
For example I can have a dict with key as category and value as list of its labels
Then use an IF loop with logic to return category for the input label. Just wondering if there is a better way
 
I was going to say "no" unless you mentioned "an if loop with logic".
 
Or dict with key as label and value as category?
Then write an if loop to return the value(category) for the input label
Just thinking if there is another nice way
Sorry no need of if loop when label is key and category is value . Guess i got my answer
 
 
1 hour later…
7:24 AM
10 messages moved from Python
 
 
2 hours later…
8:56 AM
Hey , guys can someone help me in my question stackoverflow.com/questions/60445521/…
 
 
2 hours later…
10:45 AM
i have list of some rows of IDS which is the 1st element of each row in this case there is only 507 & 1

rows = [['507', 'W', '1000', '1'],
['1', 'M', '6', '2'],
['1', 'W', '1400', '3'],
['1', 'M', '8', '8'],
['1', 'T', '101', '10'],
['507', 'M', '4', '12'],
['1', 'W', '1700', '15'],
['1', 'M', '7', '16'],
['507', 'M', '8', '20']]

There are 2 cases if Letter W is come for all the rows start with 1 then it find the maximum number and minimum number from the 3rd value e.g. for row start with 1 after W there is 1400,1700 find the max and min number from them and if Letter M is come for ID 1 t
 
did you just dump the question from SO you were specifically informed not to announce here so soon?
 
11:27 AM
2 messages moved from Python
 
1 message moved from Python
 
 
3 hours later…
3:01 PM
Is adding new JSON fields (existing fields unchanged) a breaking change?
 
1 message moved from Python
 

« first day (1836 days earlier)      last day (1529 days later) »