Search found 7 matches
- Fri Nov 18, 2016 11:55 am
- Forum: General Discussion
- Topic: How to compare list and dictionary in Python???
- Replies: 2
- Views: 3340
- Fri Nov 18, 2016 11:24 am
- Forum: General Discussion
- Topic: How to compare list and dictionary in Python???
- Replies: 2
- Views: 3340
How to compare list and dictionary in Python???
dictionary = {0: 'zero', 1: 'one', 2: 'two', 3: 'three'}
list1 = [zero, one, two]
I want to delete the entry '3:three' from the dictionary since it is not in the list. I am retaining only the common entries in the list. How can I do it???
list1 = [zero, one, two]
I want to delete the entry '3:three' from the dictionary since it is not in the list. I am retaining only the common entries in the list. How can I do it???
- Thu Oct 27, 2016 10:17 am
- Forum: General Discussion
- Topic: datetime error in Python
- Replies: 1
- Views: 2563
datetime error in Python
I had an error when I execute the following code: format = '%m/%d/%y/%H:%M:%S' t = datetime.strptime(result[a][b], format) ### result [a][b] contains a string I use %y because the year contain only last two digits. This code works perfectly for all cases except those in which day and month are the s...
- Tue Oct 25, 2016 6:48 am
- Forum: General Discussion
- Topic: SetValue method in GridTableBase wxPython
- Replies: 2
- Views: 3101
- Mon Oct 24, 2016 11:05 am
- Forum: General Discussion
- Topic: SetValue method in GridTableBase wxPython
- Replies: 2
- Views: 3101
SetValue method in GridTableBase wxPython
Can anyone tell me how to redefine the method 'SetValue()' of wx.PyGridTableBase ???
- Tue Oct 18, 2016 7:24 am
- Forum: General Discussion
- Topic: count occurence in a list of lists in python
- Replies: 2
- Views: 3270
- Mon Oct 17, 2016 11:42 am
- Forum: General Discussion
- Topic: count occurence in a list of lists in python
- Replies: 2
- Views: 3270
count occurence in a list of lists in python
while i < len(list): top = list[i][0] s = 0 c = 0 while s < len(list): if top == list[s][0]: c = c + 1 s = s + 1 count.append(c) r=r+c Here I have a list called 'list' Its contents are: [['aaa','a','ssssss'], ['ddd','a',ssss']] I want to count occurenec of each element in th...