国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

《Python數(shù)據(jù)分析技術(shù)?!返?1章 02 Jupyter入門(Getting started with Jupyter notebooks)

這篇具有很好參考價值的文章主要介紹了《Python數(shù)據(jù)分析技術(shù)棧》第01章 02 Jupyter入門(Getting started with Jupyter notebooks)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

02 Jupyter入門(Getting started with Jupyter notebooks)

《Python數(shù)據(jù)分析技術(shù)?!返?1章 02 Jupyter入門(Getting started with Jupyter notebooks)

Before we discuss the essentials of Jupyter notebooks, let us discuss what an integrated development environment (or IDE) is. An IDE brings together the various activities involved in programming, like including writing and editing code, debugging, and creating executables. It also includes features like autocompletion (completing what the user wants to type, thus enabling the user to focus on logic and problem-solving) and syntax highlighting (highlighting the various elements and keywords of the language). There are many IDEs for Python, apart from Jupyter, including Enthought Canopy, Spyder, PyCharm, and Rodeo. There are several reasons for Jupyter becoming a ubiquitous, de facto standard in the data science community. These include ease of use and customization, support for several programming languages, platform independence, facilitation of access to remote data, and the benefit of combining output, code, and multimedia under one roof.

在討論 Jupyter 筆記本的要點之前,讓我們先討論一下什么是集成開發(fā)環(huán)境(或 IDE)。集成開發(fā)環(huán)境匯集了編程過程中涉及的各種活動,如編寫和編輯代碼、調(diào)試和創(chuàng)建可執(zhí)行文件。它還包括自動完成(完成用戶想要輸入的內(nèi)容,從而使用戶能夠?qū)W⒂谶壿嫼徒鉀Q問題)和語法高亮(高亮顯示語言的各種元素和關(guān)鍵字)等功能。除了 Jupyter 之外,還有許多 Python 集成開發(fā)環(huán)境,包括 Enthought Canopy、Spyder、PyCharm 和 Rodeo。Jupyter 成為數(shù)據(jù)科學界無處不在的事實標準有幾個原因。這些原因包括:易于使用和定制、支持多種編程語言、平臺獨立性、便于訪問遠程數(shù)據(jù),以及將輸出、代碼和多媒體整合在一個屋檐下的好處。

JupyterLab is the IDE for Jupyter notebooks. Jupyter notebooks are web applications that run locally on a user’s machine. They can be used for loading, cleaning, analyzing, and modeling data. You can add code, equations, images, and markdown text in a Jupyter notebook. Jupyter notebooks serve the dual purpose of running your code as well as serving as a platform for presenting and sharing your work with others. Let us look at the various features of this application.

JupyterLab 是 Jupyter 筆記本的集成開發(fā)環(huán)境。Jupyter 筆記本是在用戶機器上本地運行的網(wǎng)絡(luò)應用程序。它們可用于加載、清理、分析和建模數(shù)據(jù)。您可以在 Jupyter 筆記本中添加代碼、方程式、圖像和標記文本。Jupyter 筆記本具有雙重用途,既可以運行代碼,也可以作為與他人展示和分享工作的平臺。讓我們來看看這款應用程序的各種功能。

基本用法

打開面板(Opening the dashboard)

Type “jupyter notebook” in the search bar next to the start menu. This will open the Jupyter dashboard. The dashboard can be used to create new notebooks or open an existing one.

在開始菜單旁邊的搜索欄中輸入 “jupyter notebook”。這將打開 Jupyter 面板。儀表板可用于創(chuàng)建新筆記本或打開現(xiàn)有筆記本。

創(chuàng)建新的筆記(Creating a new notebook)

Create a new Jupyter notebook by selecting New from the upper right corner of the Jupyter dashboard and then select Python 3 from the drop-down list that appears, as shown in Figure 1-3.

如圖 1-3 所示,從 Jupyter 面板右上角選擇新建,然后從出現(xiàn)的下拉列表中選擇 Python 3,創(chuàng)建一個新的 Jupyter 筆記本。

添加要執(zhí)行的代碼(Entering and executing code)

Click inside the first cell in your notebook and type a simple line of code, as shown in Figure 1-4. Execute the code by selecting Run Cells from the “Cell” menu, or use the shortcut keys Ctrl+Enter.

單擊筆記本中的第一個單元格,輸入一行簡單的代碼,如圖 1-4 所示。從 "單元格 "菜單中選擇 "運行單元格 "或使用快捷鍵 Ctrl+Enter 執(zhí)行代碼。

