Guest User

Untitled

a guest
Dec 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. >>> import pandas as pd
  2. >>> df = pd.read_csv('data.csv', sep=',')
  3. >>> df
  4. 'Set' 'Rx' 'Traffic' 'Modulation'
  5. 0 -67.0 -64.35 15.00 '64-QAM 2/3'
  6. 1 -68.0 -65.35 15.00 '16-QAM 3/4'
  7. 2 -69.0 -66.85 14.78 '64-QAM 2/3'
  8. 3 -70.0 -67.60 15.42 '64-QAM 2/3'
  9. 4 -71.0 -68.85 15.04 '64-QAM 2/3'
  10. 5 -72.0 -70.35 15.04 '16-QAM 3/4'
  11. 6 -73.0 -70.85 15.04 '16-QAM 3/4'
  12. 7 -74.0 -71.35 15.28 '16-QAM 3/4'
  13. 8 -75.0 -72.60 12.35 '64-QAM 2/3'
  14. 9 -76.0 -73.10 11.38 '16-QAM 3/4'
  15. 10 -77.0 -74.60 11.64 '16-QAM 3/4'
  16. 11 -78.0 -75.60 7.76 '16-QAM 1/2'
  17. 12 -79.0 -76.85 7.76 '16-QAM 1/2'
  18. 13 -80.0 -77.85 7.52 '16-QAM 1/2'
  19. 14 -81.0 -79.35 5.85 'QPSK 3/4'
  20.  
  21. df = pd.read_csv('apple.csv', index_col='Date', parse_dates=True)
  22. new_sample_df = df.loc['2012-Feb':'2017-Feb', ['Close']]
  23.  
  24. new_sample_df = df.iloc[0:14, ['Rx']]
  25. TypeError: cannot perform reduce with flexible type
  26.  
  27. df.set_index("'Set'")[["'Rx'","'Traffic'"]].plot(legend=True)
  28.  
  29. In [26]: df = pd.read_csv(r'C:Tempdata.csv', quotechar="'")
  30.  
  31. In [27]: df
  32. Out[27]:
  33. Set Rx Traffic Modulation
  34. 0 -67.0 -64.35 15.00 64-QAM 2/3
  35. 1 -68.0 -65.35 15.00 16-QAM 3/4
  36. 2 -69.0 -66.85 14.78 64-QAM 2/3
  37. 3 -70.0 -67.60 15.42 64-QAM 2/3
  38. 4 -71.0 -68.85 15.04 64-QAM 2/3
  39. 5 -72.0 -70.35 15.04 16-QAM 3/4
  40. 6 -73.0 -70.85 15.04 16-QAM 3/4
  41. 7 -74.0 -71.35 15.28 16-QAM 3/4
  42. 8 -75.0 -72.60 12.35 64-QAM 2/3
  43. 9 -76.0 -73.10 11.38 16-QAM 3/4
  44. 10 -77.0 -74.60 11.64 16-QAM 3/4
  45. 11 -78.0 -75.60 7.76 16-QAM 1/2
  46. 12 -79.0 -76.85 7.76 16-QAM 1/2
  47. 13 -80.0 -77.85 7.52 16-QAM 1/2
  48. 14 -81.0 -79.35 5.85 QPSK 3/4
  49.  
  50. In [28]: df.columns
  51. Out[28]: Index(['Set', 'Rx', 'Traffic', 'Modulation'], dtype='object')
  52.  
  53. df.set_index('Set')[['Rx','Traffic']].plot(legend=True, grid=True)
  54.  
  55. 'Set','Rx','Traffic','Modulation'
  56. -67.0,-64.35,15.0,'64-QAM 2/3'
  57. -68.0,-65.35,15.0,'16-QAM 3/4'
  58. -69.0,-66.85,14.78,'64-QAM 2/3'
  59. -70.0,-67.6,15.42,'64-QAM 2/3'
  60. -71.0,-68.85,15.04,'64-QAM 2/3'
  61. -72.0,-70.35,15.04,'16-QAM 3/4'
  62. -73.0,-70.85,15.04,'16-QAM 3/4'
  63. -74.0,-71.35,15.28,'16-QAM 3/4'
  64. -75.0,-72.6,12.35,'64-QAM 2/3'
  65. -76.0,-73.1,11.38,'16-QAM 3/4'
  66. -77.0,-74.6,11.64,'16-QAM 3/4'
  67. -78.0,-75.6,7.76,'16-QAM 1/2'
  68. -79.0,-76.85,7.76,'16-QAM 1/2'
  69. -80.0,-77.85,7.52,'16-QAM 1/2'
  70. -81.0,-79.35,5.85,'QPSK 3/4'
Add Comment
Please, Sign In to add comment