sviewgui介紹
sviewgui是基於 PyQt 的 GUI,用於 csv 檔案或 Pandas 的 DataFrame 的資料視覺化。此 GUI 基於 matplotlib,您可以透過多種方式視覺化您的 csv 檔案。主要特點:
- Ⅰ 散佈圖、線圖、密度圖、直方圖和箱線圖類型;
- Ⅱ 標記大小、線寬、直方圖的bin 數量、顏色圖的設定(來自cmocean);
- Ⅲ 將圖另存為可編輯的PDF;
- Ⅳ 繪製圖形的程式碼可用,以便它可以在sviewgui 之外重複使用和修改;
專案網址:https://github.com/SojiroFukuda/sview-gui
這個套件用法超級簡單,它只有一個方法:buildGUI()。此方法可以傳入零個或一個參數。您可以使用 csv 檔案的檔案路徑作為參數,或使用 pandas 的DataFrame物件作為參數。類似程式碼寫法如下:
# 第一种形式 import sviewgui.sview as sv sv.buildGUI() # 第二种形式 import sviewgui.sview as sv FILE_PATH = "User/Documents/yourdata.csv" sv.buildGUI(FILE_PATH) # 第三种形式 import sviewgui.sview as sv import pandas as pd FILE_PATH = "User/Documents/yourdata.csv" df = pd.read_csv(FILE_PATH) sv.buildGUI(df)
上面程式碼,只是幫助驅動開啟這個GuI視覺化介面。
最後強調一點,由於這個函式庫是基於matplotlib可視化的,因此seaborn風格同樣適用於這裡,因為seaborn也是基於matplotlib可視化的。
sviewgui安裝
這個函式庫的依賴函式庫相當多,所以大家直接採用下面這行程式碼安裝sviewgui函式庫。
pip install sviewgui -i https://pypi.tuna.tsinghua.edu.cn/simple/ --ignore-installed
後面這個--ignore-installed,我最開始是沒加的,但是報錯了,大致錯誤如下:
ERROR: Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
直到加這個就行,不用管為什麼,因為我也不知道!
sviewgui使用
上面我為大家介紹了3種開啟GUI圖形介面視窗的程式碼,這裡只介紹下面這個方法:
import sviewgui.sview as sv sv.buildGUI()
截圖如下:
當你在命令列輸入上述程式碼後,會驅動後台開啟這個圖形化介面窗口,初始化狀態大致上是這樣的:
點擊上述select,可以選擇資料來源:
然後我們可以點擊左側選單欄,產生對應的圖形。但是有一點,似乎不支持中文! ! !
如果你覺得這裡不足以完善你想要的圖形,可以複製圖形所對應的Python程式碼,簡單修改即可。
然後,你拿著下面的程式碼,簡單修改,就可以產生漂亮的Matplotlib圖形了。
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import cmocean #2021/07/13 08:03:18 #- Import CSV as DataFrame ---------- FILE_PATH = 'C:/Users/Administrator/Desktop/plot.csv' DATA = pd.read_csv(FILE_PATH) #- Axes Setting ---------- fig, ax = plt.subplots() ax.set_title( "x-y") ax.set_xlabel( "x") ax.set_ylabel( "x" ) ax.set_xlim(min(DATA['x'].replace([np.inf, -np.inf], np.nan ).dropna() ) - abs( min(DATA['x'].replace([np.inf, -np.inf], np.nan ).dropna() )/10), max(DATA['x'].replace([np.inf, -np.inf], np.nan).dropna()) + abs(max(DATA['x'].replace([np.inf, -np.inf], np.nan).dropna())/10)) ax.set_ylim( min(DATA['x'].replace([np.inf, -np.inf], np.nan ).dropna() ) - abs( min(DATA['x'].replace([np.inf, -np.inf], np.nan ).dropna() )/10), max(DATA['x'].replace([np.inf, -np.inf], np.nan).dropna()) + abs(max(DATA['x'].replace([np.inf, -np.inf], np.nan).dropna())/10)) #- PLOT ------------------ ax.plot( DATA["x"].replace([np.inf, -np.inf], np.nan), DATA["x"].replace([np.inf, -np.inf], np.nan), linewidth = 3.0, alpha =1.0, color = "#005AFF" ) plt.show()
以上是又一Python神器,不寫一行程式碼,就可以呼叫Matplotlib繪圖!的詳細內容。更多資訊請關注PHP中文網其他相關文章!

Arraysinpython,尤其是Vianumpy,ArecrucialInsCientificComputingfortheireftheireffertheireffertheirefferthe.1)Heasuedfornumerericalicerationalation,dataAnalysis和Machinelearning.2)Numpy'Simpy'Simpy'simplementIncressionSressirestrionsfasteroperoperoperationspasterationspasterationspasterationspasterationspasterationsthanpythonlists.3)inthanypythonlists.3)andAreseNableAblequick

你可以通過使用pyenv、venv和Anaconda來管理不同的Python版本。 1)使用pyenv管理多個Python版本:安裝pyenv,設置全局和本地版本。 2)使用venv創建虛擬環境以隔離項目依賴。 3)使用Anaconda管理數據科學項目中的Python版本。 4)保留系統Python用於系統級任務。通過這些工具和策略,你可以有效地管理不同版本的Python,確保項目順利運行。

numpyarrayshaveseveraladagesoverandastardandpythonarrays:1)基於基於duetoc的iMplation,2)2)他們的aremoremoremorymorymoremorymoremorymoremorymoremoremory,尤其是WithlargedAtasets和3)效率化,效率化,矢量化函數函數函數函數構成和穩定性構成和穩定性的操作,製造

數組的同質性對性能的影響是雙重的:1)同質性允許編譯器優化內存訪問,提高性能;2)但限制了類型多樣性,可能導致效率低下。總之,選擇合適的數據結構至關重要。

到CraftCraftExecutablePythcripts,lollow TheSebestPractices:1)Addashebangline(#!/usr/usr/bin/envpython3)tomakethescriptexecutable.2)setpermissionswithchmodwithchmod xyour_script.3)

numpyArraysareAreBetterFornumericalialoperations andmulti-demensionaldata,而learthearrayModuleSutableforbasic,內存效率段

numpyArraySareAreBetterForHeAvyNumericalComputing,而lelethearRayModulesiutable-usemoblemory-connerage-inderabledsswithSimpleDatateTypes.1)NumpyArsofferVerverVerverVerverVersAtility andPerformanceForlargedForlargedAtatasetSetsAtsAndAtasEndCompleXoper.2)

ctypesallowscreatingingangandmanipulatingc-stylarraysinpython.1)usectypestoInterfacewithClibrariesForperfermance.2)createc-stylec-stylec-stylarraysfornumericalcomputations.3)passarraystocfunctions foreforfunctionsforeffortions.however.however,However,HoweverofiousofmemoryManageManiverage,Pressiveo,Pressivero


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

WebStorm Mac版
好用的JavaScript開發工具

DVWA
Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中

SublimeText3 英文版
推薦:為Win版本,支援程式碼提示!

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能

記事本++7.3.1
好用且免費的程式碼編輯器