daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest Dec 15th, 2018 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. import pandas as pd
  3. import matplotlib.pyplot as plt
  4.  
  5. file = r'C:UsersJonatOneDriveDocumentosFaculdadeLAMCEdadostratados1718.csv'
  6. table = pd.read_csv(file, sep = ';')
  7.  
  8. #2017
  9. table_2017 = table.query('ANO==2017')
  10.  
  11. #Cada mês
  12. table_0617 = table_2017.query('MES==6')
  13. table_0717 = table_2017.query('MES==7')
  14. table_0817 = table_2017.query('MES==8')
  15. table_0917 = table_2017.query('MES==9')
  16. table_1017 = table_2017.query('MES==10')
  17. table_1117 = table_2017.query('MES==11')
  18. table_1217 = table_2017.query('MES==12')
  19.  
  20. media_0617 = np.mean(table_0617)
  21. media_0717 = np.mean(table_0717)
  22. media_0817 = np.mean(table_0817)
  23. media_0917 = np.mean(table_0917)
  24. media_1017 = np.mean(table_1017)
  25. media_1117 = np.mean(table_1117)
  26. media_1217 = np.mean(table_1217)
  27.  
  28. time = ['0617', '0717', '0817', '0917', '1017', '1117', '1217']
  29. time = pd.DataFrame({'Tempo': time})
  30.  
  31. bar_0617 = media_0617['Bar']
  32. bar_0717 = media_0717['Bar']
  33. bar_0817 = media_0817['Bar']
  34. bar_0917 = media_0917['Bar']
  35. bar_1017 = media_1017['Bar']
  36. bar_1117 = media_1117['Bar']
  37. bar_1217 = media_1217['Bar']
  38.  
  39. bar = [bar_0617, bar_0717, bar_0817, bar_0917, bar_1017, bar_1117, bar_1217, bar_0118, bar_0218, bar_0318, bar_0418, bar_0518, bar_0618, bar_0718, bar_0818, bar_0918, bar_1018, bar_1118, bar_1218]
  40. bar = pd.DataFrame({'Bar': bar})
  41.  
  42. serie_bar = pd.concat([bar, time], axis=1, join='inner')   #Pressão
  43.  
  44. plt.plot(serie_bar['Tempo'], serie_bar['Bar'])        #Pressão
  45. plt.title('Pressão x Tempo', fontsize = '20')
  46. plt.ylabel('Pressão (hPa)')
  47. plt.xlabel('tempo')
  48. plt.rcParams['figure.figsize'] = (11,7)
  49. plt.savefig(r"C:UsersJonatOneDriveDocumentosFaculdadeLAMCEvariáveisserie_bar.png", dpi=None, facecolor='w', edgecolor='w',orientation='landscape')
  50. plt.show()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top