Installation tutorial : The most detailed Python Installation tutorial
python There are three ways to install packages :1. stay cmd of use pip install install ;2. stay pycharm Install in ;3. Download the corresponding package from the official website and install it manually .
Specific courses : There are three ways to tell you Python How to install third party libraries
Before talking about reading and writing, go through the common data types .
list [] : You can add, delete and modify ;
Tuples (): Cannot change element , Generally important content can be represented by tuples ;
Dictionaries {}: Yes key and value, Very often ;
aggregate {}: Elements cannot be repeated .
import json
info={
'uid':1,'itemid':1,'category_id':["2","1","3"],'Behavior_type':"click",'time':"2021-09-21"}
with open("a.json","w")as f:
f.write(json.dumps(info,ensure_ascii=False,indent=4,separators=(',',':')))
json.dumps() Parameters in function :
ensure_ascii = True : Default output ascii code , If you want to display Chinese , Set it to False;
indent = 4 : Indent four spaces
separators(’,’, ‘:’) : Represents a separator , The former ’,‘ take dict Each item of the is separated , the latter ’:' take dict Of key and value Separate .
Other functions that appear in pairs :
2. pd.DataFrame()
Is a binary label data structure composed of multiple types of columns , Often includes index( Row labels )、columns( Column labels ). It can be understood as :DataFrame Is a two-dimensional array with labels .
pd.DataFrame.fillna():
DataFrame.fillna(value=None, method=None, axis=None, inplace=False, limit=None, downcast=None, **kwargs)
Reference material :
A database is a collection of stored data , After connecting to the database , Add, delete, modify and query data through corresponding interactive commands .MySQL It's a relational database , It is often used in the data analysis department of the company .
Installation tutorial : Hyperdetail MySQL8.0 The download 、 Installation and configuration tutorial
MySQL Workbench Interface is introduced :
Edit bar 、 Shortcut bar , stay Workbench Can operate like excel Click the button as before , You can also interact with commands .
course :MySQL Report errors :Could not acquire management access for administration