Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: The list length should be 100 but it is more than 100
Post: RE: The list length should be 100 but it is more t...

okay. This for is not necessery here. It is sorted out
quest General Coding Help 1 105 Jul-30-2021, 09:24 AM
    Thread: The list length should be 100 but it is more than 100
Post: The list length should be 100 but it is more than ...

Hello, I am trying to produce 100 different names (names should be unique) and I wrote this simple code: import names parties=[] nss=100 while len(parties) < nss: for i in range(nss): ...
quest General Coding Help 1 105 Jul-30-2021, 09:12 AM
    Thread: Put zero for x axis values
Post: RE: Put zero for x axis values

okay, problem has been solved: for k,v in list(od.items()): print(k,v) finalarray[k]=v
quest General Coding Help 4 133 Jul-29-2021, 01:32 PM
    Thread: Put zero for x axis values
Post: RE: Put zero for x axis values

(Jul-29-2021, 01:59 AM)Larz60+ Wrote: I think what you wanted was (line 1): od = OrderedDict([(0, 1), (1, 1), (3, 1), (7, 1), (36, 1)])and assuming this code is in same script: finalarray=np.zeros(6...
quest General Coding Help 4 133 Jul-29-2021, 09:49 AM
    Thread: Put zero for x axis values
Post: Put zero for x axis values

Hello, I have this dict: od = OrderedDict([(0, 1), (1, 1), (3, 1), (7, 1), (36, 1)])And I am plotting this array with the following line: plt.bar(range(len(od)), list(od.values()), align='center') pl...
quest General Coding Help 4 133 Jul-28-2021, 11:03 PM
    Thread: Make Groups with the List Elements
Post: Make Groups with the List Elements

Hello, I have pairs list: pairs=[[A,B],[C,D],[Z,X]]And I have also a queue list which is includes: queue =[A,B,C,D,E,F,G,H,I,Z,X,J,K,L]And I want to make groups from list queue and this groups should...
quest General Coding Help 2 230 Jul-11-2021, 08:35 AM
    Thread: I cannot delete and the elements from the list
Post: RE: I cannot delete and the elements from the lis...

(May-11-2021, 10:51 AM)perfringo Wrote: Python documentation, The return statement: Quote:return may only occur syntactically nested in a function definition, not within a nested class definition. ...
quest General Coding Help 4 621 May-11-2021, 11:25 AM
    Thread: I cannot delete and the elements from the list
Post: I cannot delete and the elements from the list

Hello, I am trying to run this code. The idea is to compare all elements in the list with another single element. If they are same, process and delete and return the last value. If they are not same ...
quest General Coding Help 4 621 May-11-2021, 10:28 AM
    Thread: Bool Object is not Subscriptable
Post: Bool Object is not Subscriptable

Hello I want to compare string and bool. Here is my function: def MyFunction(qbt, Pauli): if qbt.QEO.state[0]=='Bell': ... elif qbt.QEO.state==False: qbt.QEO.state=False els...
quest General Coding Help 1 458 May-02-2021, 10:24 AM
    Thread: Sort Function: <' not supported between instances of 'float' and 'tuple'
Post: RE: Sort Function: <' not supported between instan...

(Apr-30-2021, 12:41 PM)Larz60+ Wrote: Fix indentation Show complete unaltered error traceback (wrapped with bbcode error tags) Show contents of nextlist (after line 1 has executed) it is alread...
quest General Coding Help 2 782 Apr-30-2021, 07:37 PM
    Thread: Sort Function: <' not supported between instances of 'float' and 'tuple'
Post: Sort Function: <' not supported between instances ...

Hello I have this list: Output:[((7.2, <__main__.bit object at 0x7f341d8b8700>), <__main__.port object at 0x7f344082cd00>), ((5.5, <__main__.bit object at 0x7f341d8b8790>), <__ma...
quest General Coding Help 2 782 Apr-30-2021, 09:18 AM
    Thread: Take first Elements of sublists
Post: Take first Elements of sublists

This is my list: list_of_lists = [[1, 2], [3, 4]]I want to group of elements of sublists: list_of_lists = [[1, 2], [3, 4]] n=[] for list in list_of_lists: n.append(list[0]) #I am taking 1 and 3 ...
quest General Coding Help 2 422 Apr-26-2021, 11:15 AM
    Thread: Create Dynamic For Loop
Post: Create Dynamic For Loop

Hello My number of sublists is in this line: number_of_sublist=sum(len(x) for x in incoming) And I want to create a for loop till the this number. For instance if number_of_sublist=2, ...
quest General Coding Help 3 483 Apr-26-2021, 10:55 AM
    Thread: Float Object is not Subscriptable
Post: RE: Float Object is not Subscriptable

(Apr-20-2021, 09:13 AM)buran Wrote: From what you show a is a tuple. so just a[0] thanks!!
quest General Coding Help 2 507 Apr-20-2021, 09:28 AM
    Thread: Float Object is not Subscriptable
Post: Float Object is not Subscriptable

I have this object: a=(994.7, <__main__.bit object at 0x7f35b7f2c220>)And I am trying to get just 994.7 so I am using this: a[0][1]But I have float object is not sunbscriptable error HOw can I...
quest General Coding Help 2 507 Apr-20-2021, 08:53 AM
    Thread: Multiple Plotting in Same PLot
Post: Multiple Plotting in Same PLot

Hello, I want to plot multiple curve in sale plot line here: [Image: https://queirozf.com/entries/matplotlib-...ing-legend] example My x and y values are depend on another third variable. number_...
quest General Coding Help 0 432 Apr-18-2021, 10:29 AM
    Thread: Create Generator in the Class
Post: Create Generator in the Class

Hello, I have a class and inside this class I have this function: def ff(self, timelimit): while self.lasttime < timelimit : ... do your stuff self.othe...
quest General Coding Help 1 463 Apr-15-2021, 10:25 AM
    Thread: Find Common Elements in 2 list
Post: RE: Find Common Elements in 2 list

(Apr-14-2021, 03:29 PM)klllmmm Wrote: Hope this helps A = [(7.5,), (17.5,), (22.5,), (25.0,), (27.5,), (30.0,), (37.5,), (40.0,)] B = [(17.5,), (22.5,), (25.0,), (27.5,), (30.0,), (37.5,), (40.0,), ...
quest General Coding Help 4 618 Apr-14-2021, 03:57 PM
    Thread: Find Common Elements in 2 list
Post: RE: Find Common Elements in 2 list

(Apr-14-2021, 03:29 PM)klllmmm Wrote: Hope this helps A = [(7.5,), (17.5,), (22.5,), (25.0,), (27.5,), (30.0,), (37.5,), (40.0,)] B = [(17.5,), (22.5,), (25.0,), (27.5,), (30.0,), (37.5,), (40.0,), ...
quest General Coding Help 4 618 Apr-14-2021, 03:33 PM
    Thread: Find Common Elements in 2 list
Post: Find Common Elements in 2 list

Hello I have this list: A [(7.5,), (17.5,), (22.5,), (25.0,), (27.5,), (30.0,), (37.5,), (40.0,)] B [(17.5,), (22.5,), (25.0,), (27.5,), (30.0,), (37.5,), (40.0,), (42.5,)] I want to find number of s...
quest General Coding Help 4 618 Apr-14-2021, 03:17 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020