Posts by Juan Caio • 155 points
17 posts
-
1
votes2
answers74
viewsA: Find a string inside a python list
There is a problem in the list and it comes with the text element: before the number you use for comparison, the way you are creating the list, you are actually creating a variable and not a list.…
-
0
votes1
answer53
viewsA: Receive and read a json with list inside, python
See if it helps you: import json with open('arquivo.json') as f: data = json.load(f) #Acessando as listas data["boletoPago"]
-
0
votes1
answer41
viewsA: Variables outside the function
This is happening because the variable is declared in the function as a local variable, for you to use this variable elsewhere you have to leave this variable global, to use a variable global within…
-
-1
votes1
answer53
views -
1
votes1
answer258
viewsA: Click on a Selenium div
Two things: First you need to use a scroll to scroll until the button you want to click appears. driver.execute_script("window.scrollTo(0, num)") in a vc puts the number of pixel you want the page…
-
0
votes2
answers100
viewsA: How do I restart the page if Selenium does not find the element on the page?
Try to change the find_element_by_class_name for find_element_by_xpath using like this: driver.find_element_by_xpath("//input[@class='gLFyf gsfi']").send_keys('Rodrigo')…
-
0
votes1
answer89
viewsA: Python Selenium capturing only 1 link
If you look at the ASN links you want to capture have the same pattern "https://bgpview.io/asn/+númedo da asn". So I would start from that principle and capture all the asn numbers and then do a…
-
1
votes2
answers351
viewsA: index 5 is out of Bounds for Axis 0 with size 1
I’d build it this way: 1º I would build a list with the names of the worksheets and would read these dataframes and save in another list: sheets = ['Corp', 'SCIB', 'GI', 'Univ'] dfs = list() for…
-
0
votes2
answers351
viewsA: index 5 is out of Bounds for Axis 0 with size 1
The error is here: Corp = df.insert(loc=5,column='Email_cliente', value='--') You have created a new dataframe called df that doesn’t have any columns yet, so it will accept that you have created…
-
0
votes1
answer371
viewsA: Picking up texts within a column within a Python table
I tested what you were doing and when I looked at the status of the requests gave a 502 status which means error. print (req.status_code) 502 Then I did a test with Selenium and using Webdriver and…
-
3
votes2
answers528
viewsA: Apply dynamic filter to a dynamic dataframe in Python Pandas
I don’t know if this is exactly what you want, but see if it helps you. First has a function that creates another dataframe with totals def total(tabela): valor = {"Nome": "Total"} for coluna in…
-
3
votes1
answer61
viewsA: How to iterate a list in Flask
Good night. I think the ideal would be for you to do the following: {%block content%} {% for i in posts %} {% for i2 in i %} <p style="border: 1px solid black; padding: 5px 5px; border-radius:…
-
0
votes1
answer39
viewsA: python timestamp argument error
The problem is in the transformation of the pd.to_datetime(d) creates a Timestamp object , however in your case it would be more valid a Datetime object so for this just you: import the datetime…
-
0
votes2
answers54
viewsA: Separate extension name - in Python
You can use the split by parenthesis so you will have a list where the first element will be the name and the second element the number with the parentheses after is just you include each value in…
-
0
votes3
answers84
viewsA: Find largest element index in the list
I would use a dictionary instead of a tuple and leave the code like this: lista_de_compras = { ('Batata'): (float(input('Qual o preço da batata? R$ '))), ('Cenoura'): (float(input('Qual o preço da…
-
0
votes1
answer121
viewsA: Jupyter Notebook does not rotate, I do not know what can be
I think you’re missing only you use the function: barra_idade_por_genero()
-
-1
votes1
answer39
viewsA: I cannot understand why this value is Nan in the column "[lethalityRegionalSaude]"
Theoretically what you did is right, another solution would be to do as follows: for i in regional_saude.index: regional_saude['letalidadeRegionalSaude'] = letalidadeRegionalSaude[i]…