Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am using a python script to manipulate data within powerquery. When I pass a table from powerquery with the column data type as 'decimal number' in powerquery, it arrives at python as of class 'pandas.core.series.Series'. If I am not mistaken, all data that passes from powerquery to python actually gets there as 'pandas.core.series.Series', independently of their previous data type.
With that said, I want to convert this column type again to a number of any kind (float, integer...). I tried multiple ways of converting it but it never works and stays as pandas.core.series.Series. For example, I have tried doing:
dataset['start_t'] = pd.to_numeric(dataset['start_t']) # 'start_t' is my column name
raise Exception(type(dataset['start_t'])) # still gives type class 'pandas.core.series.Series'
# I use raise exception because it print doesn't work in powerquery
This doesn't work as well
df['start_t'] = df['start_t'].astype(int)
If I am not able to get the column type as a number I don't think I will be able to manipulate data as I wish. I need to convert those values from Unix to a timestamp and do subtractions, but nothing of that works when I have a 'pandas.core.series.Series'.
I have also tried getting the column from powerquery as a 'text' type but I do still get a 'pandas.core.series.Series'.
How should I deal with this? Has anyone faced this issue?
Hi, @GoingDigital123
I can't reproduce your question due to lack of experience with pandas, how did you pass the table to python and get the type above?
Here is the thread I found, you can refer to it and check if this is useful to you.
Converting pandas.core.series.Series to dataframe with appropriate column values python
How can I turn a pandas.core.series.Series into a Dataframe? [duplicate]
how to assign a pandas.core.series.Series to a pandas dataframe column
How to covert pandas.core.series.Series to string?
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |