Python的用途是什么? Python編程語言有10多種編碼用途。

👋歡迎 (👋 Welcome)

Hi! Please take a moment to think about this question:

嗨! 請花一點時間考慮這個問題:

How is Python applied in real-world scenarios?

Python如何在實際場景中應用?

If you are learning Python and you want to know the answer, then this article is for you.

如果您正在學習Python,并且想知道答案,那么本文適合您。

Having a clear idea of the applications and vast potential of this programming language will give you the motivation that you will need throughout your journey.

對應用程序有清晰的認識,并希望這種編程語言具有巨大的潛力,這將帶給您整個旅程中需要的動力。

Let's begin! 🔅

讓我們開始! 🔅

真實場景中的Python (Python in Real-World Scenarios)

Python is used in virtually every industry and scientific field that you can imagine, including:

您幾乎可以想象到的每個行業和科學領域都使用Python,包括:

  • Data Science.

    數據科學。
  • Machine Learning.

    機器學習。
  • Web Development.

    Web開發。
  • Computer Science Education.

    計算機科學教育。
  • Computer Vision and Image Processing.

    計算機視覺和圖像處理。
  • Game Development.

    游戲開發。
  • Medicine and Pharmacology.

    醫學和藥理學。
  • Biology and Bioinformatics.

    生物學和生物信息學。
  • Neuroscience and Psychology.

    神經科學與心理學。
  • Astronomy.

    天文學。
  • Other areas such as robotics, autonomous vehicles, business, meteorology, and graphical user interface (GUI) development.

    其他領域,例如機器人技術,自動駕駛汽車,商業,氣象學和圖形用戶界面(GUI)開發。

This article covers a wide range of applications of this programming language in these industries with examples, use cases, and Python libraries. Let's start with the applications of Python in data science.

本文通過示例,用例和Python庫涵蓋了該編程語言在這些行業中的廣泛應用。 讓我們從Python在數據科學中的應用開始。

🔹數據科學:分析和可視化 (🔹 Data Science: Analysis and Visualization)

Perhaps one of the most popular applications of Python is data science. The power of the Python libraries developed for data analysis and visualization is amazing. Let's see why.

數據科學是Python最流行的應用之一。 開發用于數據分析和可視化的Python庫的功能是驚人的。 讓我們看看為什么。

數據科學應用 (Data Science Applications)

With a Python data visualization library, you can create a wide variety of plots and visual representations, such as:

借助Python數據可視化庫,您可以創建各種各樣的圖形和視覺表示,例如:

  • Lines, Bars, and Markers.

    線,條和標記。
  • Images, contours and fields.

    圖像,輪廓和字段。
  • Subplots, axes and figures.

    子圖,軸和圖形。
  • Statistics (Box Plots, Bar Charts, and Histograms).

    統計信息(箱形圖,條形圖和直方圖)。
  • Pie and polar charts.

    餅圖和極坐標圖。
  • 3D Plots.

    3D圖。
  • and more!

    和更多!

You can add text, labels, annotations, color, shapes, collections, animations, and interactivity to your plots depending on the package or library that you choose to work with.

您可以根據選擇使用的程序包或庫,將文本,標簽,注釋,顏色,形狀,集合,動畫和交互性添加到繪圖中。

💡 Tip: You can see some examples of data visualizations generated with Python in the image above.

提示:您可以在上圖中看到一些使用Python生成的數據可視化示例。

庫和包 (Libraries and Packages)

Let's see some of the most popular packages and libraries to work with Python in data science:

讓我們來看一些在數據科學中可以使用Python的最受歡迎的軟件包和庫:

用于數據分析的Python (Python for Data Analysis )

  • NumPy: this package is described as "the fundamental package for scientific computing with Python". According to the official website of this package, "nearly every scientist working in Python draws on the power of NumPy."

    NumPy :該軟件包被描述為“使用Python進行科學計算的基本軟件包”。 根據該軟件包的官方網站,“幾乎所有從事Python工作的科學家都利用NumPy的力量。”

  • Pandas: is "a fast, powerful, flexible and easy to use open source data analysis and manipulation tool."

    Pandas :是“一種快速,強大,靈活且易于使用的開源數據分析和處理工具”。

用于數據可視化的Python (Python for Data Visualization)

  • Matplotlib: is "a comprehensive library for creating static, animated, and interactive visualizations in Python." If you are curious about what you can do with this library, check out the example gallery.

    Matplotlib :是“用于在Python中創建靜態,動畫和交互式可視化的綜合庫。” 如果您對使用此庫可以做什么感到好奇,請查看示例庫 。

  • Seaborn: is "a Python data visualization library based on matplotlib." If you are curious about what you can do with this library, check out the example gallery.

    Seaborn :是“基于matplotlib的Python數據可視化庫”。 如果您對使用此庫可以做什么感到好奇,請查看示例庫 。

  • ggplot2: is "a system for declaratively creating graphics, based on The Grammar of Graphics". According to its official website: "you provide the data, tell ggplot2 how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details."

    ggplot2 :是“基于圖形語法的聲明式創建圖形的系統”。 根據其官方網站的說法:“您提供數據,告訴ggplot2如何將變量映射到美觀,使用哪些圖形基元,以及如何處理細節。”

  • Bokeh: is "an interactive visualization library for modern web browsers".

    Bokeh :是“用于現代Web瀏覽器的交互式可視化庫”。

  • Pandas: this library has many tools for data visualization.

    熊貓 : 該庫具有許多用于數據可視化的工具。

學習資源 (Learning Resources)

If you want to learn data analysis and visualization using Python, Jupyter Notebooks, Numpy, Pandas, CSV files, data frames, and more, you can start your journey with freeCodeCamp's free Data Analysis with Python Certification:

如果您想使用Python,Jupyter Notebooks,Numpy,Pandas,CSV文件,數據框等來學習數據分析和可視化,則可以使用freeCodeCamp的免費Python數據分析認證開始您的旅程:

During the certification, you work on and complete these projects:

在認證期間,您將從事并完成以下項目:

  • Mean-Variance-Standard Deviation Calculator.

    均方差標準偏差計算器。
  • Demographic Data Analyzer.

    人口統計數據分析器。
  • Medical Data Visualizer.

    醫療數據可視化器。
  • Page View Time Series Visualizer.

    頁面視圖時間序列可視化工具。
  • Sea Level Predictor.

    海平面預測器。

freeCodeCamp's YouTube channel also has these great free tutorials to get you started:

freeCodeCamp的YouTube頻道也提供了這些免費的入門教程,幫助您入門:

  • Data Analysis with Python – Full Course for Beginners (Numpy, Pandas, Matplotlib, Seaborn) by Santiago Basulto.

    用Python進行數據分析-Santiago Basulto的初學者(Numpy,Pandas,Matplotlib,Seaborn)完整課程 。

  • Python for Data Science – Learn Pandas, Matplotlib, Numpy, and More by DataPublishing

    用于數據科學的Python –通過DataPublishing學習熊貓,Matplotlib,Numpy等

  • Matplotlib Crash Course by Keith Galli

    Matplotlib速成課程 ,基思·加利(Keith Galli)

  • Python NumPy Tutorial for Beginners by Keith Galli

    Keith Galli的Python NumPy初學者教程

