Python Forum
How to read specified columns - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: How to read specified columns (/thread-9993.html)



How to read specified columns - Raj - May-08-2018

Hi,


import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
dataFileName='RFInput.xlsx'
sheetName='Rawdata'
sheetNamePara='paraList'
dataRaw=pd.read_excel(dataFileName,sheetname=sheetName)
datapara=pd.read_excel(dataFileName,sheetname=sheetNamePara)

noData=len(dataRaw)
import matplotlib.pylab as plt
from sklearn.cross_validation import train_test_split
from sklearn.cross_validation import cross_val_score
from sklearn.preprocessing import StandardScaler
import pandas as pd
import numpy as np
 
labels=datapara
x=dataRaw[labels]
y=dataRaw['classVariable']
labels are becoming dataFrame type, can not read data of column (specified in labels)