Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> import pandas as pd
- >>> df = pd.read_csv('data.csv', sep=',')
- >>> df
- 'Set' 'Rx' 'Traffic' 'Modulation'
- 0 -67.0 -64.35 15.00 '64-QAM 2/3'
- 1 -68.0 -65.35 15.00 '16-QAM 3/4'
- 2 -69.0 -66.85 14.78 '64-QAM 2/3'
- 3 -70.0 -67.60 15.42 '64-QAM 2/3'
- 4 -71.0 -68.85 15.04 '64-QAM 2/3'
- 5 -72.0 -70.35 15.04 '16-QAM 3/4'
- 6 -73.0 -70.85 15.04 '16-QAM 3/4'
- 7 -74.0 -71.35 15.28 '16-QAM 3/4'
- 8 -75.0 -72.60 12.35 '64-QAM 2/3'
- 9 -76.0 -73.10 11.38 '16-QAM 3/4'
- 10 -77.0 -74.60 11.64 '16-QAM 3/4'
- 11 -78.0 -75.60 7.76 '16-QAM 1/2'
- 12 -79.0 -76.85 7.76 '16-QAM 1/2'
- 13 -80.0 -77.85 7.52 '16-QAM 1/2'
- 14 -81.0 -79.35 5.85 'QPSK 3/4'
- df = pd.read_csv('apple.csv', index_col='Date', parse_dates=True)
- new_sample_df = df.loc['2012-Feb':'2017-Feb', ['Close']]
- new_sample_df = df.iloc[0:14, ['Rx']]
- TypeError: cannot perform reduce with flexible type
- df.set_index("'Set'")[["'Rx'","'Traffic'"]].plot(legend=True)
- In [26]: df = pd.read_csv(r'C:Tempdata.csv', quotechar="'")
- In [27]: df
- Out[27]:
- Set Rx Traffic Modulation
- 0 -67.0 -64.35 15.00 64-QAM 2/3
- 1 -68.0 -65.35 15.00 16-QAM 3/4
- 2 -69.0 -66.85 14.78 64-QAM 2/3
- 3 -70.0 -67.60 15.42 64-QAM 2/3
- 4 -71.0 -68.85 15.04 64-QAM 2/3
- 5 -72.0 -70.35 15.04 16-QAM 3/4
- 6 -73.0 -70.85 15.04 16-QAM 3/4
- 7 -74.0 -71.35 15.28 16-QAM 3/4
- 8 -75.0 -72.60 12.35 64-QAM 2/3
- 9 -76.0 -73.10 11.38 16-QAM 3/4
- 10 -77.0 -74.60 11.64 16-QAM 3/4
- 11 -78.0 -75.60 7.76 16-QAM 1/2
- 12 -79.0 -76.85 7.76 16-QAM 1/2
- 13 -80.0 -77.85 7.52 16-QAM 1/2
- 14 -81.0 -79.35 5.85 QPSK 3/4
- In [28]: df.columns
- Out[28]: Index(['Set', 'Rx', 'Traffic', 'Modulation'], dtype='object')
- df.set_index('Set')[['Rx','Traffic']].plot(legend=True, grid=True)
Add Comment
Please, Sign In to add comment