Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
When I load in a Python Pandas dataframe with explicitly set string objects in column, this column can get converted to a number (Int or Float) by PowerBI.
It happens when the first X rows of the column look like numbers (not always), but I get errors in later rows that have characters. I can fix by hand by converting the column's data type to text. But it would be better if PowerBI used the native column type.
Example df shows the problem
import pandas
d= [ [1,'1','a1', 100], [2,'2','b2', 200] ]
c = ['a', 'b', 'c', 'd']
df= pandas.DataFrame(d,columns=c)
df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2 entries, 0 to 1
Data columns (total 4 columns):
a 2 non-null int64
b 2 non-null object
c 2 non-null object
d 2 non-null int64
dtypes: int64(2), object(2)
memory usage: 144.0+ bytes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.