In addition, these are helpful resources if you want to learn how to work with these libraries:

此外,如果您想學習如何使用這些庫,這些是有用的資源:

  • Matplolib Tutorials: free introductory, intermediate, and advanced tutorials to teach you how to create awesome visualizations.

    Matplolib教程 :免費的入門,中級和高級教程,教您如何創建出色的可視化效果。

  • Pandas "Getting Started" section: free introductory tutorials.

    熊貓“入門”部分:免費的入門教程。

  • NumPy Learn section: a curated collection of external resources to help you get started.

    NumPy學習部分 :精選的外部資源集合可幫助您入門。

🔸機器學習 (🔸 Machine Learning)

Python is an essential tool for every developer who wants to enter the fascinating area of Machine Learning. Let's see a brief introduction to Machine Learning.

對于每個想要進入機器學習引人入勝的領域的開發人員來說,Python是必不可少的工具。 讓我們看一下機器學習的簡要介紹。

什么是機器學習? (What is Machine Learning?)

Machine Learning is an area of Computer Science that creates systems that are able to learn on their own.

機器學習是計算機科學的一個領域,它創建能夠自行學習的系統。

This type of system uses algorithms that are continuously improved based on input data that helps the system "learn". It learns how to respond autonomously to new scenarios by generating an appropriate output in new scenarios based on previous knowledge.

這種類型的系統使用的算法會根據有助于系統“學習”的輸入數據進行不斷改進。 它學習如何通過基于先前的知識在新方案中生成適當的輸出來自動響應新方案。

One of the most amazing things about these systems is that they are continually refined.

這些系統最令人驚奇的事情之一就是它們不斷地完善。

They are not like the programs that we typically write in a Python script where we specify every possible action that the program can take. In Machine Learning, the system is trained to "think" and make decisions based on previous knowledge.

它們與我們通常在Python腳本中編寫的程序不同,在Python腳本中,我們指定了程序可以執行的所有可能操作。 在機器學習中,訓練該系統以“思考”并根據先前的知識做出決策。

This is why we say that machines "learn" from the data.

這就是為什么我們說機器從數據中“學習”。

