I have a problem with the Power BI dataset that I could not resolve in the past month so In the below picture you can see my steps which are numbered.
In the first step, you can see my data source which is in an Excel file. In the second to 5th steps, you can see my steps in the power query that involves transforming every column to text, running the python in power query to populate the dataset data frame, obtaining the dataset in the text format, and the last transformation that changed everything to data again.
My problems are visible in pictures 6 and 7. In picture 6 I get an ISO 8601 format and I can not convert it to date ( e.g, I tried pd.to_datetime or datetime.date.fromisoformat )
In picture 7, this problem gets worse. I not only have problems with conversion but also I run not problems with NaT and other issues from time to time and nothing works
also, the reason that I changed every column to text in step 2 was because of what I read here: Python script in Power BI returns date as Microsoft.OleDb.Date
So I would be grateful if you help me with this. I do not how to make those plots because I keep running into various errors
also, here is the code
# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:
# dataset = pandas.DataFrame(Scale, Y 1, Y 2, Y 3, Y 4, Y 5, Y 6)
# dataset = dataset.drop_duplicates()
# Paste or type your script code here:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import datetime
plt.figure(figsize=(15, 16))
# In below plot everything is text (ISO 8601 format) and not date
#plt.plot(dataset['Scale'],dataset['Scale'])
#Below line does not create any plot at all
plt.plot(dataset['Y 1'],dataset['Y 1'])
plt.show()