2
I imported some data in Wikipedia and imported to Pyton. However the data that were to be integer is in the form of Object as in the image below.
import pandas as pd
import requests
url = "https://en.wikipedia.org/wiki/List_of_FIFA_World_Cup_finals"
resposta = requests.get(url)
table = pd.read_html(resposta.text)
resposta = requests.get(url)
df = table[0]
df.head()
I used the command df["Público Pagante"] = df["Público Pagante"].str.replace("[7]","").astype(int)
. Basically I wanted to take out this [7] and this (.). I think by doing this the variable will turn into whole. But, I don’t know how it does.
Ball show. Thank you
– Fidel Henrique Fernandes