What character precedes magic commands in Jupyter Notebook for library installation?

Loading data from Talking to Chatbots Dataset reddgr/talking-to-chatbots-chats

😎 in Jupyter Notebook, what’s the right character to precede magic commands? % or !?
🤖 In Jupyter Notebook, the correct character to precede magic commands is `%`.

Examples of magic commands:

– `%matplotlib inline` – to display plots inline.
– `%timeit` – to time the execution of code.

The `!` character is used to execute system shell commands.

Examples of system shell commands:

– `!ls` – to list directory contents.
– `!pwd` – to print the working directory.
😎 which of the two would be used to install a library with “pip install…”
🤖 To install a library using `pip install…` in a Jupyter Notebook, you would use the `!` character.

Example:
python
!pip install numpy



This executes the `pip install numpy` command in the system shell.

Hugging Face Dataset Metrics

All the conversation prompts, responses, and metrics are available to download and explore on Hugging Face dataset reddgr/talking-to-chatbots-chats: