Posts by Bruno Campos • 226 points
8 posts
-
0
votes1
answer61
viewsA: Convert a sqlalchemy query to a dictionary - Python
Hello, observing the documentation of sqlalchemy there is a method that returns the contents of this Keyedtuple as a dictionary. Method _asdict():…
-
1
votes2
answers120
viewsA: cmd closing when using the cls/clear command
I ran your code with some changes on Ubuntu 20.04 and everything went well. import os import platform def limpar(): if platform.system() == 'Windows': return os.system('cls') os.system('clear') if…
-
0
votes0
answers20
viewsQ: How to upload a notebook jupyter service to be used by several users?
I need to upload the service of notebook jupyter that will be consumed by several users. The requirements I need to meet are: It is necessary to ensure that a user does not have access to other…
-
0
votes4
answers975
viewsA: Return a list from another list in Python
You can do the following: lista = [0, 1, 2, 3] n = 1 lista_final = [] for elemento in lista: if elemento > n: lista_final.append(elemento) print(lista_final) # [2, 3]…
pythonanswered Bruno Campos 226 -
0
votes2
answers102
viewsA: rotate a "for" loop with 5 variables together
Use the zip() function. With it you can browse several lists. >>> letters = ['a', 'b', 'c', 'd', 'e'] >>> numbers = [0, 1, 2, 3, 4] >>> for l, n in zip(letters, numbers):…
-
8
votes2
answers626
viewsQ: What is the . gitattributes file for?
When should I use the .gitattributes ? What can I do with it ? When not using this file ? It’s good practice to always have a file .gitattributes in my repositories ?…
gitasked Bruno Campos 226 -
1
votes1
answer771
viewsA: Add shortcut to command in notebook jupyter
There is. Inside a notebook, in the tab help look for Edit Keyboard Shortcuts, a pop-up will be opened as in the image below: and there will be the line restart kernel and clear output, then just…
ipython-notebookanswered Bruno Campos 226 -
0
votes0
answers104
viewsQ: How should I name variables in the SQL language?
Is there any pattern of naming variables in SQL? I want to define the most standardized possible,for the following cases: Appointment of the database Table nomination Naming of columns Appointment…