<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Python on 春江暮客</title>
    <link>https://www.bobobk.com/en/tags/python/</link>
    <description>Recent content in Python on 春江暮客</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Fri, 24 Apr 2026 11:07:45 +0800</lastBuildDate>
    <atom:link href="https://www.bobobk.com/en/tags/python/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Build Your Own TRON Wallet Toolkit (Batch Address Generation / USDT Transfer / Staking &amp; Voting)</title>
      <link>https://www.bobobk.com/en/build_own_tron_wallet.html</link>
      <pubDate>Fri, 24 Apr 2026 11:07:45 +0800</pubDate>
      <guid>https://www.bobobk.com/en/build_own_tron_wallet.html</guid>
      <description>Three Python scripts covering the TRON wallet core loop: batch address generation, USDT/TRX transfer, staking/unstaking/voting, and energy delegation.</description>
    </item>
    <item>
      <title>Using Matplotlib&#39;s fill_between for Area Filling in Python</title>
      <link>https://www.bobobk.com/en/748.html</link>
      <pubDate>Wed, 29 Dec 2021 08:47:31 +0800</pubDate>
      <guid>https://www.bobobk.com/en/748.html</guid>
      <description>When plotting with matplotlib in Python, sometimes to enhance the aesthetics of the graph, it&amp;rsquo;s necessary to fill with color above or below the plot. The &amp;lsquo;fill_between&amp;rsquo; function is used for this, where the &amp;lsquo;y2&amp;rsquo; parameter determines the second line, indicating whether to fill upwards or downwards.</description>
    </item>
    <item>
      <title>Python: Creating Beautiful Lollipop Charts</title>
      <link>https://www.bobobk.com/en/955.html</link>
      <pubDate>Fri, 31 May 2024 10:03:32 +0800</pubDate>
      <guid>https://www.bobobk.com/en/955.html</guid>
      <description>The lollipop chart, as a variant of bar charts and dot plots, is increasingly popular in scientific research due to its simplicity and clarity. This chart cleverly combines the advantages of bar charts and scatter plots, offering a visually more attractive way to represent data.</description>
    </item>
    <item>
      <title>Downloading m3u8 Streaming Media Using Python and Embedding into AMP Webpages</title>
      <link>https://www.bobobk.com/en/892.html</link>
      <pubDate>Tue, 01 Aug 2023 09:02:57 +0800</pubDate>
      <guid>https://www.bobobk.com/en/892.html</guid>
      <description>In the era of short videos and live streaming, video formats are often no longer traditional ones like mp4 or mkv, but streaming formats such as m3u8. If you want to download your favorite videos, special handling is needed. This article provides a detailed example of how to download m3u8 streaming data using Python and embed it into an AMP webpage for playback. Let’s dive into the full process.</description>
    </item>
    <item>
      <title>Drawing Raincloud Plots with Python</title>
      <link>https://www.bobobk.com/en/791.html</link>
      <pubDate>Tue, 11 Jan 2022 15:56:31 +0800</pubDate>
      <guid>https://www.bobobk.com/en/791.html</guid>
      <description>When performing exploratory analysis, bar charts and box plots are excellent methods that can effectively display the general data structure and distribution. Recently, I saw someone using raincloud plots to display data, and the graphics looked beautiful and interesting. Therefore, I have organized this information and implemented the drawing of raincloud plots using Python.</description>
    </item>
    <item>
      <title>Introduction to Canonical Correlation Analysis and Python Implementation</title>
      <link>https://www.bobobk.com/en/581.html</link>
      <pubDate>Wed, 29 Dec 2021 14:01:33 +0800</pubDate>
      <guid>https://www.bobobk.com/en/581.html</guid>
      <description>When handling high-dimensional data, we can use LDA, PCA, etc., for dimensionality reduction. But what if two datasets come from the same samples but differ in data types and scales? This is where Canonical Correlation Analysis (CCA) becomes useful.</description>
    </item>
    <item>
      <title>The c-index and Its Application in Survival Analysis</title>
      <link>https://www.bobobk.com/en/592.html</link>
      <pubDate>Thu, 23 Dec 2021 17:06:46 +0800</pubDate>
      <guid>https://www.bobobk.com/en/592.html</guid>
      <description>The concordance index (c-index) is a metric used to evaluate the performance of predictive models, particularly in survival analysis. It is defined as the proportion of concordant pairs at all time points.</description>
    </item>
    <item>
      <title>Python Native Lists vs. NumPy Arrays</title>
      <link>https://www.bobobk.com/en/321.html</link>
      <pubDate>Wed, 22 Dec 2021 09:49:00 +0800</pubDate>
      <guid>https://www.bobobk.com/en/321.html</guid>
      <description>In Python, you can choose from various native data types to store collection data, including list, array, tuple, and dictionary. Among these, the list is highly flexible, can store any content, and is mutable, making it widely applicable. However, for scientific computing and storing purely numerical data, NumPy is widely used and has practically replaced lists. So, what are the differences between them, how significant are these differences, and how should they be applied in practice?</description>
    </item>
    <item>
      <title>Hands-on Implementation of Random Forest Algorithm with Python</title>
      <link>https://www.bobobk.com/en/621.html</link>
      <pubDate>Mon, 28 Dec 2020 14:04:47 +0800</pubDate>
      <guid>https://www.bobobk.com/en/621.html</guid>
      <description>This article will guide you through a hands-on implementation of a powerful random forest machine learning model. It aims to complement my conceptual explanation of random forests, but as long as you have a basic understanding of decision trees and random forests, you can fully read it. Later, we will discuss how to improve the model built here.</description>
    </item>
    <item>
      <title>python3 solution to LeeCode medium problem</title>
      <link>https://www.bobobk.com/en/671.html</link>
      <pubDate>Wed, 29 Jul 2020 09:54:36 +0800</pubDate>
      <guid>https://www.bobobk.com/en/671.html</guid>
      <description>This is an article analyzing a problem from the coding practice site LeeCode.</description>
    </item>
    <item>
      <title>Calculating the Gini Coefficient and Plotting the Lorenz Curve with matplotlib</title>
      <link>https://www.bobobk.com/en/521.html</link>
      <pubDate>Sun, 31 May 2020 19:22:50 +0800</pubDate>
      <guid>https://www.bobobk.com/en/521.html</guid>
      <description>The Gini coefficient and Lorenz curve are widely used to represent data inequality, especially wealth inequality. However, currently in Python, there isn&amp;rsquo;t a very good function to directly plot the Lorenz curve. Since the current project requires it, this article records how to use numpy, pandas, matplotlib, and other packages to calculate the Gini coefficient and plot the Lorenz curve for practical use.</description>
    </item>
    <item>
      <title>Using folium to Draw a COVID-19 Pandemic Map</title>
      <link>https://www.bobobk.com/en/624.html</link>
      <pubDate>Sun, 03 May 2020 08:28:47 +0800</pubDate>
      <guid>https://www.bobobk.com/en/624.html</guid>
      <description>After being contained in China, the COVID-19 pandemic became increasingly severe worldwide. Countries and regions publish daily new infection and death data to help fight the pandemic globally.</description>
    </item>
    <item>
      <title>Application of Python Implementation of Gradient Descent in Practice</title>
      <link>https://www.bobobk.com/en/648.html</link>
      <pubDate>Wed, 08 Jan 2020 14:04:06 +0800</pubDate>
      <guid>https://www.bobobk.com/en/648.html</guid>
      <description>Gradient descent is a first-order optimization algorithm, commonly called the steepest descent method. To find a local minimum of a function using gradient descent, one must iteratively move from the current point in the opposite direction of the gradient (or approximate gradient) by a specified step size.</description>
    </item>
    <item>
      <title>Statistical Skew Distributions Reveal Statistical Traps in Life</title>
      <link>https://www.bobobk.com/en/638.html</link>
      <pubDate>Fri, 27 Dec 2019 16:06:04 +0800</pubDate>
      <guid>https://www.bobobk.com/en/638.html</guid>
      <description>90% of drivers believe their driving skills are above average, 90% think their IQ is above the average IQ of the population, and the key is this can actually be consistent with real data — it&amp;rsquo;s true and not fabricated.</description>
    </item>
    <item>
      <title>Decoding Real Addresses from Xunlei Thunder Download Links</title>
      <link>https://www.bobobk.com/en/299.html</link>
      <pubDate>Fri, 17 May 2019 14:30:26 +0000</pubDate>
      <guid>https://www.bobobk.com/en/299.html</guid>
      <description>Students who frequently download videos and games often encounter Xunlei download links starting with &amp;rsquo;thunder://&amp;rsquo;, but are often unable to download due to copyright issues. Here, we will explain the conversion between regular download URLs and Xunlei download links.</description>
    </item>
    <item>
      <title>Longest Palindromic Substring Algorithm - Manacher</title>
      <link>https://www.bobobk.com/en/291.html</link>
      <pubDate>Thu, 28 Mar 2019 07:17:29 +0000</pubDate>
      <guid>https://www.bobobk.com/en/291.html</guid>
      <description>While solving LeetCode problems, I encountered a question about finding the longest palindromic substring.</description>
    </item>
    <item>
      <title>Finding Common Values in Two Python Lists</title>
      <link>https://www.bobobk.com/en/289.html</link>
      <pubDate>Fri, 08 Mar 2019 08:23:32 +0000</pubDate>
      <guid>https://www.bobobk.com/en/289.html</guid>
      <description>In daily life, we often encounter the need to find common values between two arrays. This article provides several simple and practical methods on how to elegantly get common values between two arrays in Python.</description>
    </item>
    <item>
      <title>Detailed Examples of Seaborn Plotting Kernel Density Curves</title>
      <link>https://www.bobobk.com/en/263.html</link>
      <pubDate>Sun, 20 Jan 2019 11:41:58 +0000</pubDate>
      <guid>https://www.bobobk.com/en/263.html</guid>
      <description>&lt;p&gt;In a frequency distribution histogram, when the sample size is sufficiently enlarged to its limit, and the bin width is infinitely shortened, the step-like broken line in the frequency histogram will evolve into a smooth curve. This curve is called the density distribution curve of the population.&lt;/p&gt;&#xA;&lt;p&gt;In this article, Chunjing Muke will detail how to use the Python plotting library Seaborn and the Iris flower dataset from Pandas to plot various cool density curves.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;1-basic-density-curve&#34;&gt;1. Basic Density Curve&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; seaborn &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; sns&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sns&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;set(color_codes&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;True&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sns&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;set_style(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;white&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    df &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; pd&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;read_csv(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;iris.csv&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sns&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;kdeplot(df[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;sepal_width&amp;#39;&lt;/span&gt;])&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://www.bobobk.com/wp-content/uploads/2019/01/basic_kdeplot.webp&#34; alt=&#34;‘Detailed Examples of Seaborn Plotting Kernel Density Curves’&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;To plot a kernel density curve using Seaborn, you only need to use &lt;code&gt;kdeplot&lt;/code&gt;. Note that a density curve only requires one variable; here we choose the &lt;code&gt;sepal_width&lt;/code&gt; column.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;2-density-curve-with-shading&#34;&gt;2. Density Curve with Shading&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; seaborn &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; sns&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sns&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;set(color_codes&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;True&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sns&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;set_style(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;white&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    df &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; pd&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;read_csv(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;iris.csv&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sns&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;kdeplot(df[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;sepal_width&amp;#39;&lt;/span&gt;],shade&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;True&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://www.bobobk.com/wp-content/uploads/2019/01/shadow_kdeplot.webp&#34; alt=&#34;‘Detailed Examples of Seaborn Plotting Kernel Density Curves’&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Implementation for Kugou Music MP3 Download</title>
      <link>https://www.bobobk.com/en/234.html</link>
      <pubDate>Sun, 13 Jan 2019 14:45:59 +0000</pubDate>
      <guid>https://www.bobobk.com/en/234.html</guid>
      <description>&lt;p&gt;After implementing &lt;a href=&#34;https://www.bobobk.com/216.html&#34;&gt;python for Qianqian Music mp3 download&lt;/a&gt;, some users found that many songs couldn&amp;rsquo;t be searched on Qianqian Music. So today, Chunjian Muke extended the download functionality to Kugou Music, with source code provided.&lt;/p&gt;&#xA;&lt;p&gt;Using the same approach, first search for a song directly on the Kugou official website. Then, open the network monitor in Google Chrome and search for the same keyword again. You&amp;rsquo;ll then be able to find the API information (Note: It&amp;rsquo;s best to view the network requests during the second search to filter out unnecessary information).&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;1-analyzing-search-api-information&#34;&gt;1. Analyzing Search API Information&lt;/h2&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://www.bobobk.com/wp-content/uploads/2019/01/kugou_search.webp&#34; alt=&#34;《Python Implementation for Kugou Music MP3 Download》&#34;&gt;&#xA;With only 4 network requests, it&amp;rsquo;s easy to identify that the first request genuinely returns song information, so we can construct this request.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://www.bobobk.com/wp-content/uploads/2019/01/kugou_search_response.webp&#34; alt=&#34;《Python Implementation for Kugou Music MP3 Download》&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>The difference between shadowcopy and deepcopy in python</title>
      <link>https://www.bobobk.com/en/200.html</link>
      <pubDate>Sat, 29 Dec 2018 02:22:22 +0000</pubDate>
      <guid>https://www.bobobk.com/en/200.html</guid>
      <description>&lt;p&gt;In python, it is common to need to copy specific objects, and you might encounter various bugs because understanding the difference between these three operations is key: assignment, shallow copy, and deep copy.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://www.bobobk.com/wp-content/uploads/2018/12/ctr_v.webp&#34; alt=&#34;“The difference between shadowcopy and deepcopy in python”&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Assignment (=), shallow copy (copy), and deep copy (deepcopy) are relatively easy to distinguish regarding assignment vs. copying, but shallow copy and deep copy are harder to differentiate.&lt;/p&gt;&#xA;&lt;p&gt;The assignment statement does not copy the object; it simply binds the variable to the object. Any change to one object will affect the other. Copying allows you to change one object without affecting the other.&lt;/p&gt;&#xA;&lt;p&gt;The difference between shallow and deep copy is that shallow copy does not affect the other object when values change, but adding or deleting elements can affect it. Deep copy creates a completely independent object, and changes to one will not affect the other.&lt;/p&gt;</description>
    </item>
    <item>
      <title>python3 requests module usage examples</title>
      <link>https://www.bobobk.com/en/198.html</link>
      <pubDate>Fri, 28 Dec 2018 04:57:52 +0000</pubDate>
      <guid>https://www.bobobk.com/en/198.html</guid>
      <description>The network module in python3 is much more convenient compared to python2. The requests package combines several python2 packages. This article explains the usage of requests with examples, serving as a review and future reference.</description>
    </item>
    <item>
      <title>Python Random Strong Password Generator</title>
      <link>https://www.bobobk.com/en/136.html</link>
      <pubDate>Tue, 18 Dec 2018 01:23:13 +0000</pubDate>
      <guid>https://www.bobobk.com/en/136.html</guid>
      <description>Due to security needs, it is recommended that users use different strong passwords on different websites. Setting a strong password every time can be troublesome, so here we write a small Python program to generate strong passwords. In the future, just visit the following website and copy-paste the password.</description>
    </item>
    <item>
      <title>Kaggle Local Dog Breed Recognition</title>
      <link>https://www.bobobk.com/en/127.html</link>
      <pubDate>Sat, 15 Dec 2018 10:36:29 +0000</pubDate>
      <guid>https://www.bobobk.com/en/127.html</guid>
      <description>After setting up the deep learning environment, the first thing is to try if it works. The simplest way is to use a pretrained model to predict new samples.</description>
    </item>
    <item>
      <title>Introduction to Artificial Neural Networks</title>
      <link>https://www.bobobk.com/en/90.html</link>
      <pubDate>Mon, 10 Dec 2018 05:27:33 +0000</pubDate>
      <guid>https://www.bobobk.com/en/90.html</guid>
      <description>Artificial Neural Network (ANN), also called Neural Network (NN) or neural-like network, is a mathematical model that mimics the structure and function of biological neural networks. It consists of a large number of neurons connected for computation. In most cases, artificial neural networks can change their internal structure based on external information, making them adaptive systems, simply put, they have learning capabilities.</description>
    </item>
    <item>
      <title>Drawing the Butterfly Curve with Python</title>
      <link>https://www.bobobk.com/en/24.html</link>
      <pubDate>Wed, 07 Nov 2018 08:03:32 +0000</pubDate>
      <guid>https://www.bobobk.com/en/24.html</guid>
      <description>&lt;p&gt;The butterfly curve, discovered by Temple H. Fay, is a beautiful curve that can be expressed using a polar coordinate function. Because of its elegance, I wanted to use it as my blog&amp;rsquo;s favicon.ico. Here, I&amp;rsquo;ll use Python&amp;rsquo;s &lt;strong&gt;matplotlib.pyplot&lt;/strong&gt; package to draw the desired butterfly curve. First, let&amp;rsquo;s admire the beautiful butterfly curve.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://www.bobobk.com/wp-content/uploads/2018/11/butter.webp&#34; alt=&#34;butter&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-first-we-need-to-define-the-mathematical-expression-of-the-butterfly-curve&#34;&gt;1. First, We Need to Define the Mathematical Expression of the Butterfly Curve&lt;/h2&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://wikimedia.org/api/rest_v1/media/math/render/svg/92e1ec07900777c282b5c379b0877906f4594727&#34; alt=&#34;math&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://wikimedia.org/api/rest_v1/media/math/render/svg/3c9b54f7112ec2abd4125ef9b52aa55a9b8470ea&#34; alt=&#34;math2&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;It can also be expressed using spherical coordinates:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://wikimedia.org/api/rest_v1/media/math/render/svg/5b9bff8d319e4fd55de4eb7685d9aa06b40fcfa9&#34; alt=&#34;math3&#34;&gt;&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;2-choosing-matplotlibpyplot-as-the-plotting-tool-in-python&#34;&gt;2. Choosing &lt;code&gt;matplotlib.pyplot&lt;/code&gt; as the Plotting Tool in Python&lt;/h2&gt;&#xA;&lt;h3 id=&#34;1-first-import-the-necessary-python-packages&#34;&gt;1. First, import the necessary Python packages&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; numpy &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; np&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; matplotlib.pyplot &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; plt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;2-set-the-parameter-values&#34;&gt;2. Set the parameter values&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;t &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;arange(&lt;span style=&#34;color:#ae81ff&#34;&gt;0.0&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;12&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;pi, &lt;span style=&#34;color:#ae81ff&#34;&gt;0.01&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;x &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;sin(t)&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;(np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;e&lt;span style=&#34;color:#f92672&#34;&gt;**&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;cos(t) &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;cos(&lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;t)&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;sin(t&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;12&lt;/span&gt;)&lt;span style=&#34;color:#f92672&#34;&gt;**&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;y &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;cos(t)&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;(np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;e&lt;span style=&#34;color:#f92672&#34;&gt;**&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;cos(t) &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;cos(&lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;t)&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;sin(t&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;12&lt;/span&gt;)&lt;span style=&#34;color:#f92672&#34;&gt;**&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;3-according-to-the-formula-use-numpy-functions-with-plt-to-draw-the-required-image&#34;&gt;3. According to the formula, use &lt;code&gt;numpy&lt;/code&gt; functions with &lt;code&gt;plt&lt;/code&gt; to draw the required image&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;plt&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;figure(figsize&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;(&lt;span style=&#34;color:#ae81ff&#34;&gt;8&lt;/span&gt;,&lt;span style=&#34;color:#ae81ff&#34;&gt;6&lt;/span&gt;))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;plt&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;axis(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;off&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;plt&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;plot(x,y,color&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;blue&amp;#39;&lt;/span&gt;,linewidth &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;2&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#plt.show()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;plt&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;savefig(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;butter.jpg&amp;#34;&lt;/span&gt;,dpi&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;400&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://www.bobobk.com/wp-content/uploads/2018/12/image-1.webp&#34; alt=&#34;butter_fly&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;4-use-pillow-to-resize-the-image-to-an-appropriate-size-for-a-favicon&#34;&gt;4. Use &lt;code&gt;Pillow&lt;/code&gt; to resize the image to an appropriate size for a favicon&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; PIL &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; Image&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;im &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; Image&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;open(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;butter.jpg&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;favicon &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; im&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;resize((&lt;span style=&#34;color:#ae81ff&#34;&gt;50&lt;/span&gt;,&lt;span style=&#34;color:#ae81ff&#34;&gt;50&lt;/span&gt;))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;favicon&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;save(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;favicon.ico&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://www.bobobk.com/wp-content/uploads/2018/12/image.webp&#34; alt=&#34;image_ico&#34;&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
