python - pandas.read_csv returns empty dataframe -


here csv file:

uipid,shid,pass,camera,pointheight,pointxpos,pointzpos,deffound,highestheight,xposition,zposition,rlevel,rejected,mixedp 50096853911,6345214,1,sxuxexcamera,218,12600,82570,no,-1,-1,-1,880,no,498 49876879038,6391743,1,szuzezcamera,313,210400,187807,no,-1,-1,-1,880,no,388 

here code:

df=pd.read_csv('.\sources\data.csv', delimiter=',', names=['uipid','shid','pass','camera','pointheight','pointxpos','pointzpos','deffound','highestheight', 'xposition','zposition','rlevel','rejected','mixedp'], skip_blank_lines=true, skipinitialspace=true, engine='python') 

and when select column print(df.loc[(df['uipid']==50096853911))i empty df.

empty dataframe columns[uipid,shid,pass,camera,pointheight,pointxpos,pointzpos,deffound,highestheight,xposition,zposition,rlevel,rejected,mixedp] index: []

and when set dtype in pd.read_csv:

df=pd.read_csv('.\sources\data.csv', delimiter=',' ,dtype={'uipid':int, 'shid': int, 'pass':int, 'camera':str, 'pointheight':int, 'pointxpos':int , 'pointzpos':int, 'deffound':str, 'highestheight':int, 'xposition':int,'zposition':int, 'rlevel':int, 'rejected':str, 'mixedp':int}, names=['uipid','shid','pass','camera','pointheight','pointxpos','pointzpos','deffound','highestheight', 'xposition','zposition','rlevel','rejected','mixedp'], skip_blank_lines=true, index_col=false, encoding="utf-8", skipinitialspace=true) 

i error:

typeerror: cannot cast array dtype('o') dtype('int32') according rule 'safe'

valueerror: invalid literal int() base 10: 'uipid'

try putting header = 0 in second read_csv example , let know if works.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -