Problem Description
Just ask a question in the dormitory, simply said that the programming encountered the following situation:
Class Node (object):
def __init__ (self, childrenlist=[], name = '. '):
self.name = name
Python 2.7IDE Pycharm 5.0.3
Data analysis Hot body ah, anyway, also see natural language processing this piece.
Speaking at the beginning
The relevant knowledge to be used in this article includes data cleansing, regular expressions, dictionaries,
Example Description: Reading data from a file, drawing a scatter chart
#coding: Utf-8
import matplotlib.pyplot as Plt
import numpy as NP
import matplotlib as MPL
mpl.rcparams[ ' font.family '] = ' sans-serif '
mpl.rcparams[' font.sans-serif '] = '
Note: Read the data from the file, draw a line diagram
#coding: Utf-8
import matplotlib.pyplot as Plt
import matplotlib as MPL
import NumPy as NP
from Matplotlib.font_manager Import fontproperties
import matplotlib as Mpl
mpl.rcparams['
This article directly gives the last time about the Kmeans cluster basketball far mobilization data analysis case, at the same time introduced this homework students completed the legend, and finally introduced the Matplotlib package drawing
the guys that uses pycharm knows to find the shortcut key: Ctrl+f, do you know the replacement?
Check for a long time, there is no replacement shortcut keys, accidentally found unexpectedly is, ctr+r
Personally found to be particularly useful:
the basic framework of machine learning:
Model, target (cost function), optimization algorithm
STEP1: For a problem, we need to first establish a model, such as regression or classification model;
Step2: The cost function of the model is established
Python version http Server
Python-m Simplehttpserver 80
Http://localhost:80
Python does not have a direct FTP server built into it, so it requires Third-party component support, and I found this component called Pyftpdlib
Pip Install Pyftpdlib
UUID
(i) Introduction
The UUID is a 128-bit globally unique identifier, typically represented by a 32-byte string (hexadecimal). He can indicate the uniqueness of time and space, also known as GUIDs. (b) five major algorithms 1, uuid1 ()
is a
Anaconda is a good Python integrated development environment, you can also use Conda or pip to install PYTHON-OPENCV directly, but this installation method after the installation of OPENCV missing video packets, such as the following read video
implements the int sqrt (int x) function.
Calculates and returns the square root of X, where x is a nonnegative integer.
Because the return type is an integer, the result retains only the part of the integer, and the decimal part is given
See GitHub https://github.com/double12gzh/PythonLearning/blob/master/setup_env_in_script.py for details
#!/usr/bin/python #################################################################### # Author:jeffrey Guan # Date
: 2016-10-24 #
1. How to view all of the Python bytecode lists:
Execute this code to see a list of bytecode:
Import opcode
for op in range (Len (opcode.opname)):
print (' 0x%.2x (%.3d):%s '% (OP, op, Opcode.opname[op])
Since it is called
Automated tests that have been done with the UI know that testing is an action on an element, so it is particularly dependent on the positioning of the element. But this poses a big problem-"maintenance cost", if you are positioned multiple times
One. PropertiesThe so-called attribute is to disguise a method in a class as a property. At the level of the code there is no intrinsic elevation. But make the code look better.classPerson :def __init__(self,name,age): Self.name=nameifType (age)
There are many ways to concatenate strings in Python, here is a simple summary, it should be more comprehensive, convenient for later review.Plus connectionThe first, by the form of the + sign:>>> A, b = ' hello ', ' world '>>> A + b' Hello World
Generalized encapsulation: Instantiates an object and encapsulates some properties for the object space. Narrowly encapsulated: Private Private members: Privately owned static fields, private methods, private object properties for private static
The previous article mentioned in the Python code to always do error, is not the problem of their own code, the original is win10 problem, Windows engaged in development really need a lot of patience, interested can refer to this to deal with:
Manipulation of stringsThe Capitaliza () Str.capitaliza () method returns a string with the first letter capitalized and the other lowercase lettersCount () Str.count (Sub,start=0,end=len (str)) method counts the number of occurrences of a substring
------------------------------Thread---------------------------#线程应用的第一种方式: The thread module is the lower-level module#import Thread: Referenced module#thread. Start_new_thread (Defname, ()): Thread creation#thread. Exit_thread (): End of Thread
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service