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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Power Bi change dataFrame Data

When i use a python script as data source it changes some values, for example if i have a 1.0 when i load the DataFrame in power Bi it'll show me 10.

How can i make power Bi respect the data types from the original dataFrame?

Thanks for the help.

 

 

 

import numpy as np
import pandas as pd

df2 = pd.DataFrame(
     {
         "A": 1.0,
         "B": pd.Timestamp("20130102"),
         "C": pd.Series(1, index=list(range(4)), dtype="float32"),
         "D": np.array([3] * 4, dtype="int32"),
         "E": pd.Categorical(["test", "train", "test", "train"]),
         "F": "foo",
    }
)

 

 

 

sebastiandemeta_0-1627587559187.png

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , I ran the same script and I am getting 1.0 (only added pandas).

 

Check for any transformation in power query 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Anonymous
Not applicable

Thanks.

That was the error, i had to chanege my regional configuration for one that used "." insted of "," to separete decimals.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , I ran the same script and I am getting 1.0 (only added pandas).

 

Check for any transformation in power query 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks.

That was the error, i had to chanege my regional configuration for one that used "." insted of "," to separete decimals.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.