Course Name: Day Trading Strategies for Beginners, Section No: 3, Unit No: 1, Unit type: Video
import pandas as pd
us_30 = pd.read_csv(r'C:\users\anilh\DeskTop\DownloadDataFiles\US_30.csv')
us_30.head()
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\users\\anilh\\DeskTop\\DownloadDataFiles\\US_30.csv'
Guide me how to share code link that is accessible / public !!!
The error is a FileNotFoundError which means that the file "US_30.csv" cannot be found at the specified path. Make sure that the file actually exists in the specified location and that the path is mentioned correctly. You can try using a relative file path if the CSV file is located in the same directory as your Python script or notebook. For example, if your Python notebook is located in the same directory as the "US_30.csv" file, you can simply use "US_30.csv" as the file path. You should also ensure that you have the required permissions to access the file. If the file is situated in a restricted folder, you may need to acquire suitable permissions to be able to read it.
Secondly, to share a code link is is publicly accessible you can choose a code-sharing platform like GitHub, GitLab, or Pastebin based on your familiarity or preference. Create a repository on the platform and upload your code. You can change the visibility settings to make the code link public, allowing anyone with the link to access and view your code.
First of all training, Jupyter Notebook does not mention creating the file first and then using pd.read_csv(). However, as I have been working on the MQL5 programming language, it stricked to me and I did create a notepad file in the respective folder named as US_30.csv. Still did not worked. I am not aware how to create csv file frpm Jupyter Notebook!!!
I have installed Python as per instructions in the training as well as activated the environment Quantrapy. I tried changing directly by identifying import os / os.getcwd / os.chdir etc. Nothing worked.
Hi Anil,
You can use the to_csv method to create a CSV file in the Jupyter Notebook. You can read more about the same here. Furthermore, you can read the CSV files using the read_csv method. Please do let us know if you still face any issues.
Hope this helps!
Thanks,
Akshay