Hi,
I have a csv file as below:
1. Extract the data from row zero to row7 (rows befor Trail_number row),and write to 'intial.csv'
2. Extract the data from row Trail_number(here row8) to end in to a 'final.csv'
I use the below code, but I am getting error in getteing row index.
KeyError: 0
I have a csv file as below:
inter value,70 time interval[min],20 dose_trigger value,-23 warning_linit1,36 warning limit2,15 cooling time [hrs],2 cooling number[#],30 Trail_number,initila,final,middle,max,min Trial_20157832,1,23,14,28,1 Standard,0,5,2.6,5,0 Trial_20037924, 2,13,17,20,0 Trial_20637924,6,18,19,17,3I want to get the row index of "Trail_number" in column zero (here row8).
1. Extract the data from row zero to row7 (rows befor Trail_number row),and write to 'intial.csv'
2. Extract the data from row Trail_number(here row8) to end in to a 'final.csv'
I use the below code, but I am getting error in getteing row index.
import pandas as pd import numpy as np rw_data=pd.read_csv(r'D:\Mekala_Backupdata\PythonCodes\raw_WEHP02.csv') idx1=~(rw_data.where(rw_data[0]=='Trail_number')).isnull().all()error:
KeyError: 0