Debug School

rakesh kumar
rakesh kumar

Posted on • Updated on

How to find the location (file path) of a Jupyter Notebook file

How to read dataset from csv file
How to install jupyter notebook

To find the location (file path) of a Jupyter Notebook file (in this case, "webscrapping.ipynb") on your laptop, you can follow these steps:

Open Jupyter Notebook:

Open your Jupyter Notebook environment. If you haven't installed Jupyter Notebook, you can install it using pip if it's not already

pip install notebook
Enter fullscreen mode Exit fullscreen mode

Start Jupyter Notebook by running the following command in your terminal:

Navigate to the Notebook:

Once Jupyter Notebook is running, it should open in your default web browser.
You'll see a file browser interface where you can navigate to your notebook files.
Locate the Notebook:

Use the file browser to navigate to the location where you saved your "webscrapping.ipynb" file.
View the File Path:

In the Jupyter Notebook interface, you'll see the file path at the top of the browser, showing your current directory.
The "webscrapping.ipynb" file should be listed there, along with its full file path on your laptop.
Alternatively, if you want to find the file path using Python code, you can do the following:

import os

# Get the current working directory
current_directory = os.getcwd()

# Combine it with the notebook filename
notebook_filename = "webscrapping.ipynb"
notebook_path = os.path.join(current_directory, notebook_filename)

print("Notebook File Path:", notebook_path)
Enter fullscreen mode Exit fullscreen mode

Running this code in a Jupyter Notebook cell will print the file path of your "webscrapping.ipynb" file.

How to read dataset from csv file

import pandas as pd
file_path = r"C:\cotocus\python\internship\DATASET\DSData\winequality-red.csv"

# Read the CSV file into a DataFrame
df = pd.read_csv(file_path)
df
Enter fullscreen mode Exit fullscreen mode

How to install jupyter notebook

download anaconda
open anaconda dashboard in window taskbar and search anaconda or jupyter notebook if already installed

<!DOCTY

PE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="refresh" content="1;url=http://localhost:8888/tree?token=256ecedb1725c0332daa9ebd35d9d284be04ee6fcbec0a0d" />
    <title>Opening Jupyter Notebook</title>
    <script>
      setTimeout(function() {
        window.location.href = "http://localhost:8888/tree?token=256ecedb1725c0332daa9ebd35d9d284be04ee6fcbec0a0d";
      }, 1000);
    </script>
</head>
<body>

<p>
    This page should redirect you to Jupyter Notebook. If it doesn't,
    <a href="http://localhost:8888/tree?token=256ecedb1725c0332daa9ebd35d9d284be04ee6fcbec0a0d">click here to go to Jupyter</a>.
</p>

</body>
</html>
Enter fullscreen mode Exit fullscreen mode

in cmd

http://localhost:8888/tree?token=256ecedb1725c0332daa9ebd35d9d284be04ee6fcbec0a0d
Enter fullscreen mode Exit fullscreen mode

================or=================================

http://localhost:8888/?token=256ecedb1725c0332daa9ebd35d9d284be04ee6fcbec0a0d
Enter fullscreen mode Exit fullscreen mode

Top comments (0)