我设法用这段代码解决了这个问题。
谢谢你的帮助。。
# -*- coding: utf-8 -*-
import pandas as pd
#DATAFRAME AS OBJECT
df = pd.DataFrame()
urls = ["urllink"]
for url in urls:
#READ URLS
df = pd.read_html(url, parse_dates=True)
df = df[0]
#SPLIT COLUMN ON 2nd SPACE AND CREATE 2 NEW COLUMNS WITH ⬠AND %
new1 = df["1"].str.split(" ", n = 2, expand = True)
df["1 ΣΠâ¬"]= new1[1]
df["1 ΣΠ%"]= new1[2]
newX = df["Χ"].str.split(" ", n = 2, expand = True)
df["Χ ΣΠâ¬"]= newX[1]
df["Χ ΣΠ%"]= newX[2]
new2 = df["2"].str.split(" ", n = 2, expand = True)
df["2 ΣΠâ¬"]= new2[1]
df["2 ΣΠ%"]= new2[2]
newOVER = df["OVER"].str.split(" ", n = 2, expand = True)
df["OVER ΣΠâ¬"]= newOVER[1]
df["OVER ΣΠ%"]= newOVER[2]
newUNDER = df["UNDER"].str.split(" ", n = 2, expand = True)
df["UNDER ΣΠâ¬"]= newUNDER[1]
df["UNDER ΣΠ%"]= newUNDER[2]
#DELETE UNWANTED COLUMNS
df.drop(df.columns[[0,1,2,4,5,7,8,9,10,11]], axis=1, inplace=True)
print(df)
df.to_csv('file.csv', encoding='utf-8', mode='a', header=False, index=False)