Category:Python

  • Seven Python code review tools recommended

    Time:2021-10-22

    althoughPythonLanguage is one of the most flexible development languages at present, but developers often abuse its flexibility and even violate relevant standards. So PythoncodeThe following common quality problems often occur: Some unused modules have been imported Function is missing arguments in various calls The appropriate format indentation is missing Missing appropriate spaces before and after […]

  • Logistic regression in machine learning: computational probability

    Time:2021-10-22

    Many problems require probabilistic estimates as outputs. Logistic regression is an extremely efficient probabilistic computer system. In fact, you can use the return probability in one of two ways: “As is” Convert to binary category.Let’s learn how to use probability “as is”. Suppose we create a logistic regression model to predict the probability of dogs […]

  • 02select listening server

    Time:2021-10-22

    # can_ read, can_ write, _ = Select. Select (inputs, outputs, none, none) ## the first parameter is that we need to listen for a readable socket, the second parameter is that we need to listen for a writable socket, the third parameter is that we need to listen for an abnormal socket, and the […]

  • Python function to realize student management system

    Time:2021-10-22

    This example shares the specific code of Python function to realize the student management system for your reference. The specific contents are as follows This is a simple management program Enter name, age, gender (you can also add other categories, such as sexual orientation), and then save it as a list (empty list by default). […]

  • Implementation of format binary conversion and deletion of binary prefix in Python

    Time:2021-10-21

    10 decimal, hexadecimal, octal and binary conversion: (#: reserved hexadecimal prefix) For those with hexadecimal prefix, such as “0x” “0o” “0b”, you can directly add ‘x’ and ‘o’ ‘B’ to delete them: Other tips: format(num, “,”) Fast division of millennia How many digits are the numbers to complete, ^ center > right alignment < left […]

  • Classification of machine learning: specifying thresholds

    Time:2021-10-21

    Logistic regression returns probability. You can use the returned probability “as is” (for example, the probability of users clicking on this advertisement is 0.00023), or you can convert the returned probability into a binary value (for example, this email is spam).If a logistic regression model predicts an e-mail with a return probability of 0.9995, it […]

  • 02select listening client

    Time:2021-10-21

    #Coding: utf-8import socket # defines a message list. Messages = [‘this is the message’, ‘it will be sent’, ‘in parts’,]# defines a primitive to specify the server to be connected. server_ Address = (‘localhost ‘, 8090) # create atcp / IP socket # initialize two sockets # connect the socket to the port where the […]

  • Example code for pandas implementation by line selection

    Time:2021-10-21

    catalogue 1. User defined row index 2. Select data by common index 2.1 select single line data by common index 2.2 select multiple rows of data by row index 3. Select data by location index 3.2 select multiple rows of data by location index 4. Select continuous multiple lines of data 5. Select a line […]

  • Introduction to Python variable scope and list

    Time:2021-10-20

    Variable scope Variables are limited by scope Classification: by scope Global: defined outside the function Local: defined inside a function Scope of variable Global variable: valid in the whole global scope Global variables can be used locally (that is, variables defined outside the function can be accessed inside the function) Local variables can be used […]

  • How does latex output backslashes and single line comments

    Time:2021-10-20

    Single backslash Use “\ backslah” to represent “\”, as shown in the following figure: \backslash Double backslash “\ \” is represented by “\ backslash \ backslash”, as shown in the following figure: Single-Line Comments x+1=y\\ Latex blogging skills This work adoptsCC agreement, reprint must indicate the author and the link to this article Hacking

  • 03python network programming series server

    Time:2021-10-20

    #Here is a series of functions that define the server. It is the first example in Chapter 7 of Python Network programming# This is for the latter function to call, and then we will study network single thread programming, multi-threaded programming, asynchronous network programming, etc# Import the network programming socket, time, CMD parameter acquisition module […]

  • The meaning and usage of Python variance test

    Time:2021-10-20

    explain 1. Variance test is used to compare the samples of two or more variable data to determine whether the difference between them is simple and random or due to significant statistical differences between processes. 2. The independent variable x is a discrete data, and the independent variable y is a continuous data (x can […]