print("Hello World")

添加MarkDown文本(Adding markdown text or headings)

In the new cell, change the formatting by selecting Markdown as shown in Figure 1-5, or by pressing the keys Esc+M on your keyboard. You can also add a heading to your Jupyter notebook by selecting Heading from the drop-down list shown in the following or pressing the shortcut keys Esc+(1/2/3/4).

在新單元格中,選擇 Markdown(如圖 1-5 所示)或按鍵盤上的快捷鍵 Esc+M,更改格式。您還可以從下拉列表中選擇標題或按快捷鍵 Esc+(1/2/3/4),為 Jupyter 筆記本添加標題。

重命名筆記(Renaming a notebook)

Click the default name of the notebook and type a new name, as shown in Figure 1-6.

單擊筆記本的默認名稱并鍵入新名稱,如圖 1-6 所示。

You can also rename a notebook by selecting File ? Rename.

您還可以通過選擇文件 ? 重命名來重新命名筆記本。

保存筆記(Saving a notebook)

Press Ctrl+S or choose File ? Save and Checkpoint.

按 Ctrl+S 或選擇文件 ? 保存和檢查點。

下載筆記(Downloading the notebook)

You can email or share your notebook by downloading your notebook using the option File ? Download as ? notebook (.ipynb), as shown in Figure 1-7.

如圖 1-7 所示,您可以使用 "文件"?"下載為?筆記本(.ipynb)"選項下載筆記本,通過電子郵件發(fā)送或共享筆記本。

Jupyter 中的快捷方式和其他功能(Shortcuts and other features in Jupyter)

Let us look at some key features of Jupyter notebooks, including shortcuts, tab completions, and magic commands.

讓我們看看 Jupyter 筆記本的一些關(guān)鍵功能,包括快捷方式、選項卡補全和神奇命令。

Table 1-1 gives some of the familiar icons found in Jupyter notebooks, the corresponding menu functions, and the keyboard shortcuts.

表 1-1 列出了 Jupyter 筆記本中一些熟悉的圖標、相應的菜單功能和鍵盤快捷鍵。
《Python數(shù)據(jù)分析技術(shù)?!返?1章 02 Jupyter入門(Getting started with Jupyter notebooks),Python數(shù)據(jù)分析技術(shù)棧,python,數(shù)據(jù)分析,python,數(shù)據(jù)分析,jupyter

If you are not sure about which keyboard shortcut to use, go to: Help ? Keyboard Shortcuts, as shown in Figure 1-8.

如果不確定使用哪個鍵盤快捷鍵,請轉(zhuǎn)到 幫助 ? 鍵盤快捷鍵,如圖 1-8 所示。

Commonly used keyboard shortcuts include

  • Shift+Enter to run the code in the current cell and move to the next cell.
  • Esc to leave a cell.
  • Esc+M changes the mode for a cell to “Markdown” mode.
  • Esc+Y changes the mode for a cell to “Code”

常用的快捷鍵包括

  • Shift+Enter 運行當前單元格中的代碼并移動到下一單元格。
  • Esc 離開單元格。
  • Esc+M 可將單元格模式更改為 "Markdown "模式。
  • Esc+Y 可將單元格模式更改為 "代碼 "模式。

使用tab提示(Tab Completion)

This is a feature that can be used in Jupyter notebooks to help you complete the code being written. Usage of tab completions can speed up the workflow, reduce bugs, and quickly complete function names, thus reducing typos and saving you from having to remember the names of all the modules and functions.

這是一項可用于 Jupyter 筆記本的功能,可幫助您完成正在編寫的代碼。使用制表符補全可以加快工作流程,減少錯誤,并快速補全函數(shù)名稱,從而減少錯別字,免去記住所有模塊和函數(shù)名稱的麻煩。

For example, if you want to import the Matplotlib library but don’t remember the spelling, you could type the first three letters, mat, and press Tab. You would see a dropdown list, as shown in Figure 1-9. The correct name of the library is the second name in the drop-down list.

例如,如果想導入 Matplotlib 庫,但不記得拼寫,可以鍵入前三個字母 mat,然后按 Tab 鍵。你會看到一個下拉列表,如圖 1-9 所示。該庫的正確名稱是下拉列表中的第二個名稱。

Jupyter 中使用的神奇命令(Magic commands used in Jupyter)

