Posts by Felipe Gambini • 139 points
13 posts
-
0
votes1
answer16
viewsA: Python Pandas - Insert list items in order in a column
To do this you must create another column in the datraframe and use the method .apply() to apply a formula for each line. The code to create the "type" column looks like this: base_dados['tipo'] =…
-
1
votes1
answer21
viewsA: Python Pandas - Conditional partial dataframe string
First you need to go through the column items and after that check if there is a string in the text, thus: for i in base_dados['Fruta']: if 'Abac' in i: print('Encontrou o Abacaxi em uma coluna de…
-
0
votes1
answer45
viewsA: List Deletion and Return
Your problem is you reset the variable lista in the function parameter exclusão, replace list by name, and where del(lista[2]) for del(lista[1]) which is the phone index on the list. Set the…
-
1
votes1
answer31
viewsA: How to return the indices that an element appears in a tuple?
To return the index of the tuple item, you can use the method enumerate(tupla), it returns the value of the tuple next to its index, so if the item equals its variable item, you only add content in…
-
0
votes1
answer28
viewsA: Formula to transform Minnutos into Days/Hours/Minutes/Seconds
I was able to get to a formula using the formulas of QUOCIENTE calculating the entire division of a division, and the formula MOD which returns the rest of the entire division. Day To calculate the…
excelanswered Felipe Gambini 139 -
0
votes1
answer22
viewsA: Input in Selenium with Python
It is possible yes, to start remember to download, according to the browser version, the chromedriver if you are using the browser Google Chrome or the geckodriver if you are using the browser…
-
0
votes1
answer49
viewsA: How to unify by Python several repeated lines of an Excel file?
First you create a dataframe only with the repeating data, that is to say, nome and sobrenome (which will be used as chave primária), and remove duplicates like this: df =…
-
0
votes1
answer73
viewsA: Pysimplegui - Button Alignment in Columns
An alternative I found to solve your alignment problem is to add an empty column between the selections boxes and the button and adjust the size with size=: layout = [[sg.Column(cbox_layout),…
python-3.xanswered Felipe Gambini 139 -
0
votes1
answer23
viewsA: I have a problem at Vscode Terminal
You are probably typing a value with the "," (comma) as decimal separator ex: 1,23, try typing the number with decimal box separated by point "." ex: 1.23. Another alternative is to add a treatment…
-
0
votes1
answer45
viewsA: Print value of a dictionary
On line 7, where you create the variable newdict which receives the ordered dictionary, you are allocating it as a list, for example: dicionario = {'Felipe': 4.0, 'Joao': 5.0, 'Ana': 7.8} newdict =…
-
0
votes1
answer40
viewsA: Deleting item from list (dictionary) - Python
To remove the first element from a list, use the method remove passing the first value of the list as parameter. alunos = {'Fulano': [2, 4, 10, 5.5]} alunos['Fulano'].remove(alunos['Fulano'][0])…
pythonanswered Felipe Gambini 139 -
1
votes1
answer17
viewsA: How do I make a window not close? Pysimplegui
To do this, you can add the method enable_close_attempted_event=True in its variable janela, example: janela = sg.Window('', layout, enable_close_attempted_event=True) The feature will return a…
pythonanswered Felipe Gambini 139 -
0
votes1
answer22
viewsA: Tkinter starting window before the rest of the programming. (Python 3.9)
To run the looping before opening the tkinter, just call the function sd() before line 18 > janela = Tk(): sd() # Chama a função sd janela = Tk() bt = Button(janela, width=20, text="Próximo CTE",…