Posts by Gilmar Vaz • 161 points
12 posts
-
1
votes2
answers39
viewsA: Scroll through a string list and display the 2 in 2 result
seguidores = ["teste", 'teste2', 'teste3', 'teste4', 'teste5', 'teste6', 'teste7', 'teste8', 'teste9'] for i in range(0, len(seguidores), 2): try: print(f'posicao: {i} e valor:{seguidores[i]} -…
-
0
votes1
answer43
viewsA: How to relate a column A to B where column B starts with special characters?
I made a little example of what you want. One option is to filter the data and then pass the column you want and have 2 more ways that is the Loc and iloc. import pandas as pd dados = […
-
2
votes1
answer180
viewsA: urllib.error.Httperror: HTTP Error 404: Not Found
Usually do not need but this page you are working needs an agent, I used the identification being browser firefox Mozilla. import requests, bs4 url =…
-
0
votes2
answers101
viewsA: Doubt about value extraction using Soup.findAll() in Python
Man, that took work huh. kkkkkk. Your code is on the right path, the problem is on the page that in some rows has been added a new table, for example, city column plus some dirt in the…
-
1
votes1
answer65
viewsA: Script that is in Javascript for Python
I don’t know if I understand correctly but your question is how to get to the most internal values of the dictionary ? If that’s it, it’s the code below, I do a go over the variable that brings the…
-
0
votes2
answers49
viewsA: (python) as I put the go inside def
Friend, follow what you want to do, for your doubt I put below and commented how to put the for within the function. Remembering that Python works with endentation, maybe not correctly endeared.…
-
1
votes1
answer72
viewsA: Count words in CSV file
Bro, I did it in Pycharm, but it’ll be easy to play in the collab. Note: Since Python is case sensitive, that is, a minuscule 'a' is different from a capital 'A', maybe put an upper or better Power…
-
0
votes1
answer24
viewsA: SQL Server How to link the name of a column to an external variable?
Dude, that’s it, just put the database name (not required) and run declare @comando varchar(max), @tabela varchar(max), @coluna varchar(max), @database varchar(max) set @tabela = 'Tab_Dados_Escolha'…
-
0
votes1
answer79
viewsA: By loading my xlsx file into pandas, the rows have become column indexes. How to set a new input for columns?
#Importa a Biblioteca Pandas import pandas as pd print('=== original ===') df = pd.read_excel('ABC.xlsx'); print(df) print() print('=== Modo 1 ===') #Seta None no index e header(ou numero de inicio…
-
0
votes1
answer100
viewsA: Selecting a column from a conditional loop in a pandas dataframe
#Importa as Bibliotecas Pandas e Numpy import pandas as pd #Cria do Dataframe df0 = pd.DataFrame({'Temp01':[10,20,30,40,15],'Temp02':[50,60,70,70,45],'Temp03':[80,90,100,100,75]}) #Separa Colunas…
-
1
votes1
answer141
viewsA: Perform data counting based on grouping 2 or more columns in a Pandas.Dataframe
Bro, see if that’s what you need #Instalar pacote #pip install pandas #pip install numpy import pandas as pd import numpy as np lista_valores = [ ['SABESP ASSESMENT RO',85,1] ,['SABESP ASSESMENT…
-
1
votes1
answer467
viewsA: How to go through all the data of a DF making calculation and return the value for it?
See if this is what you want, it removes 30 from the current value. The "secret" is in the lambda that you put the expression you want or access to a function with return (2nd Example). "for"…