Magic commands are special commands that start with one or more % signs, followed by a command. The commands that start with one % symbol are applicable for a single line of code, and those beginning with two % signs are applicable for the entire cell (all lines of code within a cell).

魔法命令是一種特殊命令,以一個或多個 % 符號開頭,后面跟一個命令。以一個 % 符號開頭的命令適用于一行代碼,而以兩個 % 符號開頭的命令適用于整個單元格(單元格內(nèi)的所有代碼行)。

One commonly used magic command, shown in the following, is used to display Matplotlib graphs inside the notebook. Adding this magic command avoids the need to call the plt.show function separately for showing graphs (the Matplotlib library is discussed in detail in Chapter 7).

一個常用的神奇命令如下所示,用于在筆記本中顯示 Matplotlib 圖形。添加該神奇命令后,就無需單獨調(diào)用 plt.show 函數(shù)來顯示圖形了(第 7 章將詳細討論 Matplotlib 庫)。

%matplotlib inline

Magic commands, like timeit, can also be used to time the execution of a script, as shown in the following.

魔法命令(如 timeit)也可用于為腳本的執(zhí)行計時,如下所示。

%%timeit
for i in range(100000):
  i*i

Output:

16.1 ms ± 283 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)

Now that you understand the basics of using Jupyter notebooks, let us get started with Python and understand the core aspects of this language.

現(xiàn)在,您已經(jīng)了解了使用 Jupyter 筆記本的基礎(chǔ)知識,讓我們從 Python 開始,了解這種語言的核心內(nèi)容。文章來源地址http://www.zghlxwxcb.cn/news/detail-809067.html

