First, the data type:
Definition: Tell python the type of data according to the format specified by Python;
Assignment: The process of defining good data and passing it to a variable;
Variables: Data assignment of the object, through the variable to manipulate the data;
Variable name naming rules:
1, a-z,a-z, numbers, underline, the first letter can not be numeric and underline;
2, case sensitive;
3. The variable name cannot be a reserved word in Python.
Several data types:
Logic type (logical), numeric (numeric), character (character)
Logic type: only 2 values (0, 1, true, false)
Numerical type: real number, arithmetic;
Character type: Note the use of the escape character "/":
#字符串str用单引号 (') or double quotation marks ("").
#使用反斜杠 (\) escapes special characters.
s = ' yes,he doesn\ ' t '
#如果你不想让反斜杠发生转义,
#可以在字符串前面添加一个r that represents the original string
Print (' C:\some\name ')
Print (' C:\\some\\name ')
Print (R ' C:\some\name ')
Results:
C:\some
ame; \ n, default line break;
C:\some\name
C:\some\name
Second, data structure
Data structure refers to the collection of one or more specific relationships with each other;
Python uses pandas packages to process data
Two common data results in pandas
Series (serial), Dataframe (data frame)
A series is a collection of data that is used to store a row or column, and an index associated with it;
Three, the operation of the vector
Vectorization is a special way of parallel computing, which can perform multiple operations at the same time, usually by executing the same commands on different data.
Numpy.arange (Start,end,step)
Generate a linear quantity (start value, end value, step size)
Import numpyr=numpy.arange (1, 5, 1print(r)
Results:
[1 2 3 4]
python--processing Data