'Trying to graph data that is in scientific notation in Python

Im pretty rusty at coding and am trying to plot a simple I-V curve. I have a two column text file with the first column being I and the second being V. My voltage goes from 0 to 1 and then back to zero and is in decimal form. My I values are in scientific notation and range from e-12 to e-2 back to e-12. When it gets to higher values it switches from SN to decimal form. I am using the code:

    import matplotlib.pyplot as plt
  
x = []
y = []
for line in open('Blackk.txt', 'r'):
    lines = [i for i in line.split()]
    x.append(lines[1])
    y.append(int(float(lines[0])))
      
plt.title("I-V Curve")
plt.xlabel('V')
plt.ylabel('I')
plt.yticks(y)
plt.plot(x, y, marker = 'o', c = 'g')
  
plt.show()

When I run this I get an error that says " invalid literal for int() with base 10: '2.0962E-12'". Is there a way I can fix this? Or do I need to convert all of the I values to decimal form? Does that conversion mess up the data points that are already decimals?

Ive been looking all over the internet but havent found anything that has been able to help me fix my problem.

Any help is greatly appreciated!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source