到了這里,關(guān)于《Python數(shù)據(jù)分析技術(shù)?!返?1章 02 Jupyter入門(Getting started with Jupyter notebooks)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔相關(guān)法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 【數(shù)據(jù)分析 - 基礎(chǔ)入門之NumPy②】Jupyter Notebook安裝及使用

    【數(shù)據(jù)分析 - 基礎(chǔ)入門之NumPy②】Jupyter Notebook安裝及使用

    大家好,我是向陽花花花花,本期給大家?guī)淼氖?Jupyter Notebook安裝及使用。作者的 【 Python 數(shù)據(jù)分析】專欄正在火熱更新中,如果本文對您有幫助,歡迎大家點贊 + 評論 + 收藏 ! 每日金句分享: 慢也好,步伐小也罷,是往前走就好。』—— 佚名「網(wǎng)易云音樂熱評」 。 話

    2024年02月12日
    瀏覽(28)
  • 【Python爬蟲與數(shù)據(jù)分析】Jupyter的安裝與快捷鍵

    【Python爬蟲與數(shù)據(jù)分析】Jupyter的安裝與快捷鍵

    目錄 一、jupyter notebook安裝與配置 二、命令模式快捷鍵 三、編輯模式快捷鍵 四、文件操作 安裝: Jupyter Notebook是以網(wǎng)頁的形式打開的一個程序,集成在Anaconda包里面,也可以直接安裝python3解釋器,在命令行通過pip單獨下載jupyter notebook程序。 通過安裝Anaconda包得到的notebook可

    2024年02月13日
    瀏覽(32)
  • 扎實打牢數(shù)據(jù)結(jié)構(gòu)算法根基,從此不怕算法面試系列之007 week01 02-07 簡單的復雜度分析

    復雜度分析本身是非常理論化的一個內(nèi)容,在計算機科學中,有一個專門的學科叫做—— 計算復雜性理論 。 很多童鞋看過《算法導論》,這本書的內(nèi)容很多很強調(diào)算法導論。 但是實際上,對于普通程序員來說, 不需要 過度強調(diào)理論化的內(nèi)容 。因為工作中更多面對的是實際

    2023年04月19日
    瀏覽(27)
  • Python 3 中使用 pandas 和 Jupyter Notebook 進行數(shù)據(jù)分析和可視化

    Python 3 中使用 pandas 和 Jupyter Notebook 進行數(shù)據(jù)分析和可視化

    簡介 Python 的 pandas 包用于數(shù)據(jù)操作和分析,旨在讓您以直觀的方式處理帶標簽或關(guān)聯(lián)數(shù)據(jù)。 pandas 包提供了電子表格功能,但由于您正在使用 Python,因此它比傳統(tǒng)的圖形電子表格程序要快得多且更高效。 在本教程中,我們將介紹如何設(shè)置一個大型數(shù)據(jù)集, pandas 的 groupby() 和

    2024年02月19日
    瀏覽(34)
  • 【數(shù)據(jù)挖掘】使用 Python 分析公共數(shù)據(jù)【01/10】

    【數(shù)據(jù)挖掘】使用 Python 分析公共數(shù)據(jù)【01/10】

    ????????本文討論了如何使用 Python 使用 Pandas 庫分析官方 COVID-19 病例數(shù)據(jù)。您將看到如何從實際數(shù)據(jù)集中收集見解,發(fā)現(xiàn)乍一看可能不那么明顯的信息。特別是,本文中提供的示例說明了如何獲取有關(guān)疾病在不同國家/地區(qū)傳播速度的信息。 ????????要繼續(xù)操作,您需

    2024年02月12日
    瀏覽(48)
  • 大數(shù)據(jù)教程【05.01】--Python 數(shù)據(jù)分析簡介

    更多信息請關(guān)注WX搜索GZH:XiaoBaiGPT 本教程將介紹如何使用Python進行大數(shù)據(jù)分析。Python是一種功能強大且易于使用的編程語言,具備豐富的數(shù)據(jù)分析庫和工具。在本教程中,我們將涵蓋以下主題: 數(shù)據(jù)分析準備工作 導入數(shù)據(jù) 數(shù)據(jù)清洗和預處理 數(shù)據(jù)探索與可視化 數(shù)據(jù)分析與建

    2024年02月08日
    瀏覽(21)
  • python數(shù)據(jù)分析-matplotlib散點圖-條形圖的繪制以及完整方法歸納02

    python數(shù)據(jù)分析-matplotlib散點圖-條形圖的繪制以及完整方法歸納02

    散點圖的繪制使用的是scatter()方法,傳入的參數(shù)也是兩個列表,分別為x,y坐標軸的值使用散點圖可以顯示若干數(shù)列序列中各數(shù)值之間是否存在相關(guān)性. 1.導入模塊 from matplotlib import pyplot as plt import matplotlib 2.設(shè)置散點圖所有字符的字體樣式 matplotlib.rcParams[‘font.family’] = ‘Microsof

    2023年04月11日
    瀏覽(31)
  • 【spark大數(shù)據(jù)】spark大數(shù)據(jù)處理技術(shù)入門項目--購物信息分析

    【spark大數(shù)據(jù)】spark大數(shù)據(jù)處理技術(shù)入門項目--購物信息分析

    購物信息分析基于spark 目錄 本案例中三個文案例中需要處理的文件為 order_goods.txt、products.txt 以及 orders.txt 三個文件,三個文件的說明如下 一、本實訓項目針對實驗數(shù)據(jù)主要完成了哪些處理? 二、Hadoop+Spark集群環(huán)境的搭建步驟有哪些?(只介紹完全分布式集群環(huán)境的搭建)

    2023年04月08日
    瀏覽(29)
  • 數(shù)據(jù)分析之jupyter notebook工具

    數(shù)據(jù)分析之jupyter notebook工具

    1、簡介 Jupyter Notebook是基于網(wǎng)頁的用于交互計算的應用程序。其可被應用于全過程計算:開發(fā)、文檔編寫、運行代碼和展示結(jié)果?!狫upyter Notebook官方介紹 簡而言之,Jupyter Notebook是以網(wǎng)頁的形式打開,可以在網(wǎng)頁頁面中直接編寫代碼和運行代碼,代碼的運行結(jié)果也會直接在

    2024年02月16日
    瀏覽(25)
  • 【數(shù)據(jù)分析入門】人工智能、數(shù)據(jù)分析和深度學習是什么關(guān)系?如何快速入門 Python Pandas?

    【數(shù)據(jù)分析入門】人工智能、數(shù)據(jù)分析和深度學習是什么關(guān)系?如何快速入門 Python Pandas?

    本文詳細介紹了人工智能、數(shù)據(jù)分析和深度學習之間的關(guān)系,并就數(shù)據(jù)分析所需的Pandas庫做了胎教般的入門引導。祝讀得開心! ??本文是原 《數(shù)據(jù)分析大全》 、現(xiàn)改名為 《數(shù)據(jù)分析》 專欄的第二篇,我在寫這篇文章的時候突然意識到—— 單靠我是不可能把數(shù)據(jù)分析的方

    2024年02月14日
    瀏覽(36)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包