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

Power BI 中的 Python 腳本將日期返回為 Microsoft.Ole

Python script in Power BI returns date as Microsoft.OleDb.Date(Power BI 中的 Python 腳本將日期返回為 Microsoft.OleDb.Date)
本文介紹了Power BI 中的 Python 腳本將日期返回為 Microsoft.OleDb.Date的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

導入包含兩列 [Date, Value] 的 csv 文件并使用 Home > 對其進行轉換后編輯查詢 >變換>運行 Python 腳本Date 列顯示 Microsoft.OleDb.Date 而不是日期.在運行腳本之前,同一列中的相同值顯示為 12.10.2018(來自 csv 的輸入格式為 2018-10-12).這會導致 Query Settings 中的任何后續步驟中斷.你如何解決這個問題?

樣本數據:

日期、數值2108-10-12,12108-10-13,22108-10-14,32108-10-15,42108-10-16,5

代碼示例:

# 'dataset' 保存此腳本的輸入數據數據集['Value2'] = 數據集['Value']*10數據集

錯誤:

解決方案

這與 R 腳本描述的問題相同

在您執行任何其他操作之前,只需單擊日期旁邊的符號并選擇 Text.

現在你可以點擊Run Python Script,插入你的代碼然后點擊OK.這會將您帶到最后一個中間步驟,您必須在此處單擊 Table:

就是這樣:

請注意,Date 的數據類型已更改為日期格式.如果沒有,您可以使用上面說明的右鍵單擊下拉菜單輕松地再次更改它.

After importing a csv file with two columns [Date, Value] and transforming it using Home > Edit Queries > Transform > Run Python Script, the Date column shows Microsoft.OleDb.Date instead of dates. Before running the script, the same values in the same column are displayed as 12.10.2018 (input format from csv is 2018-10-12). This causes any later step in Query Settings to break. How do you work around this?

Sample data:

Date,Value
2108-10-12,1
2108-10-13,2
2108-10-14,3
2108-10-15,4
2108-10-16,5

Code example:

# 'dataset' holds the input data for this script
dataset['Value2'] = dataset['Value']*10
dataset

Error:

解決方案

This is the same issue as described for R scripts here, but for the sake of clarity, I'll add an answer for Python in Power BI as well.

Short answer:

Just change the Date data type from date to Text before you insert the Python Script.

The details:

If you import the csv file using the Home > Get Data functionality, and then go to Home > Edit Queries, this is what you'll see:

Before you do anything else, just click on the symbol next to date and select Text.

Now you can click Run Python Script, insert your code and clikc OK. This takes you to one last intermediate step where you'll have to click Table here:

This is it:

Notice that the datatype of Date is changed to a date format. If not you can easily change it again with the right-click drop-down menu as explained above.

這篇關于Power BI 中的 Python 腳本將日期返回為 Microsoft.OleDb.Date的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 對象)
主站蜘蛛池模板: 国产精品久久久久久久久久久新郎 | 黄色免费观看网站 | 天天爱天天操 | h免费观看| 亚洲欧美在线观看视频 | 成人三级视频 | 91在线视频网址 | 免费视频一区二区三区在线观看 | 99在线免费视频 | 亚洲手机在线 | 狠狠亚洲| 国产日韩久久 | 久草中文网| 欧美xxxx网站 | 羞羞视频在线观看网站 | 亚洲免费在线播放 | 亚洲精品一区二区网址 | 亚洲综合婷婷 | 日韩网站在线观看 | 操久久久| 国产精品99久久久久久宅男 | 日本成人中文字幕 | 天天激情综合 | 国产成人精品午夜视频免费 | 一区中文字幕 | 亚洲欧美日韩在线不卡 | 日韩欧美在线一区 | 四虎成人精品永久免费av九九 | 黄色av网站在线免费观看 | 日韩中文字幕区 | 精品久久久久久久久久久 | av片免费观看 | 日韩欧美天堂 | 欧美亚洲国语精品一区二区 | 欧美婷婷 | 免费精品在线视频 | 午夜视频在线 | 国产精品久久久亚洲 | 欧美亚洲日本 | 亚洲在线高清 | 亚洲欧美中文日韩在线v日本 |