| @@ 12-31 (lines=20) @@ | ||
| 9 | import peakutils |
|
| 10 | ||
| 11 | ||
| 12 | def read_cycle(data): |
|
| 13 | """This function reads a segment of datafile (corresponding a cycle) |
|
| 14 | and generates a dataframe with columns 'Potential' and 'Current' |
|
| 15 | ||
| 16 | Parameters |
|
| 17 | __________ |
|
| 18 | data: segment of data file |
|
| 19 | Returns |
|
| 20 | _______ |
|
| 21 | A dataframe with potential and current columns |
|
| 22 | """ |
|
| 23 | ||
| 24 | current = [] |
|
| 25 | potential = [] |
|
| 26 | for i in data[3:]: |
|
| 27 | current.append(float(i.split("\t")[4])) |
|
| 28 | potential.append(float(i.split("\t")[3])) |
|
| 29 | zipped_list = list(zip(potential, current)) |
|
| 30 | dataframe = pd.DataFrame(zipped_list, columns=['Potential', 'Current']) |
|
| 31 | return dataframe |
|
| 32 | ||
| 33 | ||
| 34 | def read_file_dash(lines): |
|
| @@ 8-27 (lines=20) @@ | ||
| 5 | import matplotlib.pyplot as plt |
|
| 6 | ||
| 7 | ||
| 8 | def read_cycle(data): |
|
| 9 | """This function reads a segment of datafile (corresponding a cycle) |
|
| 10 | and generates a dataframe with columns 'Potential' and 'Current' |
|
| 11 | ||
| 12 | Parameters |
|
| 13 | __________ |
|
| 14 | data: segment of data file |
|
| 15 | Returns |
|
| 16 | _______ |
|
| 17 | A dataframe with potential and current columns |
|
| 18 | """ |
|
| 19 | ||
| 20 | current = [] |
|
| 21 | potential = [] |
|
| 22 | for i in data[3:]: |
|
| 23 | current.append(float(i.split("\t")[4])) |
|
| 24 | potential.append(float(i.split("\t")[3])) |
|
| 25 | zipped_list = list(zip(potential, current)) |
|
| 26 | dataframe = pd.DataFrame(zipped_list, columns=['Potential', 'Current']) |
|
| 27 | return dataframe |
|
| 28 | ||
| 29 | ||
| 30 | def read_file(file): |
|