Relational network chart visualization _Python data preprocessing

... This chapter: Pre-process watercress movie data with Python, and use Gephi to do relational network chart visualization. Python Data Preprocessing Organize the relationship between the director and the actor in the data, get the relationship data between the director and the actor, and...


Pyinstaller package error

... pyinstaller package error for real_module_name, six_moduleAttributeError: 'str' object has no attribute 'items' 2018年1717 17:52:38 Little guard of Sakura Castle Reads: 981 More at https://github.com/pyinstaller/pyinstaller/issues/3507 ie there is a lot of methods for solving problems in...


Application of dict.get() method: How to calculate the number of occurrences of each character in a string

... implementation is a specific way to perform some calculation implementation code 1: def Histogram(s): d = dict() # first define a dictionary d, the effect is equivalent to d = {} For c in s: # loop characters in the entire string If c not in d: # The first occurrence of the character...


Django creates a project with a virtual environment

... Why need a virtual environment to the current location, all our third-party package installation is directly installed by pip install xx The installation will install that package into your system-level Python environment. But there is a problem, if you write a website with Django 1.10...


The python program is packaged into an exe executable file

... 1. Install the pyinstaller module: 2. Verify the successful installation of pyinstaler, this step is just for psychological comfort: 3. Package your own python file into exe : Enter the command: pyinstaller -F **\**\**.py, as shown in the yellow image, and the content after -F is the...


Python socket transfer demo

... socket transfer, client code import socket Def main(): Tcp_client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #Server is located in this machine 9999 Tcp_client_socket.connect( ("192.168.27.72", 9999) ) # Tell the server which file I want to download File_name = input(...


The difference between shallow copy and deep copy

... 一, shallow copy: create a new object, but it contains a reference to the items contained in the original object (if one of the objects is modified by reference, the other one will also Modify changes) {1, full slicing method; 2, factory functions, such as list(); 3, copy module's copy()...


HttpRunner installation (unfinished)

... Purpose: Do interface automation test Precondition: Python3.7 Specific installation steps: 1.pip install httprunner Need to first check if pip is installed, if installed Is python3.4 version or above, you do not need to re-install; otherwise you only need to check whether you have the...


Multi-process and multi-threading in Python (2) Multi-process and multi-threading in

... Python (2) Python Multi-process 一, background understanding Unix/Linux operation The system provides a fork() system call, which is special. Ordinary function call, call once, return once; but fork () call once, return twice, this is because the operating system automatically copies the...


Python error message + solution collection

... import random outcomes = {'heads':0, 'tails':0} sides = outcomes.keys() print(sides[0]) will generate an error: TypeError: 'dict_keys' object does not support indexing This is because python3 changed dict.keys, returned dict_keys object, supports iterable but does not support Indexable,...