Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. create type pddesctype as(
  2. count float,
  3. mean float,
  4. std float,
  5. min float
  6. );
  7.  
  8. create function pddesc(x numeric[])
  9. returns pddesctype
  10. as $$
  11. import pandas as pd
  12. data=pd.Series(x)
  13.  
  14. count=data.describe()[0]
  15. mean=data.describe()[1]
  16. std=data.describe()[2]
  17. min=data.describe()[3]
  18.  
  19. return count, mean, std, min
  20.  
  21. $$ language plpython3u;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement