久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Power BI 中的 Python 可視化需要什么設置?任何特定

What setup do you need for Python Visualizations in Power BI? Any particular matplotlib package versions or system settings?(Power BI 中的 Python 可視化需要什么設置?任何特定的 matplotlib 包版本或系統設置?) - IT屋-程序
本文介紹了Power BI 中的 Python 可視化需要什么設置?任何特定的 matplotlib 包版本或系統設置?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

嘗試在 Power BI 中插入 Python 可視化時,我不斷收到錯誤 TypeError: from_bounds() 需要 4 個位置參數,但給出了 6 個.雖然看起來 Matplotlib 是這里的問題,但我不知道這是否是根本原因.

我的系統:

Windows 7, 64 位Power BI 2018 年 8 月Python 3.6.6.0Matplotlib 2.2.2熊貓 0.23.4

我不能 100% 確定這實際上是一個版本問題,但我想不出其他任何事情,因為我使用的是在帖子中成功使用的相同數據集

編輯 1 - 完整的錯誤消息:

<塊引用>

反饋類型:皺眉(錯誤)

時間戳:2018-08-15T09:58:44.0322850Z

當地時間:2018-08-15T11:58:44.0322850+02:00

會話 ID:85df81af-81bb-4f82-a7f4-062b315cb370

發布:2018 年 8 月

產品版本:2.61.5192.601 (18.08) (x64)

錯誤消息:Python 腳本錯誤.回溯(最近一次通話最后):文件PythonScriptWrapper.PY",第 6 行,在matplotlib.pyplot.figure(figsize=(3,75,3,52777777777778)) 文件C:UsersuserinfoAppDataLocalContinuumAnaconda3libsite-packagesmatplotlibpyplot.py",第 548 行,如圖**kwargs) 文件 "C:UsersuserinfoAppDataLocalContinuumAnaconda3libsite-packagesmatplotlibackend_bases.py",第 160 行,在 new_figure_manager 中fig = fig_cls(*args, **kwargs) 文件 "C:UsersuserinfoAppDataLocalContinuumAnaconda3libsite-packagesmatplotlibfigure.py",第 361 行,在 init 中self.bbox_inches = Bbox.from_bounds(0, 0, *figsize) TypeError: from_bounds() 接受 4 個位置參數,但給出了 6 個

操作系統版本:Microsoft Windows NT 6.1.7601 Service Pack 1 (x64 nb-NO)

CLR 版本:4.7 或更高版本 [Release Number = 461310]

峰值虛擬內存:4.16 GB

私人內存:398 MB

峰值工作集:532 MB

IE 版本:11.0.9600.19035

用戶 ID:ID 號

工作簿包信息:1* - nb-NO,查詢組:0,fastCombine:啟用,運行BackgroundAnalysis:True.

已啟用遙測:是的

模型默認模式:導入

快照跟蹤日志:C:UsersuserinfoAppDataLocalMicrosoftPowerBI桌面FrownSnapShot1416353677.zip

性能跟蹤日志:C:UsersuserinfoAppDataLocalMicrosoftPower BI桌面PerformanceTraces.zip

啟用預覽功能:PBI_PythonSupportEnabled

禁用預覽功能:PBI_shapeMapVisualEnabled PBI_newFromWebPBI_SpanishLinguisticsEnabled CustomConnectors PBI_variationUIChangePBI_canvasTooltips PBI_showIncrementalRefreshPolicyPBI_compositeModels PBI_DB2DQ

禁用 DirectQuery 選項:PBI_DirectQuery_UnrestrictedTreatHanaAsRelationalSource

云:全球云

DPI 比例:100%

支持的服務:Power BI

公式:

第 1 節;

共享時間序列 = 讓Source = Csv.Document(File.Contents("C:data imeseries.csv"),[Delimiter=",",列=2,編碼=1252,QuoteStyle=QuoteStyle.None]),#"PromoteHeaders" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}, {"Value", Int64.Type}}) in#"改變類型";

解決方案

好的,現在很明顯錯誤來自哪里.

在行中(Power BI 即時生成):

matplotlib.pyplot.figure(figsize=(5,87473572938689,6,87403100775194))

