Data analysis learning notes (6) -- random walk
This example completes simple mathematical statistics work by simulating some random numbers as an experience of later data analysis
Random walk: randomly generate 1 or - 1 random number to imitate a person's advance or retreat
In this environment, some statistical work is carried out
Random walk
Do some preparations for the home ...
Posted by canabatz on Thu, 02 Apr 2020 07:17:50 -0700
Python+Selenium notes (12): data driven testing
(1) Foreword
Through the use of data-driven testing, the input value and expected results can be parameterized. (for example: input data and expected results can directly read the data of Excel document)
(2) ddt
The ddt library can parameterize the variables in the test. When using ddt, use @ ddt decorator on the test class and @ data decorator ...
Posted by viko20 on Tue, 31 Mar 2020 17:41:15 -0700
Python web crawler notes (3): Download blog garden essay to Word document
(1) Description
Based on the previous one, we use lxml to extract the body content of blog garden essay and save it in Word document.
The following modules are used to operate Word documents:
pip install python-docx
Modified code (mainly added the following paragraph in the while loop of link_crawler())
1 tree = lxml.html.fromstring(h ...
Posted by phpDVWeaver on Tue, 31 Mar 2020 01:56:38 -0700
Put a mask on your goddess in Python ~
Preface
The new pneumonia epidemic that began to spread at the end of 2019 has affected people's hearts. As an individual, what we can do is to stay at home as little as possible.
Seeing that some friends ask design students to help them put on masks for their heads, as technicians, I think there must be more people with such demands. It's bett ...
Posted by AbiusX on Mon, 23 Mar 2020 01:56:23 -0700
Thread & coordination & asynchrony of crawler
Thread pool
from multiprocessing.dummy import Pool
The callback function asynchronously performs some operation on the elements in the iteratable object
Note: callback must have one parameter and only one parameter
Asynchronous is mainly used in time-consuming operations
from multiprocessing.dummy import Pool
pool = Pool(3) # Instantiat ...
Posted by Mirkules on Fri, 20 Mar 2020 10:32:57 -0700
Asynchronous crawlers are too troublesome to write?Try Trio!
Personal Blog Visit http://www.x0100.top
Trio, translated as Trio, provides easier asynchronous programming and is a more advanced encapsulation of asyncio.
It attempts to simplify complex asyncio modules.Simpler to use than asyncio and Twisted, but equally powerful.The project is still young and ...
Posted by MattMan on Mon, 09 Mar 2020 19:12:11 -0700
[artificial intelligence notes] section 9: compiling python OpenCV 4.2.0 under Windows, SIFT feature extraction, and perspective transformation to correct object direction
Compile and install OpenCV
0-1. Uninstall opencv and opencv_contrib installed by pip or conda before installation:
pip uninstall opencv-contrib-python
pip uninstall opencv-python
0-2.install NumPY in Python environment first
pip install numpy
1. Download OpenCV source code: https://github.com/o ...
Posted by baitubai on Fri, 06 Mar 2020 21:34:14 -0800
Django+Nginx+UWSGI deployment project
For projects written locally, the running results can only be viewed by ourselves and cannot be used by others.
If you want to go online, you can deploy the project on the cloud server through Django+Nginx+UWSGI. At this time, other users only need to enter the URL address to use the project.
Pre depl ...
Posted by pinxxx on Fri, 06 Mar 2020 01:05:24 -0800
"Python drawing sharp tool": Matplotlib tutorial
Article directory
1. Preface
2. Introduction to Matplotlib
3. installation
4. Drawing basis
4.1 plot() function
4.1.1 Chinese display
4.1.2 text display
5. Drawing of common charts
5.1 histogram
5.1.1 simple example
5.1.2 function definition
5.1.3 histogram of normal distribution
5.2 pie chart ...
Posted by BLaZuRE on Thu, 05 Mar 2020 19:40:13 -0800
Detailed tutorial of python nss module
I usually like making python modules. Recently, I made a module "nss" (which is used for database) and I uploaded it to pypi.
... First, you can download this module with 'pip install nss'. Because the size of the module itself is relatively small and the download is relatively fast, it can be ...
Posted by ckdoublenecks on Fri, 28 Feb 2020 03:47:14 -0800