Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. cust Country Region value product
  2. 100 france europe 1 x
  3. 101 france europe 2 x
  4. 102 poland europe 3 x
  5. 103 poland europe 3 y
  6. 104 france europe 4 y
  7. 105 france europe 5 y
  8.  
  9. cust Country Region value product min_x
  10. 100 france europe 1 x 1
  11. 101 france europe 2 x 1
  12. 102 poland europe 3 x 1
  13. 103 poland europe 3 y 3
  14. 104 france europe 4 y 3
  15. 105 france europe 5 y 3
  16.  
  17.  
  18.  
  19. df = spark.read.csv('dataset',header=True)
  20. df1 = df.groupBy('Product').agg(min(df.value).alias('min_x))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement