AttributeError: module 'pandas' has no attribute 'Series'解決辦法
pandas是我們進行資料處理和分析時最常用的包之一,但是有時候出現AttributeError: module 'pandas' has no attribute 'Series'這樣的錯誤,在網上看了好多各種各樣的解決辦法,
但是其實真正的錯誤主要是兩個方面:
(1)包沒有安裝成功;
(2)自己的檔名命名有問題
針對第一個問題我們是可以檢測的,直接在python命令列中進行測試Series屬性是否能用,如果說在命令列中不能用,那麼說明自己的pandas包安裝是有問題的,建議解除安裝後重新安裝,最簡單的方式採用pip便可以實現操作。如下圖
如上圖所示說明自己的pandas包是正確的,因此如果還出現請檢查自己的檔案命名問題是不是與pandas包重複了,如果是重複了的話,在進行引用時會出現錯誤。
如上圖需要將自己的檔名換掉,
將檔名修改後,再次執行時便不會出現錯誤了
最後分析,如果以後出現類似的情況,可以按照這個思路試試,不僅僅侷限於series這個屬性。
相關推薦
AttributeError: module 'pandas' has no attribute 'Series'解決辦法
pandas是我們進行資料處理和分析時最常用的包之一,但是有時候出現AttributeError: module 'pandas' has no attribute 'Series'這樣的錯誤,在網上看了好多各種各樣的解決辦法, 但是其實真正的錯誤主要是兩個方面: (
module 'pandas' has no attribute 'expression' 解決辦法
匯入 import tensorflow as tf import skflow 遇到了錯誤 module 'pandas' has no attribute 'expression' 原因是tensorflow pandas dask
Python指令碼報錯AttributeError: ‘module’ object has no attribute’xxx’解決方法
最近在編寫Python指令碼過程中遇到一個問題比較奇怪:Python指令碼完全正常沒問題,但執行總報錯"AttributeError: 'module' object has no attribute 'xxx'"。這其實是.pyc檔案存在問題。 問題定位:
【python學習筆記(2)】指令碼報錯"AttributeError: 'module' object has no attribute 'xxx'"解決方法
最近在編寫Python指令碼過程中遇到一個問題比較奇怪:Python指令碼完全正常沒問題,但執行總報錯"AttributeError: 'module' object has no attribute 'xxx'"。這其實是.pyc檔案存在問題。 問題定位: 檢視imp
TensorFlow執行錯誤,AttributeError: module 'pandas' has no attribute 'computation'
TensorFlow執行錯誤,AttributeError: module ‘pandas’ has no attribute ‘computation’ 在我今天剛開始使用TensorFlow做數字識別時,在匯入input_data方法時,即是執行“from
module 'h5py' has no attribute 'File' 解決辦法
之前執行一直沒有出現過的問題,現在換了環境總是出現 AttributeError: module 'h5py' has no attribute 'File' 解決辦法: AttributeError: module 'h5py' has no attribute 'F
import json後,報錯:AttributeError: 'module' object has no attribute 'dumps,原因分析及解決方法
編寫python程式碼,import json後,報錯:AttributeError: 'module' object has no attribute 'dumps',如下圖所示: 報錯資訊為:模組沒有方法dumps 單步除錯: 單步除錯,發現報錯相同。 檢視json
PyCham的"AttributeError:module 'pip' has no attribute 'main'"錯誤解決辦法
之前在pycham中安裝python第三方外掛時一直不成功,每次都出現 AttributeError:module 'pip' has no attribute 'main'的錯誤: 如下圖: 解決辦法如下: 1.找到安裝pycham環境的檔案,進入一個’hel
AttributeError: module 'pip' has no attribute 'main'問題解決方法
通過pycharm建立Django專案是出現如下錯誤AttributeError: module 'pip' has no attribute 'main'環境資訊:pycharm2017.3.1(Professional Edition)、python3.6.5 (64位)
針對AttributeError: ‘module’ object has no attribute’xxx’的錯誤歸類
找不到 with 類型 error: 開頭 -a 發現 使用 def 目前遇見的有三種類型: 拼寫錯誤,模塊一定要拼寫錯誤,這個也是最容易犯的,發現找不到模塊的時候,最好先檢查一遍自己引入的模塊拼寫尤其是那些名字非常長的比如HTTPPasswordMgrWithDefau
Python 在import時明明寫的正確,卻提示錯誤AttributeError: module 'test003' has no attribute 'desc'
在自己寫一個小專案的時候,發現明明自己使用import引入自己專案中的另一個Python檔案是正確的寫法,在執行的時候卻發現總是提示錯誤。因為筆者本人也是學習Python不久,經過一個小時的琢磨,感覺應該是兩個檔案迴圈引用導致錯誤。比如一個a.py在使用的時候需要引用b.py
AttributeError: module 'pip' has no attribute 'main'
Pycharm在執行pip安裝模組是報錯如下: 解決方法: 找到安裝路徑下的packaging_tool.py檔案修改如下: 我的路徑為D:\Program Files\JetBrains\PyCharm 2017.2.3\helpers\packaging_tool.py 原先: 修改後儲
python AttributeError module 'string' has no attribute 'upp
Traceback (most recent call last): File "Test1.py", line 8, in <module> upperletters = string.uppercaseAttributeError: module 'st
docker tvm :AttributeError: module 'tvm' has no attribute 'testing'
最近在搞tvm [官網:https://tvm.ai/], 我採用的docker的方式來快速入手的, 總體來說很簡單: 1. 獲取docker映象 sudo docker pull tvmai/demo-gpu 2. 執行docker映象, 注意這裡我們使用了GPU,
AttributeError: module 'requests' has no attribute 'Session'
AttributeError: module ‘requests’ has no attribute 'Session’ #使用requests執行人人網的登入和訪問會員中心並爬取資訊 import requests import re,time #獲取可以
python AttributeError: 'module' object has no attribute 'setdefaultencoding'
window下使用python,AttributeError: 'module' object has no attribute 'setdefaultencoding'問題的解決方法 參閱了http://www.jb51.net/article/54159.htm後進行整
AttributeError: 'module' object has no attribute 'post'問題
在學習python網頁爬蟲時,測試requests的post方法進行表單提交時,命名.py檔案為requests.py 程式碼如下: import requests params={'firstname':'xing','lastname':'ming'
Python3.X出現AttributeError: module 'urllib' has no attribute 'urlopen'錯誤
研究用Python寫爬蟲,下載一個網頁。報錯程式碼如下 import urllib def getHtml(url): page = urllib.urlopen(url) html = page.read() return html html
Python3異常-AttributeError: module 'sys' has no attribute 'setdefaultencoding'
基於python3.6.1版本,在一個.py檔案中,加入這3行: import requests, re, sys reload(sys) sys.setdefaultencoding("utf-8"
Python基礎學習-'module' object has no attribute 'urlopen'解決方法
參考“http://blog.sina.com.cn/s/blog_5cf74e410102uxsg.html” 用的是python 3.4 非常簡單的一小段程式碼 #!/usr/bin/python # -*- coding: UTF-8 -*- import ur