2016-09-03 5 views
1

私はpandas/sklearn/kaggle tutorialに従うことを試みていた、と私はpythonで最も簡単なコマンドのいずれかの上につまずいた時にやっとダースラインを得た:パンダ「read_csvは」だけ

コード:

import warnings 
warnings.filterwarnings('ignore') 

import pandas as pd 
pd.options.display.max_columns = 100 
pd.options.display.max_rows = 100 

import matplotlib as mpl 
import matplotlib.pyplot as pd 

import numpy as np 


#Cell 3 
data = pd.read_csv('./Data/train.csv') 

data.head() 

エラー:

Traceback (most recent call last): 
    File "KaggleTitanic00.py", line 15, in <module> 
    data = pd.read_csv('./Data/train.csv') 
AttributeError: 'module' object has no attribute 'read_csv' 

のみそのディレクトリにエラーが発生しますコマンド:

~/Python/Tutorials/SKlearn$ python Chapter4--Test-12.py 
Number of spam messages: 747 
Number of ham messages: 4825 
['spam' 'spam' 'ham' ..., 'ham' 'ham' 'ham'] 
Prediction: spam. Message: Ur cash-balance is currently 500 pounds - to maximize ur cash-in now send GO to 86688 only 150p/msg. CC 08718720201 HG/Suite342/2Lands Row/W1J6HL 
Prediction: spam. Message: December only! Had your mobile 11mths+? You are entitled to update to the latest colour camera mobile for Free! Call The Mobile Update Co FREE on 08002986906 
Prediction: ham. Message: Just normal only here :) 
Prediction: ham. Message: How would my ip address test that considering my computer isn't a minecraft server 
Prediction: ham. Message: Ü collecting ur laptop then going to configure da settings izzit? 

私は何が間違っているのか全く分かりません。コードはチュートリアルと同じです。

答えて

2

書き込み:

import matplotlib.pyplot as plt 

pdとして再インポートすることによって、あなたはimport pandas as pd

+0

理解を上書きします。ありがとうございました。 – Rich

関連する問題