Solved

Transformations to Sequences

  • 14 July 2023
  • 3 replies
  • 67 views

Badge +2

I have a daily feed data of the form coming as a file in sharepoint

Date AX1 AB1 AW1 AN1 AR1 AB1 BW1 BG1 BT1
01-01-2023 0.23 1.23 2.54 0.98 0.655 1.09 0.87 0.34 0.19
01-02-2023 0.34 0.56 0.44 0.89 0.576 0.81 1.29 1.11 0.67
…... ….. ….. …... …... …... …... …... …... …..

 

I need to pull this data and transform it into an applicable resource-type (Sequences in CDF). I don’t want to store as time series since I need this in tabular form to operate further and do matrix and dot product etc. 

Is there a way to write a transformation to push it as ‘sequences’ so that I can use it as a matrix to perform further calculations?

Please share some example SQL transformation snippets to achieve this. 

icon

Best answer by roman.chesnokov 17 July 2023, 13:00

View original

3 replies

Userlevel 3

Hey @eashwar11 , I’m not sure if the sequence data type fits your needs. Do you have any reasons for using that particular type? I would recommend using time series. instead. You can easily access the values as tabular data (pandas DataFrame).

client.time_series.data.retrieve_dataframe(list_of_external_ids, start='1m-ago', end='now', aggregates=['average'], granularity='1d')

But if you don’t need to visualise the data, you can do the same directly from the RAW.

client.raw.rows.retrieve_dataframe(db_name, table_name, limit=-1)

 

Userlevel 3

Hi @eashwar11, did the above help you?

Badge +2

Hi @Carin Meems 

It did help!, Thanks for the inputs.

Reply