Forum Discussion
Python visual is not accurate
The matplotlib plot that shows up in Power BI, is different from that one, that the same code generates in a jupyter notebook.
Please help.
- Anonymous5 years ago
Thank you Pragati11 and amitchandak .
The issue was with the sequence of columns. Power BI sends the columns in the alphabetical order, and not in the order in which the columns get uploaded.
Thanks again for your prompt support.
14 Replies
- amitchandakSuper User
Anonymous , can share some sample images?
- AnonymousNot applicable
amitchandak wrote:Anonymous, can share some sample images?
Thank you for the prompt response Amit.This is the code:import pandas as pdimport pickleimport matplotlib.pyplot as pltenq_loaded_model = pickle.load(open('C:ENQUIRY.sav', 'rb'))y = enq_loaded_model.predict(dataset)plt.plot(y)plt.show()First one is from Power BI, and the second one from jupyter notebook- Pragati11Super User
Hi Anonymous ,
I can see the difference clearly in the y-axis scaling.
In Jupyter your y-axis range is till 2200, thereore the graph shows a different pattern.
In Power BI your y-axis range is till 2950, therefore graph is different.
In your pythin script when you are generating plot in Power BI, you will have to define range for your y-axis. Try giving this range similar to that in Jupyter notebook. I am sure you will get the same graph.
Thanks,
Pragati
- Pragati11Super User
Hi Anonymous ,
Can you share some screenshots here please with the following:
- Screenshot of scripts used in Jupyter and Power BI
- Screenshots of graph that is generated in Jupyter and Power BI
Thanks,
Pragati
- AnonymousNot applicable
Thank you Pragati11 and amitchandak .
The issue was with the sequence of columns. Power BI sends the columns in the alphabetical order, and not in the order in which the columns get uploaded.
Thanks again for your prompt support.