Aug-06-2018, 02:08 PM
(This post was last modified: Aug-06-2018, 02:08 PM by SchroedingersLion.)
Greetings,
I just found this website that summarizes how to read from a .txt file:
https://www.guru99.com/reading-and-writi...ython.html
It only gives the options of reading the entire content or reading line by line.
Now I have to plot (x,y) data that is stored in a .txt file in two columns (one column for the x-, one columns for the y-values). The columns are merely separated by a few spaces. I want to store the x values in one array/list and the y values in another.
I am a complete Python beginner and I intend to work with Matplotlib later on for the actual plotting. However, to plot something I probably have to read in the data first, so here we are.
Regards!
I just found this website that summarizes how to read from a .txt file:
https://www.guru99.com/reading-and-writi...ython.html
It only gives the options of reading the entire content or reading line by line.
Now I have to plot (x,y) data that is stored in a .txt file in two columns (one column for the x-, one columns for the y-values). The columns are merely separated by a few spaces. I want to store the x values in one array/list and the y values in another.
I am a complete Python beginner and I intend to work with Matplotlib later on for the actual plotting. However, to plot something I probably have to read in the data first, so here we are.
Regards!