| @@ 15-35 (lines=21) @@ | ||
| 12 | from matplotlib import rcParams |
|
| 13 | ||
| 14 | ||
| 15 | def read_cycle(data): |
|
| 16 | """This function reads a segment of datafile (corresponding a cycle) |
|
| 17 | and generates a dataframe with columns 'Potential' and 'Current' |
|
| 18 | ||
| 19 | Parameters |
|
| 20 | __________ |
|
| 21 | data: segment of data file |
|
| 22 | ||
| 23 | Returns |
|
| 24 | _______ |
|
| 25 | A dataframe with potential and current columns |
|
| 26 | """ |
|
| 27 | ||
| 28 | current = [] |
|
| 29 | potential = [] |
|
| 30 | for i in data[3:]: |
|
| 31 | current.append(float(i.split("\t")[4])) |
|
| 32 | potential.append(float(i.split("\t")[3])) |
|
| 33 | zippedList = list(zip(potential, current)) |
|
| 34 | df = pd.DataFrame(zippedList, columns = ['Potential' , 'Current']) |
|
| 35 | return df |
|
| 36 | ||
| 37 | ||
| 38 | def read_file_dash(lines): |
|
| @@ 15-35 (lines=21) @@ | ||
| 12 | from matplotlib import rcParams |
|
| 13 | ||
| 14 | ||
| 15 | def read_cycle(data): |
|
| 16 | """This function reads a segment of datafile (corresponding a cycle) |
|
| 17 | and generates a dataframe with columns 'Potential' and 'Current' |
|
| 18 | ||
| 19 | Parameters |
|
| 20 | __________ |
|
| 21 | data: segment of data file |
|
| 22 | ||
| 23 | Returns |
|
| 24 | _______ |
|
| 25 | A dataframe with potential and current columns |
|
| 26 | """ |
|
| 27 | ||
| 28 | current = [] |
|
| 29 | potential = [] |
|
| 30 | for i in data[3:]: |
|
| 31 | current.append(float(i.split("\t")[4])) |
|
| 32 | potential.append(float(i.split("\t")[3])) |
|
| 33 | zippedList = list(zip(potential, current)) |
|
| 34 | df = pd.DataFrame(zippedList, columns = ['Potential' , 'Current']) |
|
| 35 | return df |
|
| 36 | ||
| 37 | ||
| 38 | def read_file_dash(lines): |
|