Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. date phone sensor pallet
  2. 126 2019-04-15 940203 C0382C391A4D 47
  3. 127 2019-04-15 940203 C0382D392A4D 47
  4. 133 2019-04-16 940203 C0382C391A4D 47
  5. 134 2019-04-16 940203 C0382D392A4D 47
  6. 138 2019-04-17 940203 C0382C391A4D 47
  7. 139 2019-04-17 940203 C0382D392A4D 47
  8. 144 2019-04-18 940203 C0382C391A4D 47
  9. 145 2019-04-18 940203 C0382D392A4D 47
  10. 156 2019-04-19 940203 C0382D392A4D 47
  11. 157 2019-04-19 940203 C0382C391A4D 47
  12. 277 2019-04-15 941557 C0392D362735 32
  13. 279 2019-04-15 941557 C03633364D50 32
  14. 286 2019-04-16 941557 C03633364D50 32
  15. 287 2019-04-16 941557 C0392D362735 32
  16. 296 2019-04-17 941557 C03633364D50 32
  17. 297 2019-04-17 941557 C0392D362735 32
  18. 305 2019-04-18 941557 C0392D362735 32
  19. 306 2019-04-18 941557 C03633364D50 32
  20. 317 2019-04-19 941557 C03633364D50 32
  21. 318 2019-04-19 941557 C0392D362735 32
  22. 561 2019-04-15 942316 C0384639224D 45
  23. 562 2019-04-15 942316 C03632364950 45
  24. 563 2019-04-15 942316 C03920363835 45
  25. 564 2019-04-15 942316 C0382939384D 45
  26. 573 2019-04-16 942316 C0382939384D 45
  27. 574 2019-04-16 942316 C0384639224D 45
  28. 575 2019-04-16 942316 C03632364950 45
  29.  
  30. grouped = pallets_arrived.groupby('pallet')
  31.  
  32. nrows = 2
  33. ncols = 2
  34. fig, axs = plt.subplots(nrows, ncols)
  35.  
  36. targets = zip(grouped.groups.keys(), axs.flatten())
  37. for i, (key, ax) in enumerate(targets):
  38. ax.plot_date(grouped.get_group(key)['date'], grouped.get_group(key)['sensor'], 'o')
  39. plt.show()
  40. return pallets_arrived
  41.  
  42. grouped = pallets_arrived.groupby('pallet')
  43. nrows = 2
  44. ncols = 2
  45. fig, axs = plt.subplots(nrows, ncols)
  46.  
  47. targets = zip(grouped.groups.keys(), axs.flatten())
  48. for i, (key, ax) in enumerate(targets):
  49. grouped.get_group(key).plot(x='date', y='sensor', ax=ax)
  50. ax.legend()
  51. plt.show()
  52.  
  53. grouped = pallets_arrived.set_index('date').groupby('pallet')
  54. nrows = 2
  55. ncols = 2
  56. fig, axs = plt.subplots(nrows, ncols)
  57.  
  58. targets = zip(grouped.groups.keys(), axs.flatten())
  59. for i, (key, ax) in enumerate(targets):
  60. grouped.get_group(key).plot(grouped.get_group(key).index, y='sensor', ax=ax)
  61. ax.legend()
  62. plt.show()
  63.  
  64. grouped = pallets_arrived.groupby('pallet')
  65. nrows = 2
  66. ncols = 2
  67. fig, axs = plt.subplots(nrows, ncols)
  68.  
  69. targets = zip(grouped.groups.keys(), axs.flatten())
  70. for i, (key, ax) in enumerate(targets):
  71. plt.sca(ax)
  72. plt.plot(grouped.get_group(key)['date'], grouped.get_group(key)['sensor'])
  73. ax.legend()
  74. plt.show()
  75.  
  76. fig, ax = plt.subplots()
  77. ax.scatter(df['date'], df['sensor'])
  78. plt.show()
  79.  
  80. fig, ax = plt.subplots()
  81. for _,g in df.groupby('pallet'):
  82. ax.scatter(g['date'], g['sensor'])
  83. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement