Posts by fsola • 404 points
11 posts
-
3
votes2
answers1572
viewsA: How to invert a column in Python?
You can change the order of the columns by passing the list with the columns to the dataframe. In the same way that you can change the order, you can also select fewer columns if there is need.…
-
2
votes1
answer221
viewsA: Scrapy cannot select a form using xpath
I think this example is useful to you. I haven’t covered every possible case. There are issues of right and wrong that I haven’t tried. But since your problem was to take the alternatives, this…
-
0
votes2
answers39
viewsA: Skipping line before time
You can just change the if to 0 === ((i+1)%10) and keep the rest of your logic. <script> var i = 0; while(i < 100){ n = 1; resultado = n + i; if(0 === ((i+1)%10)){ document.write(n + '-' +…
-
3
votes2
answers928
viewsA: Read data in real time
This example can help you. Read one line at a time until the end of the file. The Arq.readline() method returns 'while there are no new lines. In your code you were trying to read all the lines in…
python-3.xanswered fsola 404 -
2
votes2
answers443
viewsA: How to create Associative Array in javascript, json, how to manipulate?
I think this might help you. In your code include information in span to use as a key (date-key) in the dictionary. $('#'+destino).append( "<div class='blococurso box-experiencia'>"…
-
1
votes1
answer210
viewsA: How to print a list with the result of all numbers in a sequence summed with itself? (sequence)
I believe this example does what you need. The class receives the list of elements in the constructor. The sum method iterates twice in a nested form by the list and prints the result. import…
-
1
votes1
answer220
viewsA: Function javascript in html string
Pass the quoted parameter to the function. Substitute: cnt += "<span class='remove' onclick='remover("+info[i].id+")'>x</span>"; For: cnt += "<span class='remove'…
-
2
votes2
answers2031
viewsA: Find smallest string from a python list
The min function will return the smallest element in the list. However, it is necessary to consider the type of elements in the list. In the case of numbers, the smallest number. print('Exemplo 1')…
-
2
votes1
answer1615
viewsA: Can I run a Python program automatically off my computer?
You can use a hosting service such as Pythonanywhere to run your script. In this service you can create a free account and create or upload your script. It is possible to run your script using a…
-
2
votes1
answer988
viewsA: Scheduling of Tasks in Django
The Django’s Basic Tutorial guides the creation of a custom command for the execution of external routines. In your case, by the description of the problem, I believe you can follow this line. Here…
-
1
votes2
answers1123
viewsA: Removing elements from a list
Use the function split to break a string into a list of substrings from a separator. In your case use the ':' tab for the item 'volume:5:0.25:m3\n'. This way the function will return a list…