Question: Im working with Python in Jupyter Notebook and Im trying to write a function that can open the files Ex_grid.txt or Ey_grid.txt then load the

Im working with Python in Jupyter Notebook and Im trying to write a function that can open the files Ex_grid.txt or Ey_grid.txt then load the data in the files and close the files.
I then want to use this function to load the data from the two files into my python notebook, using the same function twice (once for each text file)
Ive attached my function, but Im not sure how to then import that and run it for each of the files
Thank you :)
 Im working with Python in Jupyter Notebook and Im trying to

Task 1b Grid Function otebooks/Grid Function ipynb Grid Function Last Checkpoint: an hour ago (autosaved) View Insert Cell Kemel Widgets Help def my function to read E grid file(file to read): "function to read data from Ex grid.txt file format file_to_ read name of the file to read" #file-name-file-to-readA f-open( Ex-grld.txt.,'r') #opens the text file f.readline() #skips the header of the file data.f.readlines() #reads the data in the text file f.close() #closes the file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!