💡 Tip: This is an interesting talk by Google: Machine Learning Zero to Hero (Google I/O'19).

💡提示:這是Google的有趣演講: 機器學習對英雄零(Google I / O'19) 。

神經網絡:機器學習的基礎 (Neural Networks: The Building-Blocks of Machine Learning)

Neural networks are the processing units of the system. They try to simulate a real network of neurons of the brain. They virtual "neurons" receive input, learn how to process that input, and generate an output based on their previous knowledge.

神經網絡是系統的處理單元。 他們試圖模擬大腦神經元的真實網絡。 他們的虛擬“神經元”接收輸入,學習如何處理該輸入,并根據其先前的知識生成輸出。

This is very similar to what out brain does every single moment of every single day.

這與大腦每一天每一刻所做的事情非常相似。

Thanks to neural networks, a Machine Learning algorithm can learn how to predict the expected output from a given input based on previous knowledge.

得益于神經網絡,機器學習算法可以根據先前的知識學習如何根據給定的輸入預測預期的輸出。

For example, when you see recommended videos on YouTube, those recommendations were generated by neural networks that predict what videos you might like to watch based on your previous patterns. Amazing, right?

例如,當您在YouTube上看到推薦的視頻時,這些推薦是由神經網絡生成的,這些神經網絡會根據以前的模式來預測您可能希望觀看的視頻。 太好了吧?

💡 Tip: This is an interesting article by Google if you would like to read more about this YouTube example.

💡提示:如果您想閱讀有關此YouTube示例的更多信息,這是Google的一篇有趣的文章 。

Python和機器學習 (Python and Machine Learning)

I'm sure you must be asking: what is the role of Python in this area? It is one of the most popular and powerful tools used to program this type of system.

我確定您一定要問:Python在這一領域的作用是什么? 它是用于對這種類型的系統進行編程的最流行和功能最強大的工具之一。

One of the most popular libraries used by developers around the world to work with Python applied to Machine Learning is TensorFlow. It's a free open-source library developed by the Google Brain Team. This library is used for research and production at Google.

TensorFlow是全世界開發人員在將Python應用于機器學習時使用的最受歡迎的庫之一。 這是Google Brain團隊開發的免費開源庫。 該庫用于Google的研究和生產。

According to Jeff Dean, the lead of Google's Artificial Intelligence division:

Google人工智能部門負責人Jeff Dean表示:

Today it is used heavily in our speech recognition systems, in a new Google Photos product, Gmail, and Google Search. (source)

如今,它已廣泛用于我們的語音識別系統,新的Google相冊產品,Gmail和Google搜索中。 ( 來源 )

The best part is that developers all over the world can use this library to tackle real-world problems.

最好的部分是,全世界的開發人員都可以使用該庫來解決實際問題。

💡 Tip: This is a great video about TensorFlow made by Google.

💡提示:這是Google制作的有關TensorFlow的精彩視頻 。

These are two other popular Python libraries used for Machine Learning:

這是用于機器學習的另外兩個流行的Python庫:

  • Keras – an open-source neural-network library written in Python.

    Keras –用Python編寫的開源神經網絡庫。

  • PyTorch – an open-source Machine Learning library used for developing and training neural networks.

    PyTorch –一個開源的機器學習庫,用于開發和訓練神經網絡。

Python中的機器學習項目 (Machine Learning Projects in Python)

The potential of Machine Learning is really endless. It can be applied to virtually any area and context that you can think of. If the task requires learning from patterns and predicting output, then a Machine Learning model can definitely help.

機器學習的潛力確實是無限的。 它幾乎可以應用于您能想到的任何領域和環境。 如果任務需要學習模式并預測輸出,那么機器學習模型絕對可以提供幫助。

For example, to give you an idea of the type of projects that you can create, freeCodeCamp's curriculum includes a free Machine Learning with Python Certification:

例如,為了讓您大致了解可以創建的項目類型, freeCodeCamp的課程包括免費的具有Python認證的機器學習

During the certification, you work on and complete these projects:

在認證期間,您將從事并完成以下項目:

  • Rock Paper Scissors.

    剪刀石頭布。
  • Cat and Dog Image Classifier.

    貓和狗圖像分類器。
  • Book recommendation engine using K-Nearest Neighbors.

    使用K最近鄰居的圖書推薦引擎。
  • Linear Regression health costs calculator.

    線性回歸健康費用計算器。
  • Neural Network SMS classifier.

    神經網絡SMS分類器。

實際應用的更多示例 (More Examples of Real-World Applications)

You can find more examples of the applications of Machine Learning in Kaggle, an "online community of data scientists and machine learning practitioners" owned by Google.

您可以在Google擁有的“數據科學家和機器學習從業人員在線社區” Kaggle中找到有關機器學習應用的更多示例。

In this platform, you can practice your Python and Machine Learning skills by working on projects and participating in competitions.

在這個平臺上,您可以通過參與項目和參加比賽來練習Python和機器學習技能。

To give you an idea of the type of projects that you can tackle with Machine Learning, previous competitions in Kaggle include:

為了讓您了解可以使用機器學習解決的項目類型,以前在Kaggle中進行的比賽包括:

  • Predicting lung function decline.

    預測肺功能下降。
  • Predicting survival on the Titanic.

    預測泰坦尼克號的生存時間。
  • Building tools for bird population monitoring.

    用于監視鳥類數量的構建工具。
  • Labeling famous landmarks.

    標記著名的地標。
  • Forecasting COVID-19 spread.

    預測COVID-19傳播。
  • Estimating the unit sales of Walmart retail goods.

    估計沃爾瑪零售商品的單位銷售額。
  • Identifying videos with face or sound manipulations.

    通過面部或聲音操作識別視頻。
  • Predicting wait times at major city intersections.

    預測主要城市十字路口的等待時間。
  • Detecting fraud from customer transactions.

    從客戶交易中檢測欺詐。
  • Predicting a movie's worldwide box office revenue.

    預測電影的全球票房收入。
  • Predicting pet adoption.

    預測收養寵物。
  • Identifying risk when pilots are distracted, sleepy, or in other dangerous cognitive states.

    識別飛行員分心,困倦或處于其他危險認知狀態時的風險。

As you can see, just in this short list of projects, the applications range from medicine to business, from biology to risk detection, and from fraud detection to image processing. The possibilities are truly endless when you tackle real-world problems using Machine Learning.

如您所見,僅在這個簡短的項目列表中,應用程序就涵蓋了從醫學到商業,從生物學到風險檢測以及從欺詐檢測到圖像處理的各種應用。 當您使用機器學習解決實際問題時,可能性是無限的。

學習資源 (Learning Resources)

freeCodeCamp's YouTube channel has these helpful tutorials to get you started with Machine Learning in Python:

freeCodeCamp的YouTube頻道提供了以下有用的教程,可幫助您開始使用Python進行機器學習:

  • TensorFlow 2.0 Complete Course - Python Neural Networks for Beginners Tutorial

    TensorFlow 2.0完整課程-初學者的Python神經網絡教程

  • Develop an AI to play Connect Four - Python Tutorial

    開發AI來玩Connect Four-Python教程

  • Scikit-Learn Course - Machine Learning in Python Tutorial

    Scikit-Learn課程-Python機器學習教程

  • PyTorch for Deep Learning - Full Course / Tutorial

    PyTorch深度學習-完整課程/教程

🔹網站開發 (🔹 Web Development)

Python is used in the field of web development to build the back-end of web applications. Let's start this section by talking a little bit about what the back-end is and how it helps us to create web applications.

Python在Web開發領域中用于構建Web應用程序的后端。 讓我們從本節開始,先討論一下后端是什么以及它如何幫助我們創建Web應用程序。

用于后端Web開發的Python (Python for Back-End Web Development)

In a web application, all the code used to interact with the user and create what the user sees is called the front-end part of the application.

在Web應用程序中,用于與用戶交互并創建用戶所見內容的所有代碼都稱為應用程序的前端部分。

Python is used to code the behind-the-scenes functionality of the application, the part that powers all the functionality of the application but that you don't see directly on screen.

Python用于對應用程序的幕后功能進行編碼,該部分可為應用程序的所有功能提供支持,但您不能直接在屏幕上看到它。

It handles the server-side of the application, interacting with all the necessary databases when the user requests data. It returns the requested data to the user to make the application run as expected.

它處理應用程序的服務器端,并在用戶請求數據時與所有必需的數據庫進行交互。 它將請求的數據返回給用戶,以使應用程序按預期運行。

💡 Tip: Full-Stack Web Development involves both the front-end and back-end of a web application to make it presentable to the user while working with databases.

提示:全棧Web開發涉及Web應用程序的前端和后端,以使其在使用數據庫時可呈現給用戶。

Web框架 (Web Frameworks)

These are some popular Python web frameworks:

這些是一些流行的Python Web框架:

  • Django: a "high-level Python Web framework that encourages rapid development and clean, pragmatic design."

    Django :“鼓勵快速開發和簡潔實用的設計的高級Python Web框架”。

  • Flask: a very popular microframework used to develop web applications in Python.

    Flask :一種非常流行的微框架,用于用Python開發Web應用程序。

  • Pyramid: a "small, fast, down-to-earth Python web framework."

    金字塔 :“一個小型,快速,扎實的Python Web框架。”

  • Web2Py: a "free open source full-stack framework for rapid development of fast, scalable, secure and portable database-driven web-based applications."

    Web2Py :“用于快速開發快速,可擴展,安全和可移植的數據庫驅動的基于Web的應用程序的免費開源全棧框架。”

  • Bottle: a "fast, simple and lightweight WSGI micro web-framework for Python."

    Bottle :“一個快速,簡單,輕量級的WSGI Python微Web框架。”

學習資源 (Learning Resources)

freeCodeCamp's YouTube channel has great free tutorials to learn web development in Python:

freeCodeCamp的YouTube頻道提供了許多很棒的免費教程,以學習Python的網絡開發:

  • Python Django Web Framework - Full Course for Beginners

    Python Django Web框架-初學者完整課程

  • Learn Flask for Python - Full Tutorial

    學習Flask for Python-完整教程

  • Web Programming with Flask - Intro to Computer Science - Harvard's CS50 (2018)

    使用Flask進行Web編程-計算機科學入門-哈佛大學的CS50(2018)

  • Full stack Python Flask tutorial - Build a social network

    全棧Python Flask教程-建立社交網絡

These are also great free resources to learn how to work with these frameworks:

這些也是免費的寶貴資源,可幫助您學習如何使用這些框架:

  • Django "First Steps" section

    Django“第一步”部分

  • Pyramid Tutorials

    金字塔教程

  • Quick Tutorial for Pyramid

    金字塔快速教程

🔸計算機科學教育 (🔸 Computer Science Education)

Python currently plays a key role in computer science education around the world. ?Let's see why.

Python目前在全世界的計算機科學教育中發揮著關鍵作用。 讓我們看看為什么。

為什么是Python? (Why Python?)

Python is so widely used as a teaching tool because:

Python之所以被廣泛用作教學工具,是因為:

  • It is easy to learn: its syntax is simple and it can be learned quickly. Students start diving into more advanced aspects of computer science much more quickly than with other programming languages.

    它易于學習:其語法簡單并且可以快速學習。 與使用其他編程語言相比,學生可以更快地開始深入計算機科學的更高級方面。

  • It is powerful: it is used in real-world applications, so students immediately start acquiring valuable skills for their careers.

    它功能強大:它可用于實際應用中,因此學生可以立即開始獲得其職業上寶貴的技能。

  • It is versatile: it supports various programming paradigms including imperative programming, functional programming, procedural programming, and object-oriented programming.

    它用途廣泛:它支持各種編程范例,包括命令式編程,函數式編程,過程式編程和面向對象的編程。

The creator of the Python language, Guido van Rossum, stated that:

Python語言的創建者Guido van Rossum指出:

Now, it's my belief that Python is a lot easier than to teach to students programming and teach them C or C++ or Java at the same time because all the details of the languages are so much harder.
現在,我相信Python比向學生教編程和同時教他們C或C ++或Java容易得多,因為語言的所有細節都難得多。

Python's syntax is simple and straightforward, so students can start learning computational thinking and problem-solving skills much more quickly, which is usually the main goal of introductory computer science courses.

Python的語法簡單明了,因此學生可以更快地開始學習計算思維和解決問題的技能,這通常是計算機科學入門課程的主要目標。

課堂和在線學習中的Python (Python in the Classroom and Online Learning)

Many universities and schools around the world have decided to teach introductory programming and computer science courses using Python.

世界各地的許多大學和學校都決定使用Python教授入門編程和計算機科學課程。

For example, MIT, one of the world's leading universities in the field of technology, teaches introductory computer science and programming using Python (both in the on-campus and online versions of the course on edX).

例如,麻省理工學院(MIT)是技術領域的世界領先大學之一,它使用python(在edX課程的校園版和在線版中)教授入門計算機科學和編程。

According to an article by MIT News published when the online version of the course reached 1.2 million enrollments, the course "has become the most popular MOOC in MIT history".

根據麻省理工學院新聞社發表的一篇文章,當該課程的在線版本注冊達到120萬時,該課程“已成為麻省理工學院歷史上最受歡迎的MOOC”。

This clearly shows that Python's popularity continues to rise. In the article you can find testimonies of students who learned Python and how this new knowledge improved their lives.

這清楚地表明Python的受歡迎程度持續上升。 在本文中,您可以找到學習過Python的學生的見證,以及這些新知識如何改善他們的生活。

In the article, Professor Ana Bell, lecturer in the EECS Department at MIT, states that:

在本文中,麻省理工學院EECS系講師Ana Bell教授指出:

“At its core, the 6.00 series teaches computational thinking...It does this using the Python programming language, but the course also teaches programming concepts that can be applied in any other programming language.”
“從本質上講,6.00系列教授計算思想……它使用Python編程語言來實現,但是該課程還教授可以應用于任何其他編程語言的編程概念。”

This clearly shows the potential of Python as a teaching tool. It can be used to teach higher level concepts that can be applied to other programming languages.

這清楚地顯示了Python作為教學工具的潛力。 它可用于教授可應用于其他編程語言的高級概念。

And it does this without the extra layer of complexity that the syntax of other programming languages like Java or C might add to the learning process.

這樣做不會造成其他編程語言(如Java或C)的語法可能增加學習過程的復雜性。

During the last few years, online courses have become an important part of the daily lives of learners of all ages worldwide. The variety of free online courses and resources has expanded tremendously in the last few years. ?

在過去的幾年中,在線課程已成為全球所有年齡段學習者日常生活的重要組成部分。 在過去的幾年中,免費的在線課程和資源的種類已大大增加。

For example, freeCodeCamp's curriculum includes three free certificates with projects to help you expand your Python skills in key areas with high demand worldwide:

例如, freeCodeCamp的課程包括三個帶有項目的免費證書,可幫助您在全球范圍內需求旺盛的關鍵領域擴展Python技能:

  • Scientific Computing with Python.

    使用Python進行科學計算。
  • Data Analysis with Python.

    使用Python進行數據分析。
  • Machine Learning with Python.

    使用Python進行機器學習。

Harvard University also offers these online courses that can be audited for free:

哈佛大學還提供可以免費審核的這些在線課程:

  • CS50's Introduction to Computer Science.

    CS50的計算機科學概論。
  • CS50's Web Programming with Python and JavaScript.

    CS50的使用Python和JavaScript進行Web編程。
  • CS50's Introduction to Artificial Intelligence with Python.

    CS50的Python人工智能簡介。

Python has definitely become a key tool that has improved computer science education worldwide. And it will continue to do so in the future.

Python無疑已經成為改善全世界計算機科學教育的關鍵工具。 將來它將繼續這樣做。

If you are thinking about teaching a course using Python or learning Python, I guarantee you that your time and effort will be totally worth it.

如果您正在考慮使用Python教授課程或學習Python,那么我保證您的時間和精力將是完全值得的。

🔹計算機視覺與圖像處理 (🔹 Computer Vision and Image Processing)

Python is used for computer vision and image processing, fields that are expanding rapidly.

Python用于計算機視覺和圖像處理,這些領域正在Swift擴展。

The goal of image processing is to process an image, apply transformations to it, and return a new version of the original image. ?

圖像處理的目標是處理圖像,對其進行轉換,然后返回原始圖像的新版本。

In contrast, the goal of computer vision is more complex because it tries to make the computer understand and interpret an image and its content.

相反,計算機視覺的目標更加復雜,因為它試圖使計算機理解和解釋圖像及其內容。

圖像處理 (Image Processing )

Let's start with image processing. With a Python library, you can perform operations such as:

讓我們從圖像處理開始。 使用Python庫,您可以執行以下操作:

  • Cropping, flipping, and rotating.

    裁剪,翻轉和旋轉。
  • Manipulating exposure and color channels.

    操縱曝光和色彩通道。
  • Detecting edges and lines.

    檢測邊緣和線條。
  • Adding filters and restoring images.

    添加過濾器并還原圖像。

計算機視覺 (Computer Vision )

Now let's dive into computer vision. If you start researching this topic, you might be surprised by its current applications. Some of them are:

現在,讓我們深入研究計算機視覺。 如果您開始研究此主題,您可能會對它的當前應用感到驚訝。 他們之中有一些是:

  • Navigation.

    導航。
  • Object and Event Detection.

    對象和事件檢測。
  • Facial recognition.

    面部識別。
  • Image classification.

    圖像分類。

This scientific field is so important that Google developed a tool called Cloud Vision, which has a Python version for developers to incorporate this functionality into their programs.

這個科學領域是如此重要,以至于Google開發了一個名為Cloud Vision的工具,該工具具有Python版本,供開發人員將該功能整合到他們的程序中。

According to the "Using the Vision API with Python" tutorial in Google Codelabs, the Google Cloud Vision API:

根據Google Codelabs中的“ 將Vision API與Python結合使用 ”教程,Google Cloud Vision API:

Allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content.
使開發人員可以輕松地在應用程序中集成視覺檢測功能,包括圖像標簽,面部和界標檢測,光學字符識別(OCR)和顯式內容的標記。

This set of tools provides functionality for face detection, landmark detection, logo detection, label detection, text detection, and more.

這套工具提供了面部檢測,界標檢測,徽標檢測,標簽檢測,文本檢測等功能。

💡 Tip: One of the most amazing applications of computer vision is the development of software to control self-driving cars. These vehicles need to "see" where they are driving, where the lane is, and what objects surround them (including other vehicles). Computer vision plays a key role in this functionality.

提示:計算機視覺最令人驚奇的應用之一是開發用于控制自動駕駛汽車的軟件。 這些車輛需要“看”他們在哪里行駛,車道在哪里以及它們周圍有什么物體(包括其他車輛)。 計算機視覺在此功能中起著關鍵作用。

Python庫 (Python Libraries)

These are some awesome libraries for computer vision and image processing:

這些是用于計算機視覺和圖像處理的出色庫:

  • OpenCV: an "open source computer vision and machine learning software library". Its Python version is called OpenCV-Python.

    OpenCV :“開源計算機視覺和機器學習軟件庫”。 它的Python版本稱為OpenCV-Python。

  • scikit-image: a "collection of algorithms used for image processing".

    scikit-image :“用于圖像處理的算法的集合”。

  • NumPy: it can be used to process the pixels of an image as a 2D array.

    NumPy :可用于將圖像的像素處理為2D數組。

  • SciPy: the scipy.ndimage package "contains various functions for multidimensional image processing."

    SciPy : scipy.ndimage包“包含用于多維圖像處理的各種功能”。

🔸游戲開發 (🔸 Game Development)

Games definitely shape lives and create timeless memories. They will continue to be part of our society in the years to come. Python is already there, lighting the spark of game creation.

游戲絕對可以塑造生活并創造永恒的回憶。 在未來的幾年中,它們將繼續成為我們社會的一部分。 Python已經存在,點燃了游戲創作的火花。

Python游戲開發框架 (Python Game Development Frameworks)

According to the official Python Documentation, there are two main Python frameworks used to develop games:

根據官方Python文檔 ,有兩個主要的Python框架用于開發游戲:

  • pygame: "the original and still very much active package for game development using Python. It allows Python to talk to SDL, a cross-platform, multimedia library. Because it needs to be compiled for each platform and each Python version, there can be a lag when a new Python version comes along."

    pygame :“使用Python進行游戲開發的原始且仍非常活躍的軟件包。它允許Python與跨平臺的多媒體庫SDL進行通信 。因為需要針對每個平臺和每個Python版本進行編譯,新的Python版本問世時出現了滯后。”

  • pyglet: this is "the newcomer, based on OpenGL. Because it is a pure Python package, it can be used as is even when a new Python version is released (except for the Python 2 to Python 3 transition)."

    pyglet :這是“基于OpenGL的新手。因為它是純Python軟件包,所以即使發布了新的Python版本(從Python 2到Python 3的過渡除外),也可以照常使用。”

You can also use the turtle module to create simple games. Turtle is a built-in Python module that is installed automatically when you install Python in your computer. It helps you to create games with simple graphics and with a simple user interface.

您還可以使用turtle模塊創建簡單的游戲。 Turtle是內置的Python模塊,當您在計算機中安裝Python時會自動安裝。 它可以幫助您創建具有簡單圖形和簡單用戶界面的游戲。

學習資源 (Learning Resources)

If you want learn game development in Python, freeCodeCamp's YouTube channel has these great free tutorials:

如果您想用Python學習游戲開發,freeCodeCamp的YouTube頻道提供了以下出色的免費教程:

  • Learn Python by Building Five Games - Full Course

    通過構建五個游戲學習Python-完整課程

  • Python and Pygame Tutorial - Build Tetris! Full GameDev Course

    Python和Pygame教程-構建俄羅斯方塊! 完整的GameDev課程

  • Snake Game Python Tutorial

    蛇游戲Python教程

🔹醫學與藥理學 (🔹 Medicine and Pharmacology)

Python also has amazing applications in the medical field. You will be surprised by how technology is being combined with medical knowledge to provide accurate and efficient diagnoses and treatments to patients.

Python在醫學領域也有驚人的應用程序。 您將對技術與醫學知識相結合以為患者提供準確有效的診斷和治療感到驚訝。

應用領域 (Applications)

Some examples of the use of Python in medicine and pharmacology include:

在醫學和藥理學中使用Python的一些示例包括:

  • Making clinical diagnoses based on the patients' medical records and symptoms.

    根據患者的病歷和癥狀進行臨床診斷。
  • Analyzing medical data.

    分析醫療數據。
  • Making computational models to speed up the process of development of new medications.

    建立計算模型以加快新藥物的開發過程。

These broad applications include thousands and thousands of examples around the world. I selected a few of them to illustrate how Python is shaping this field. Let's take a look at them.

這些廣泛的應用程序包括全世界成千上萬的示例。 我選擇了其中一些來說明Python如何塑造這個領域。 讓我們看看它們。

制藥成功案例:阿斯利康 (Pharmaceutical Success Story: AstraZeneca)

According to the official Python Documentation, one of the world's leading pharmaceutical companies, AstraZeneca, used Python to improve their existing computational models to make them "more robust, extensible, and maintainable".

根據官方的Python文檔 ,世界領先的制藥公司之一阿斯利康(AstraZeneca )使用Python改進了現有的計算模型,以使其“更健壯,可擴展且可維護”。

Researchers used these models simulate the chemical structure of molecules and their effect in the body. This helped scientists identify potential molecules for new drugs and start testing them more quickly in the laboratory.

研究人員使用這些模型來模擬分子的化學結構及其在人體中的作用。 這有助于科學家識別新藥的潛在分子,并開始在實驗室中更快地對其進行測試。

When he joined the team, Andrew Dalke, being a a "well-known advocate for Python in computational chemistry and biology" convinced the team that Python was exactly what they needed.

當他加入團隊時,曾是“計算化學和生物學中Python的著名倡導者”的Andrew Dalke讓團隊確信Python正是他們所需要的。

Python was chosen for this work because it is one of the best languages available for physical scientists, that is, for people who do not have a computer science background.
之所以選擇Python,是因為它是物理科學家(即沒有計算機科學背景的人)可以使用的最佳語言之一。

He stated that:

他說:

Python was designed to solve real-world problems faced by an expert programmer. The result is a language that scales well from small scripts written by a chemist to large packages written by a software developer.
Python旨在解決專家程序員面臨的現實問題。 結果是一種語言可以很好地擴展,從化學家編寫的小腳本到軟件開發人員編寫的大軟件包。

Amazing, right? Python can power the computational models that pharmaceutical laboratories use to develop new drugs.

太好了吧? Python可以為制藥實驗室用來開發新藥物的計算模型提供支持。

紅細胞(RBC)鑒定 (Red Blood Cells (RBC) Identification)

Another interesting medical application of Python is related to Hematology. Usually, specialized professionals analyze blood tests by counting and identifying cells manually, but this can be improved with the help of automation.

Python的另一個有趣的醫學應用與血液學有關。 通常,專業人士通過手動計數和識別細胞來分析血液測試,但是可以借助自動化來改善這一點。

Researchers found that Python can be the right tool for the job. Let's see an interesting project.

研究人員發現Python可能是完成這項工作的正確工具。 讓我們看一個有趣的項目。

IdentiCyteThe goal of this project is to identify and classify red blood cells shapes based on images taken from optical microscopes. According to this article, "RBC shape can help to diagnose diseases and disorders such as leukaemia, sickle cell anaemia and malaria."

IdentiCyte該項目的目的是基于光學顯微鏡拍攝的圖像來識別和分類紅細胞的形狀。 根據這篇文章 ,“ RBC形狀可以幫助診斷疾病和病癥,例如白血病,鐮狀細胞性貧血和瘧疾。”

The project was developed by researchers from the Bioresource Processing Research Institute Australia. It was programmed in Python and it used image processing Python packages and libraries such as numpy, scipy, opencv-python, scikit-learn, and matplotlib.

該項目是由澳大利亞生物資源加工研究所的研究人員開發的。 它使用Python編程,并使用圖像處理Python軟件包和庫,例如numpy,scipy,opencv-python,scikit-learn和matplotlib。

Python醫療包 (Python Medical Packages)

  • pyGeno: an open-source Python package developed by Tariq Daouda at the Institute for Research in Immunology and Cancer (IRIC). It's intended for "precision medicine applications that revolve around genomics and proteomics". It works with reference and personalized genomes.

    pyGeno :由Tariq Daouda在免疫學和癌癥研究所( ICRIC )研發的開源Python軟件包。 它旨在用于“圍繞基因組學和蛋白質組學的精密醫學應用”。 它可與參考基因和個性化基因組一起使用。

  • MedPy: an open-source Python library "for medical image processing in Python, providing basic functionalities for reading, writing and manipulating large images of arbitrary dimensionality."

    MedPy :一個開放源代碼的Python庫,“用于Python中的醫學圖像處理,提供用于讀取,寫入和處理任意維數大圖像的基本功能。”

實際醫療應用(示例) (Real-World Medical Applications (Examples))

  • Gusztav Belteki presented another example during his talk at PyData Berlin 2018 "Python in Medicine: analysing data from mechanical ventilators." The goal of his research was to "interpret large datasets retrieved from modern equipment used in neonatal intensive care, mechanical ventilators and patient monitors."

    Gusztav Belteki在PyData Berlin 2018的演講中提出了另一個示例“ Python in Medicine:分析來自機械呼吸機的數據 ”。 他的研究目標是“解釋從新生兒重癥監護室,機械通氣機和患者監護儀中使用的現代設備中檢索到的大型數據集”。

  • At PyCon 2019, Jill Cates gave this presentation titled "How to Build a Clinical Diagnostic Model in Python."

    在PyCon 2019上,吉爾·凱茨(Jill Cates)進行了名為`` 如何在Python中建立臨床診斷模型 ''的演講。

🔸生物與生物信息學 (🔸 Biology and Bioinformatics)

Python also has amazing applications in the world of Biology and Bioinformatics. These include processing DNA sequences, simulating population dynamics and genetics, and modeling biochemical structures.

Python在生物學和生物信息學領域也有驚人的應用程序。 其中包括處理DNA序列,模擬種群動態和遺傳學以及對生化結構進行建模。

生物蟒 (Biopython)

Biopython is a Python framework with "freely available tools for biological computation". Its goal is to "address the needs of current and future work in bioinformatics."

Biopython是一個Python框架,帶有“免費的生物計算工具”。 其目標是“滿足當前和未來生物信息學工作的需求”。

According to its documentation, this framework includes functionality such as the ability to:

根據其文檔 ,此框架包括以下功能:

  • Work with sequences and perform common operations on them such as transcription, translation, and weight calculations.

    處理序列并對其進行通用操作,例如轉錄,翻譯和權重計算。
  • Connect with biological databases.

    與生物學數據庫連接。
  • Perform classification of data using K-Nearest Neighbors, Naive Bayes, and Support Vector Machines.

    使用K最近鄰居,樸素貝葉斯和支持向量機執行數據分類。
  • Work with phylogenetic trees and population genetics.

    處理系統樹和種群遺傳學。

The documentation states that "the goal of Biopython is to make it as easy as possible to use Python for bioinformatics by creating high-quality, reusable modules and classes."

該文檔指出:“ Biopython的目標是通過創建高質量,可重用的模塊和類,使其盡可能容易地將Python用于生物信息學。”

Rosalind:通過解決生物信息學挑戰來練習Python (Rosalind: Practice Python by Solving Bioinformatics Challenges)

Rosalind is "a platform for learning bioinformatics through problem solving." It is "free and open to the public" (the FAQ page indicates that it is in beta mode).

Rosalind是“通過解決問題來學習生物信息學的平臺”。 它是“免費的并向公眾開放”(“常見問題”頁面指示它處于beta模式)。

Python can be used to solve the challenges on the platform. Since this is a very popular programming language in the platform, there is a "Python Village" section where you can learn the basics of Python before tackling bioinformatics algorithms.

Python可用于解決平臺上的挑戰。 由于這是平臺上非常流行的編程語言,因此有一個“ Python村 ”部分,您可以在學習生物信息學算法之前學習Python的基礎知識。

Users solve the problems by running their solutions on their computer, processing the given dataset, and copy/pasting the output to check the answer.

用戶通過在計算機上運行其解決方案,處理給定的數據集并復制/粘貼輸出以檢查答案來解決問題。

💡 Tip: The project's name commemorates Rosalind Franklin, "whose X-ray crystallography with Raymond Gosling facilitated the discovery of the DNA double helix by Watson and Crick".

提示:該項目的名稱是紀念羅莎琳德·富蘭克林 ( Rosalind Franklin)所為 ,“他與雷蒙德·高斯林(Raymond Gosling)進行的X射線晶體學研究促進了沃森(Watson)和克里克(Crick)發現DNA雙螺旋結構”。

包和框架 (Packages and Frameworks )

  • ProDy: a free and open-source package "for protein structural dynamics analysis" developed by Bahar Lab at the University of Pittsburgh.

    ProDy :由匹茲堡大學的Bahar Lab開發的“用于蛋白質結構動力學分析”的免費開源軟件包。

  • PySB: a "framework for building mathematical models of biochemical systems as Python programs" developed by members of the Lopez Lab at Vanderbilt University and the Sorger Lab at Harvard Medical School.

    PySB 范德比爾特大學洛佩茲實驗室和哈佛醫學院索爾格實驗室的成員開發的“構建作為Python程序的生化系統數學模型的框架”。

  • The Community Simulator: this is a "freely available Python package for simulating microbial population dynamics in a reproducible, transparent and scalable way" developed by researchers at Boston University.

    社區模擬器:這是由波士頓大學研究人員開發的“可重現,透明和可擴展的方式免費提供的Python軟件包,用于模擬微生物種群動態”。

💡 Tip: If you would like to learn more about the applications of Python in Bioinformatics, here's a talk by Martin Schweitzer at PyCon Australia: "Python for Bioinformatics for learning Python".

提示:如果您想了解有關Python在生物信息學中的應用的更多信息,這是澳大利亞PyCon的Martin Schweitzer的演講:“ 用于學習Python的生物信息學的Python ”。

🔹神經科學與心理學 (🔹 Neuroscience and Psychology)

Python also has applications in neuroscience and experimental psychology research.

Python在神經科學和實驗心理學研究中也有應用。

神經科學中的Python (Python in Neuroscience)

According to the article Python in neuroscience written by researchers from the Center for Brain Simulation, Ecole Polytechnique Fédérale de Lausanne, Geneva, Switzerland:

根據瑞士日內瓦洛桑聯邦理工學院腦仿真中心的研究人員寫的神經科學中的Python文章:

Computation is becoming essential across all sciences, for data acquisition and analysis, automation, and hypothesis testing via modeling and simulation.
對于通過建模和仿真進行數據采集和分析,自動化以及假設檢驗而言,計算在所有科學領域都變得至關重要。

In regards to Python, they state that:

關于Python,他們聲明:

It became clear to us in 2007 that we were on the cusp of an emerging Python in neuroscience ecosystem, particularly in computational neuroscience and neuroimaging, but also in electrophysiological data analysis and in psychophysics.

在2007年,對我們很明顯,我們正處于神經科學生態系統中新興Python的風口浪尖,特別是在計算神經科學和神經影像學,以及電生理數據分析和心理物理學中。

As you can see, Python and computation have been expanding across all sciences.

如您所見,Python和計算已在所有科學領域擴展。

精神病學 (PsychoPy)

PsychoPy is "an open-source package for running experiments in Python" supported by the University of Nottingham. According to the official Documentation of this package:

PsychoPy是由諾丁漢大學支持的“用于在Python中運行實驗的開源軟件包”。 根據該軟件包的官方文檔 :

It is used by many labs worldwide for psychophysics, cognitive neuroscience and experimental psychology.
全球許多實驗室將其用于心理物理學,認知神經科學和實驗心理學。

The official website of this package states that it is:

該軟件包的官方網站上指出:

  • Easy for learning.

    易于學習。
  • Precise enough for Psychophysics.

    足夠精確的心理物理學。
  • Flexible.

    靈活。
  • Online or lab-based depending on the user's choice.

    在線或基于實驗室,具體取決于用戶的選擇。

🔸天文學 (🔸 Astronomy)

Python also has applications in Astronomy and Astrophysics. Let's see three of the main Python packages used in this scientific area:

Python在天文學和天體物理學中也有應用。 讓我們看看該科學領域中使用的三個主要Python軟件包:

(Astropy)

The Astropy package "contains various classes, utilities, and a packaging framework intended to provide commonly-used astronomy tools."

Astropy包“包含各種類,實用程序和旨在提供常用天文學工具的包框架”。

Astropy is part of a larger project called The Astropy Project, which is "is a community effort to develop a common core package for Astronomy in Python and foster an ecosystem of interoperable astronomy packages."

Astropy是名為The Astropy Project的較大項目的一部分,該項目是“社區為開發Python中的天文學通用核心軟件包并建立可互操作的天文學軟件包的生態系統而做出的努力”。

According to its About page, one of its goals is to "improve usability, interoperability, and collaboration between astronomy Python packages."

根據其About頁面,其目標之一是“改善天文學Python軟件包之間的可用性,互操作性和協作”。

💡 Tip: You can see examples of projects made with Astropy in the Example Gallery.

提示:您可以在示例庫中查看使用Astropy進行的項目的示例 。

SunPy (SunPy)

The SunPy package is described as "the community-developed, free and open-source solar data analysis environment for Python." It builds upon the capabilities of Python packages such as NumPy, SciPy, Matplotlib, and Pandas.

SunPy軟件包被描述為“社區開發的,用于Python的免費開源太陽能數據分析環境”。 它建立在Python軟件包(如NumPy,SciPy,Matplotlib和Pandas)的功能之上。

太空飛人 (SpacePy)

The SpacePy package is "a package for Python, targeted at the space sciences, that aims to make basic data analysis, modeling and visualization easier."

SpacePy軟件包是“面向太空科學的Python軟件包,旨在簡化基本數據分析,建模和可視化。”

According to its official Documentation:

根據其官方文檔 :

The SpacePy project seeks to promote accurate and open research standards by providing an open environment for code development.
SpacePy項目旨在通過提供開放的代碼開發環境來促進準確和開放的研究標準。

According to the description of its GitHub repository, it has superposed epoch classes, drift shell tracing, access to magnetic field models, streamline tracing, bootstrap confidence limits, time and coordinate conversions, and more.

根據其GitHub存儲庫的描述,它具有疊加的紀元類,漂移殼跟蹤,對磁場模型的訪問,流線型跟蹤,自舉置信度限制,時間和坐標轉換等。

🔹其他應用 (🔹 Other Applications)

Python can also be applied in many other areas, including:

Python也可以應用于許多其他領域,包括:

  • Robotics: Python can be used to program robots. A library written for this purpose is pybotics, "an open-source Python toolbox for robot kinematics and calibration".

    機器人: Python可用于對機器人進行編程。 為此目的編寫的庫是pybotics ,“用于機器人運動學和標定的開源Python工具箱”。

  • Autonomous vehicles: Python can be used to program the software that controls self-driving cars. These cars need computer vision to "see" where they are driving, where the lane is, and what objects surround them.

    自動駕駛汽車: Python可用于對控制自動駕駛汽車的軟件進行編程。 這些汽車需要計算機視覺才能“看到”他們在哪里行駛,在哪里車道以及周圍有什么物體。

  • Meteorology: The package climate-indices "contains Python implementations of various climate index algorithms which provide a geographical and temporal picture of the severity of precipitation and temperature anomalies useful for climate monitoring and research."

    氣象學 : 氣候索引包“包含各種氣候指數算法的Python實現,這些算法提供了對氣候監測和研究有用的降水和溫度異常嚴重程度的地理和時間圖。”

  • Business: Python can be a powerful tool to analyze data generated by businesses and to forecast future trends.

    業務: Python可以成為分析業務產生的數據并預測未來趨勢的強大工具。

  • Graphical User Interface (GUI) Development: Python can be used to create graphical user interfaces with tools like tkinter.

    圖形用戶界面(GUI)開發 :可以使用Python使用tkinter之類的工具來創建圖形用戶界面。

  • If you're interested in learning more about this, freeCodeCamp has a great tutorial on YouTube: Tkinter Course - Create Graphic User Interfaces in Python Tutorial.

    如果您想了解更多有關此的知識,freeCodeCamp在YouTube上有一個很棒的教程: Tkinter課程-在Python教程中創建圖形用戶界面。

綜上所述 (In Summary)

There are many applications of Python in every area that you can possibly imagine. I hope that this article gave you an idea of the wide range of real-world applications of this programming language in industries that are currently shaping our world. ?

您可能會想到的每個領域都有許多Python應用程序。 我希望本文能使您對這種編程語言在當前正在塑造我們世界的行業中在現實世界中的廣泛應用有所了解。

Remember that no matter which field you are in or which field you want to be in, learning Python will definitely open many doors for you. It is here to stay. And it has transformed and improved our current world and it will continue to do so for many years.

請記住,無論您處于哪個領域或想要成為哪個領域,學習Python無疑都會為您打開許多大門。 它在這里停留。 它已經改變并改善了我們當前的世界,并將在許多年內繼續如此。

I really hope that you liked my article and found it helpful. Check out my online courses. Follow me on Twitter. 👍

我真的希望您喜歡我的文章并認為對您有所幫助。 查看我的在線課程 。 在Twitter上關注我。 👍

翻譯自: https://www.freecodecamp.org/news/what-is-python-used-for-10-coding-uses-for-the-python-programming-language/

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/390317.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/390317.shtml
英文地址,請注明出處:http://en.pswp.cn/news/390317.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Publish/Subscribe

Publish/Subscribe 我們將會投遞一個消息給多個消費者,這種模式被稱為“publish/subscribe” 通俗的講,前面的是點對點隊列模型,現在講的是發布訂閱模型。 Exchanges producer:一個發送消息的用戶應用程序 queue:一個存…

[轉]在ROS下使用zeroconf配置多機通信

原文地址:http://www.corvin.cn/635.html,轉載主要方便隨時查閱,如有版權要求,請及時聯系。 0x00 為何需要配置ROS多機通信 眾所周知ROS是分布式系統,因此可以將機器人需要處理的復雜、計算量大的任務分解在多臺機器上…

python中斐波那契數列_斐波那契數列–在Python,JavaScript,C ++,Java和Swift中進行了解釋...

python中斐波那契數列by Pau Pavn通過保羅帕文(PauPavn) The Fibonacci sequence is, by definition, the integer sequence in which every number after the first two is the sum of the two preceding numbers. To simplify:根據定義,斐波那契數列是整數序列&a…

1583. 統計不開心的朋友

1583. 統計不開心的朋友 給你一份 n 位朋友的親近程度列表,其中 n 總是 偶數 。 對每位朋友 i,preferences[i] 包含一份 按親近程度從高到低排列 的朋友列表。換句話說,排在列表前面的朋友與 i 的親近程度比排在列表后面的朋友更高。每個列…

uva 247(floyd傳遞閉包)

為什么&#xff0c;逗號后面&#xff0c;還有空格........ #include <iostream> #include <cstring> #include <algorithm> #include <cstdio> #include <vector> #include <map> using namespace std; const int maxn50; int d[maxn][max…

VS Code 的常用快捷鍵和插件

注:文章摘自 風行天下一萬號 - 博客園 vs code 的常用快捷鍵 1、注釋&#xff1a; 單行注釋&#xff1a;[ctrlk,ctrlc] 或 ctrl/取消單行注釋&#xff1a;[ctrlk,ctrlu] (按下ctrl不放&#xff0c;再按k u)多行注釋&#xff1a;[altshiftA]多行注釋&#xff1a;/**2、移動行&a…

python包numpy_NumPy Python科學計算軟件包的終極指南

python包numpyNumPy (pronounced "numb pie") is one of the most important packages to grasp when you’re starting to learn Python.NumPy(讀作“麻木派”)是您開始學習Python時要掌握的最重要的軟件包之一。 The package is known for a very useful data str…

NGINX原理 之 SLAB分配機制(轉)

1 引言 眾所周知&#xff0c;操作系統使用伙伴系統管理內存&#xff0c;不僅會造成大量的內存碎片&#xff0c;同時處理效率也較低下。SLAB是一種內存管理機制&#xff0c;其擁有較高的處理效率&#xff0c;同時也有效的避免內存碎片的產生&#xff0c;其核心思想是預分配。其按…

apk之間數據共享的方式

1、四大組件之ContentProvider大法2、shareUserId3、apk均去遠端獲取配置文件&#xff08;或接口&#xff09;4、AIDL&#xff08;bindService&#xff09;5、SharePreference設置為MODE_WORLD_READABLE|MODE_WORLD_WRITEABLE模式&#xff0c;由于存在安全問題&#xff0c;已被…

藍橋杯java 基礎練習 十六進制轉十進制

問題描述從鍵盤輸入一個不超過8位的正的十六進制數字符串&#xff0c;將它轉換為正的十進制數后輸出。注&#xff1a;十六進制數中的10~15分別用大寫的英文字母A、B、C、D、E、F表示。樣例輸入FFFF樣例輸出65535import java.math.BigInteger; import java.util.Scanner;public …

dynamic web module消失不見

2019獨角獸企業重金招聘Python工程師標準>>> 方法1&#xff1a;在project Facets選項中勾選Dynamic Web Module即可 方法2&#xff1a; 我用eclipse對項目進行修改名稱&#xff0c;修改成功后。項目就沒有Deployment Descriptor&#xff08;如下圖紅色框中&#xff…

576. 出界的路徑數

576. 出界的路徑數 給你一個大小為 m x n 的網格和一個球。球的起始坐標為 [startRow, startColumn] 。你可以將球移到在四個方向上相鄰的單元格內&#xff08;可以穿過網格邊界到達網格之外&#xff09;。你 最多 可以移動 maxMove 次球。 給你五個整數 m、n、maxMove、star…

telnet命令發送郵件

下面的例子是用qq的smtp服務器。 set localecho 本地回顯啟用 telnet smtp.qq.com 25 220 smtp.qq.com Esmtp QQ Mail Server helo sis 250 smtp.qq.com//服務器返回250 smtp.qq.com STARTTLS 220 Ready to start TLS//服務器返回 220 準備開啟TLS通訊 auth login 334 VXNlcm5h…

myelcipse和maven搭建項目

偷懶一下&#xff0c;完了補充 轉載&#xff1a;https://www.cnblogs.com/jr1260/p/6438811.html https://www.cnblogs.com/yangmingyu/p/6908519.html https://www.cnblogs.com/henuyuxiang/p/6288476.html 轉載于:https://www.cnblogs.com/0914lx/p/8342343.html

551. 學生出勤記錄

551. 學生出勤記錄 I 給你一個字符串 s 表示一個學生的出勤記錄&#xff0c;其中的每個字符用來標記當天的出勤情況&#xff08;缺勤、遲到、到場&#xff09;。記錄中只含下面三種字符&#xff1a; ‘A’&#xff1a;Absent&#xff0c;缺勤 ‘L’&#xff1a;Late&#xff…

JavaScript實現職責鏈模式

什么是職責鏈模式 職責鏈模式的定義是&#xff1a;使多個對象都有機會處理請求&#xff0c;從而避免請求的發送者和接收者之間的耦合關系&#xff0c;將這些對象連成一條鏈&#xff0c;并沿著這條鏈傳遞該請求&#xff0c;直到有一個對象處理它為止。舉個例子&#xff1a;當你從…

Metrics介紹和Spring的集成

參考&#xff1a; http://colobu.com/2014/08/08/Metrics-and-Spring-Integration/ https://www.cnblogs.com/yangecnu/p/Using-Metrics-to-Profiling-WebService-Performance.html

配置 aws cli_AWS CLI教程–如何安裝,配置和使用AWS CLI了解您的資源環境

配置 aws cliHow to get exactly the account and environment information you need to manage your AWS account using just the AWS CLI如何僅使用AWS CLI準確獲取管理AWS賬戶所需的賬戶和環境信息 Installing the AWS CLI is actually quite simple. The best way to get …

grep遞歸查找頭文件_Grep命令教程–如何使用遞歸查找在Linux和Unix中搜索文件

grep遞歸查找頭文件grep stands for Globally Search For Regular Expression and Print out. It is a command line tool used in UNIX and Linux systems to search a specified pattern in a file or group of files. grep代表全局搜索正則表達式并打印出來 。 它是UNIX和Li…

C++ 前置聲明

&#xff08;一&#xff09;class的前置聲明 class的前置聲明有兩種。 pre.hclass PreA {}; main.hclass PreA; class Main {};//或者 class Main {class PreA* A; }; (二) struct前置聲明 struct的前置聲明只能用第一種。 &#xff08;三&#xff09; 有typedef的前置聲明 Pr…