它獲取您的語言環境中的尺寸(在這種情況下使用,"作為小數點)并將其傳遞給 figsize.

而 figsize 接受 (width, height) 的元組以英寸為單位作為輸入,5,87473572938689,6,87403100775194 被視為 4 個參數,而不是 2 個,這會導致錯誤.

<小時>

所以要解決這個問題,您可以將 figsize(使用帶有 . 作為小數點的值)顯式傳遞給 plt.figure,即:

import matplotlib.pyplot as pltplt.figure(figsize=(5.874,6.874))plt.plot(數據集['日期'],數據集['值'])plt.show()

或者將 Power BI 中的區域設置更改為使用 . 作為小數點而不是 ,.

I keep getting the error TypeError: from_bounds() takes 4 positional arguments but 6 were given when trying to insert a Python Visualization in Power BI. Though it seems that Matplotlib is the problem here, I don't know if that is the root cause.

My system:

Windows 7, 64 bit
Power BI august 2018
Python 3.6.6.0
Matplotlib 2.2.2
Pandas 0.23.4

I can't be 100% sure that this is in fact a version problem, but I can't think of anything else because I'm using the same dataset that was successfully used in the post What is the best data format for a time series in a Python Visualization in Power BI?.

Data:

Date,Value
2017-01-12,1
2017-01-13,4
2017-01-14,2
2017-01-15,4
2017-01-16,2
2017-01-17,2
2017-01-18,2
2017-01-19,5
2017-01-20,5
2017-01-21,5
2017-01-22,5
2017-01-23,6
2017-01-24,3
2017-01-25,6
2017-01-26,6
2017-01-27,5
2017-01-28,8
2017-01-29,4
2017-01-30,2

Code:

import matplotlib.pyplot as plt
plt.plot(dataset['Date'], dataset['Value'])
plt.show()

Error message screenshot:

Edit 1 - The complete error message:

Feedback Type: Frown (Error)

Timestamp: 2018-08-15T09:58:44.0322850Z

Local Time: 2018-08-15T11:58:44.0322850+02:00

Session ID: 85df81af-81bb-4f82-a7f4-062b315cb370

Release: August, 2018

Product Version: 2.61.5192.601 (18.08) (x64)

Error Message: Python script error. Traceback (most recent call last): File "PythonScriptWrapper.PY", line 6, in matplotlib.pyplot.figure(figsize=(3,75,3,52777777777778)) File "C:UsersuserinfoAppDataLocalContinuumAnaconda3libsite-packagesmatplotlibpyplot.py", line 548, in figure **kwargs) File "C:UsersuserinfoAppDataLocalContinuumAnaconda3libsite-packagesmatplotlibackend_bases.py", line 160, in new_figure_manager fig = fig_cls(*args, **kwargs) File "C:UsersuserinfoAppDataLocalContinuumAnaconda3libsite-packagesmatplotlibfigure.py", line 361, in init self.bbox_inches = Bbox.from_bounds(0, 0, *figsize) TypeError: from_bounds() takes 4 positional arguments but 6 were given

OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1 (x64 nb-NO)

CLR Version: 4.7 or later [Release Number = 461310]

Peak Virtual Memory: 4.16 GB

Private Memory: 398 MB

Peak Working Set: 532 MB

IE Version: 11.0.9600.19035

User ID: IDnumber

Workbook Package Info: 1* - nb-NO, Query Groups: 0, fastCombine: Enabled, runBackgroundAnalysis: True.

Telemetry Enabled: True

Model Default Mode: Import

Snapshot Trace Logs: C:UsersuserinfoAppDataLocalMicrosoftPower BI DesktopFrownSnapShot1416353677.zip

Performance Trace Logs: C:UsersuserinfoAppDataLocalMicrosoftPower BI DesktopPerformanceTraces.zip

Enabled Preview Features: PBI_PythonSupportEnabled

Disabled Preview Features: PBI_shapeMapVisualEnabled PBI_newFromWeb PBI_SpanishLinguisticsEnabled CustomConnectors PBI_variationUIChange PBI_canvasTooltips PBI_showIncrementalRefreshPolicy PBI_compositeModels PBI_DB2DQ

Disabled DirectQuery Options: PBI_DirectQuery_Unrestricted TreatHanaAsRelationalSource

Cloud: GlobalCloud

DPI Scale: 100%

Supported Services: Power BI

Formulas:

section Section1;

shared timeseries = let Source = Csv.Document(File.Contents("C:data imeseries.csv"),[Delimiter=",", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]), #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]), #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}, {"Value", Int64.Type}}) in #"Changed Type";

解決方案

OK now it's obvious where the error comes from.

In the line (which Power BI generates on the fly):

matplotlib.pyplot.figure(figsize=(5,87473572938689,6,87403100775194))

It grabs the dimensions in your locale (which in this case use ',' as decimal point) and passes it to figsize.

While figsize accepts a tuple of (width, height) in inches as input, 5,87473572938689,6,87403100775194 is treated as 4 arguments, instead of 2, which causes the error.


So to work around this, you can either explicitly pass figsize (using values with . as decimal point) to plt.figure, i.e.:

import matplotlib.pyplot as plt
plt.figure(figsize=(5.874,6.874))
plt.plot(dataset['Date'], dataset['Value'])
plt.show()

Or change the locale in Power BI to one which use . as decimal points instead of ,.

這篇關于Power BI 中的 Python 可視化需要什么設置?任何特定的 matplotlib 包版本或系統設置?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件時出現問題)
Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按屬性查找所有節點)
Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 響應并將元素值存儲在變量中?)
How to get XML tag value in Python(如何在 Python 中獲取 XML 標記值)
How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正確解析 utf-8 xml?)
Parse XML from URL into python object(將 XML 從 URL 解析為 python 對象)
主站蜘蛛池模板: 久久97精品| 国产欧美在线一区二区 | 成人国产在线视频 | 亚洲日本中文字幕在线 | 国产精品区一区二 | 久久9视频 | 欧美日韩一 | 亚洲3p| 日韩视频三区 | 黄网免费 | 逼逼网 | 一区二区三区av | 国产a级毛片 | 成人18亚洲xxoo | 国产精品一区二区久久久久 | 黄网站涩免费蜜桃网站 | 精产嫩模国品一二三区 | 亚洲国产aⅴ成人精品无吗 亚洲精品久久久一区二区三区 | 日本久久综合网 | 能看的av网站 | 麻豆一区二区三区 | 久久a久久 | 成人三级网址 | 欧美精品被| 国产一区二区精华 | 日韩欧美视频在线 | 久久久久久久久久久91 | 九九九视频 | 秋霞影院一区二区 | 亚洲影视在线 | 99久久久久久 | 久久久久久国产精品免费免费 | 国产女人与拘做视频免费 | 波多野结衣中文字幕一区二区三区 | 免费av一区二区三区 | 久久久久久久国产精品影院 | 午夜视频一区 | 亚洲成人自拍 | 99精品九九 | 久久久av一区 | 婷婷五月色综合 |