python - Place the data with respect to its variable (column) -


customerid  cs_cookie   cs_referer      cs_host sc_status   sc_substatus    sc_win32_status sc_bytes    cs_bytes       1     kommarajula http    rewardcenter    200  0             0               3189           2767          62         2     kommarajula http    rewardcenter    200  0             0              61828           2767         156         2     kommarajula http    rewardcenter    200  0             0               3445           2750          62         3     kommarajula http    rewardcenter    200  0             0              19738           2782          78         4     kommarajula http    rewardcenter    200  0             0              19738           2781          78         5     kommarajula v1:1    rewardcenter    200  0             0              51396           2253         374         6     kommarajula v1:1    rewardcenter    200  0             0               2357           2201         124         7     kommarajula v1:1    rewardcenter    200  0             0              19594           2243         140         8     kommarajula ram v1:1    rewardcenter    200            0                 0            22778       2425          109    9     kommarajula ram v1:1    rewardcenter    200            0                 0            28186       2460          296   10     kommarajula ram kumar   v1:1    rewardcenter          200                0              0         28186         2460    296  11     kommarajula ram kumar   v1:1    rewardcenter          200                0              0         28186         2460    296 

i have iis log data in csv format, "cs_cookie" variable has spilled in many columns, want place data in corresponding variable after deleting "cs_cookie" variable. please me.

new_columns = iis.columns.values[0:24].tolist() count=[] in range(len(iis['customerid'])): iis_list = [] iis_list = iis.loc[i].tolist() iis_list = [x x in iis_list if str(x) != 'nan'] count.append(len(iis_list))  iis['count']=count out_list = []  in iis.values.tolist(): if i[len(iis.columns)-1] > 24:     out_list.append(i[0:16]+i[28:36]) else:     out_list.append(i[0:24])  new_df = pd.dataframe(out_list) new_df.columns = new_columns 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -