我想在Spyder中合并两个CSV文件,
import pandas as pd
data1 = pd.readcsv('C:/Rdata/plant1.csv')
data2 = pd.readcsv('C:/Rdata/Species.csv')
newdata = pd.merge(data1, data2, on='Speies')
但得到了这个错误:
………………………………, line 9, in <module>
data1 = pd.readcsv('C:/Rdata/plant1.csv')
AttributeError: 'module' object has no attribute 'readcsv'
如何解决此问题?
答案 0 :(得分:1)
显然,没有任何名为&#39; readcsv&#39;的功能。这是read_csv.
import pandas as pd
data1 = pd.read_csv('C:/Rdata/plant1.csv')
data2 = pd.read_csv('C:/Rdata/Species.csv')
newdata = pd.merge(data1, data2, on='Speies')