none
machine learning output dataframe RRS feed

  • Question

  • Hi there,

    I deployed a web service to split string in CSV file and return a dataframe. actually i am passing a CSV file had only one row of data but after splitting it was 32 rows of data. here I had a problem returning 32 rows dataframe. It was able to return only 1 row of data that is the relationship is like 1 input row = 1 output row.  please provide me solution for it getting full dataframe.

    Tuesday, May 19, 2020 11:58 AM

All replies

  • Hi,

    Does your experiment return the desired output? And are you saying when you deploy the model, it only returns one row instead of 32 rows? It would be helpful if you can share your code and workflow of how you are testing the web service. Thanks.

    Regards,

    GiftA-MSFT.

    If a post helps to resolve your issue, please click “Mark as Answer” and/or “Vote as helpful”. By marking a post as Answered and/or Helpful, you help others find the answer faster.  Thanks.

    Tuesday, May 19, 2020 3:39 PM
    Moderator
  • Hi,

    Acutally I am testing the web service with stream analytic job by upload csv file in blob storage and the below code is for splitting and making of dataframe.


    1. import pandas as pd
      def azureml_main(dataframe1):
          
          x=dataframe1.XX
          y=dataframe1.YY
          z=dataframe1.ZZ
          def ls(s):  
              str1 = ""  
              for ele in s:  
                  str1 += ele   
             
              return str1  
          def split(v):
              sp1=v.split(',')
              sp2=list(filter(None,sp1))
              sp3=list(map(int,sp2))
              return sp3
              
          xx=ls(x)
          yy=ls(y)
          zz=ls(z)   
          v1=split(xx)
          v2=split(yy)
          v3=split(zz)
          
          
          df=pd.DataFrame()
          
          df['xvalue']=v1
          df['yvalue']=v2
          df['zvalue']=v3
          
          print("\n\n\nOutput Dataframe\n",df)
          
          return df
          
        
        
    2. the input of code is below with 3 column and single row
    XX YY ZZ
    0,0,-8,-4,-4,-4,-8,0,-4,-4,-4,-8,0,0,0,0,-6,0,0,-8,0,-4,0,0,-6,-2,0,0,-6,0,2,-8, 0,0,-8,-4,-4,-4,-8,0,-4,-4,-4,-8,0,0,0,0,-6,0,0,-8,0,-4,0,0,-6,-2,0,0,-6,0,2,-8, 0,0,-8,-4,-4,-4,-8,0,-4,-4,-4,-8,0,0,0,0,-6,0,0,-8,0,-4,0,0,-6,-2,0,0,-6,0,2,-8,


    • Edited by vdeal Wednesday, May 20, 2020 8:22 AM
    Wednesday, May 20, 2020 7:33 AM
  • can you please tell me why input rows and output rows are return by web service is same. that is 10 input rows are given to web service if the output rows also 10 it returns, if output rows are lesser than 10 or greater than 10 rows it doesn't return the dataframe. that is the main problem for me
    Wednesday, May 20, 2020 8:27 AM
  • Hi,

    I tested the web service using excel ad-in and seems to be working fine.

      

    Regards,

    GiftA-MSFT.

    If a post helps to resolve your issue, please click “Mark as Answer” and/or “Vote as helpful”. By marking a post as Answered and/or Helpful, you help others find the answer faster.  Thanks.

    Friday, May 22, 2020 4:41 PM
    Moderator