[introduction to Linux] basic IO

✔ Review the interface of C file When learning C language, we learned some interfaces of C language for file operation. There are fopen, fclose, fputc, fgetc, fputs, fgets, fprintf, fscanf, fread, fwrite, etc Briefly review with a piece of code: #include<stdio.h> #include<string.h> int main() { FILE* fp=fope ...

Posted by utdfederation on Tue, 16 Nov 2021 17:48:11 -0800

Python functions, variable scopes, parameters

brief introduction In programming, we often need to perform the same or similar operations. These operations are completed by a piece of code, and the emergence of functions can help us avoid writing this piece of code repeatedly. The function is to abstract a relatively independent function and make it an independent entity. One reason why Py ...

Posted by ghostdog74 on Tue, 16 Nov 2021 07:14:45 -0800

How to use MSE and R square to evaluate the linear regression model?

How to check the mean square error to judge whether the prediction result is correct? (case: linear regression, random forest California house price data set) Why use the mean square error? Can't the previous accuracy? Because the results of regression model are continuous variables, it is impossible to judge directly by right or wrong. Howev ...

Posted by voitek on Tue, 16 Nov 2021 06:41:09 -0800

Python makes mosaic images

Python makes mosaic images 200 lines of Python code complete the script for generating mosaic pictures Knowledge points What is RGBHSV color spacePython BasicsIncluding the use of the pilot libraryUse of multiprocessing LibraryPrinciple of making mosaic image effect: You can generate pictures similar to the following: After zooming ...

Posted by mattonline on Mon, 15 Nov 2021 23:58:41 -0800

python data type

This paper summarizes the basic data types in python language, including (int,bool,str,list,tuple,set,dict,none,float) data type methods (unique functions, public functions). Although the content is numerous and cumbersome, you only need to remember the common knowledge points. (article 2W words, according to the directory index) Structure: & ...

Posted by Zallus on Fri, 12 Nov 2021 16:38:44 -0800

Function and object oriented of python

1 function 1.1 function basis definition def Function name(): Code 1 Code 2 ... call Function name ()Documentation for functions def Function name(): """ Function description document """ View the documentation for the function help(Function name) 1.2 scope of variable local variable The so-called local ...

Posted by OOP on Fri, 12 Nov 2021 14:23:33 -0800

Beginner programming, ideas are clear, but can't write the code?

The initial contact programming can be directly used. Instead of the large piles of books on the front floors, they may not be able to help you write code. If you don't say, they may directly persuade you to retreat. First, look at the problem. It shows that you have ideas and can figure out all the problems. Then there is a very simple method ...

Posted by oceans on Fri, 12 Nov 2021 13:56:07 -0800

Custom attribute access and dynamic attribute setting of Python classes

This article mainly introduces the methods of accessing some custom attributes of python classes and the dynamic attribute setting of classes, that is, python's built-in function setattr(). Custom attribute access What are attributes? Are the following examples a and b attributes? No, they are global variables. An attribute is a member variab ...

Posted by alba on Fri, 12 Nov 2021 13:14:04 -0800

Python series logging topics

Python topic series (1) pathlib topic Python topic series (2) csv topic Python topic series (3) logging topic 1 logging log level levelNumber of levelsUse occasionDEBUG10Details, common language debuggingINFO20Some information generated during the normal operation of the programWARNING20Warn the user that although the program is still worki ...

Posted by bschultz on Fri, 12 Nov 2021 12:09:21 -0800

Python basic syntax (10) dictionary of basic types

Basic Python syntax (1) introduction to Python Python basic grammar (2) Zen of Python Python basic syntax (3) use of miniconda Python basic syntax (4) install Python language based on CentOS7 source code Python basic syntax (5) numbers of basic types Python basic syntax (6) string of basic types Python basic syntax (7) list of basic types ...

Posted by dcgamers on Fri, 12 Nov 2021 11:32:34 -0800