Probably something along these lines:
with open('my_data.csv') as file: df = file.read() print(df)
site with explaination and examples
The important bit is to use the with statement, because as that site explains, if you do it like that, python will automatically close the file for you when you're done with it.