Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
William29
Helper I
Helper I

Python visuals in powerBI- data in values field not showing correctly

I have a dataset I have imported into a report called new array:

 

William29_0-1661650611403.png

 

If you actually go to 'transform data' and look at new array you will see it looks like this:

 

William29_1-1661650691088.png

 

 

The dataframe has over 40000 rows. Yet if you look at the first screenshot, which has includes a python visualization where the code  produces an exception that details the length of the dataset it suggests that it only has 8073 rows. The data has somehow not been imported into python properly. As a further example, I have now designed the python code to produce an exception and display what column 2 of newarray looks like according to python:

 

William29_2-1661650933911.png

 

As you can see the values it has produced look nothing like the correct values from column 2 of new array that is seen in 'transform data' (look at column 2 in the second screen shot). What values do appear, seem to be a subset of the values from column 2 and an in ascending order.

 

Can someone tell me why the data in python (within python visualization) is not imported directly as it looks in 'transform data'. I want all of the approximately 40000 rows and in their original order (not in ascending order). How do I fix this?

Here is the link to report on the google drive.

https://drive.google.com/file/d/1Ky0Duon9vq2ObIBSQvd_G8BLjBmdADgu/view?usp=sharing

 

 

 

 

2 REPLIES 2
William29
Helper I
Helper I

I have now solved this issue. The cause of it was the drop_duplicates command that is automatically done within the script of the python visualization. It was solved by adding a column consisting of integers from 1 to the number of rows, which ensures that no duplicates are removed and allowed me to rearrange the dataset back to what it was

v-jayw-msft
Community Support
Community Support

Hi @William29 ,

 

You may need to check if the packages you are using were supported in Power BI.

https://docs.microsoft.com/en-us/power-bi/connect-data/service-python-packages-support .

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.