janboone / applied-economics

course material for the course applied economics
17 stars 21 forks source link

> # Question regarding saving in subdirectory #34

Closed lindapelzer closed 3 years ago

lindapelzer commented 4 years ago

Running the code

df_wb.to_csv('applied-economics/data/worldbank_data_gdp_per_capita.csv') or output_file('data/inequality.html')

gives an error: [Errno 2] No such file or directory

Do I have to take a step before this? Or do I first have to create a subdirectory?

Indeed, you first need to create the directory/folder data. On jupyterlab, when you can see your files, click on the folder icon with a "+" inside it.

If this does not work (I will show tomorrow how to do this), you can run the code with the current directory:

df_wb.to_csv('worldbank_data_gdp_per_capita.csv') 

output_file('inequality.html')
lindapelzer commented 3 years ago

It eventually worked with using the folder with a "+" in it, thanks!