2016-11-08 246 views
0

我想在Spyder的合併兩個CSV文件中,閱讀CSV文件WinPython

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

顯然沒有任何名爲'readcsv'的函數。這是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')