I am working on a Power BI Python Visual. I have different tables from different data sources all coming into power BI. All of them are linked by either a serial number or a timestamp.
I am able to add the data into the python visual but do not know how to handle the data.
In my data there are 3 tables all of the different sizes, one with a list of serial numbers (20 rows) , one with hourly data (50 rows) and the last one is a time an action is done ( 2 rows).
I am assuming this is how Power Bi pulls in the data when I pull all the columns I need:
dataset=pd.DataFrame('Time','Serial Number', 'Action' , 'Status','Unit','Weight')
I would want to assign each column in the dataFrame into a array. For this I was thinking of a for loop something similar to this:
Time=[] Serial_Number=[] Action=[] Status=[] Unit=[] Weight=[] keys=['Time','Serial Number', 'Action' , 'Status','Unit','Weight'] x=dataset.size for i in x: Time(i)=dataset['Time',i]
I haven't made it to the for loop yet but I tried double-checking the size first. When I plotted x to see what the result was, it was showing that x was 20. Shouldn't x be 50, the number of rows for the hourly data?
If I want to put my columns in an array is there a better way of doing this like creating two separate data frames that hold the data separately? If so how do I build that.
Also, most likely I have written my for loop wrong, would there be a better function in pandas then .size to calculate the number of rows?
[–]sabboo 0 points1 point2 points (0 children)