首页 > 代码库 > 读取pandas修改单列数据类型

读取pandas修改单列数据类型

import pandas as pd
import numpy as np

df = pd.read_csv(000917.csv,encoding=gbk)
df = df[df[涨跌幅]!=None]
df[涨跌幅] = df[涨跌幅].astype(np.float64)

print(df[df[涨跌幅]>5])

 

读取pandas修改单列数据类型