Python foundation and MySQL Foundation

cc_ mlearning 2021-11-25 08:44:32
python foundation mysql foundation

1. Answering question

1.1. python Installation

Installation tutorial : The most detailed Python Installation tutorial

1.2. python How to install the package

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

2. python Reading and writing data in

Before talking about reading and writing, go through the common data types .

2.1 Several 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 .

2.2 Data reading and writing

  1. json.load() and json.dumps()
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 :
json library
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)

 Insert picture description here
Reference material :

  1. establish pd.DataFrame Methods . pd.DataFrame Function details
  2. Pandas DataFrame The basic properties of

3. MySQL

3.1 Introduce MySQL

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 .

3.2 MySQL install

Installation tutorial : Hyperdetail MySQL8.0 The download 、 Installation and configuration tutorial
MySQL Workbench Interface is introduced :
 Insert picture description here
Edit bar 、 Shortcut bar , stay Workbench Can operate like excel Click the button as before , You can also interact with commands .

3.3 MySQL Basic operation

3.3.1 What should I do if I can't connect to the database ?

course :MySQL Report errors :Could not acquire management access for administration

3.3.2 Basic operation

  1. establish (create) A database / surface 、 Using a database (use)
  2. increase (insert into)、 Delete (delete, drop)、 Change (update)、 check (select)、 according to requirements (where).
  3. Complex examples : Pass data tables through key Connect , That is, relational .
    Reference material :mysql constraint ( key constraints )
版权声明
本文为[cc_ mlearning]所创,转载请带上原文链接,感谢
https://pythonmana.com/2021/11/20211109004844343o.html

  1. Python common operators
  2. Python data type
  3. get和post接口的封装(python)
  4. Python variables and memory
  5. Encapsulation des interfaces get et post (Python)
  6. Écrivez un programme Python pour convertir les décimales en décimales binaires. Notez que le paramètre longueur est utilisé pour spécifier le nombre de bits convertis
  7. Switching Python version through terminal under MacOS
  8. Créer un tableau de visualisation des données de vente en python pour démontrer que l'analyse est en place
  9. Python crawling chain home network listing information
  10. Pandas learning experience
  11. Visualisation des données Python: visualisation du plug - in D - Tale pour l'analyse des données
  12. [test and development practice] Alfred + Python + Charles quickly debug the HTTP interface
  13. [tiktok] adb+python automatically brush fast / Kwai and video to earn gold coins.
  14. [efficiency tool] Based on Python crawler's "NBA match information and data statistics view" Alfred gadget
  15. [efficiency tool] the MAC side's JSON string re parsing tool based on Alfred and python perfectly parses JSON strings
  16. Hello python world
  17. Exception handling mechanism for getting started with Python
  18. Advanced Python: outer functions, inner functions, and closures
  19. The difference between single quotation marks, double quotation marks, three single quotation marks and three double quotation marks in Python
  20. Python operation database class: realize the functions of creating tables, inserting data and querying data
  21. Introduction to Python 3 crawler and regular expression
  22. Python exercise (11.7)
  23. python11~20
  24. Matlab, python example exercise -- Day2
  25. Matlab, python example exercise -- Day1
  26. White Python road -- Day5
  27. Python正则表达式选择字符
  28. The white way of Python -- day4 (I can't learn it gradually)
  29. The white way of Python -- Day3
  30. The white Python road -- Day2
  31. The white way of Python -- Day1
  32. Difference between input in python2 and python3
  33. Exception handling in Python
  34. Metaclass and singleton pattern of Python
  35. Python methods and functions
  36. Python regular expression select Characters
  37. Introduction to Python object-oriented reflection and built-in methods
  38. Object oriented composition of Python
  39. Python object oriented polymorphism
  40. Object oriented encapsulation of Python
  41. Object oriented inheritance in Python
  42. Python Software Development Directory
  43. Python package
  44. Python module
  45. Python is process oriented and functional
  46. Python function recursion
  47. Python generator
  48. Python iterator
  49. Python decorator
  50. Python function closure
  51. Python namespace and scope
  52. Python function
  53. Python file processing
  54. Python data type
  55. Process control of Python
  56. Garbage collection mechanism of Python
  57. Python: the field notes of dtype = 'object' can also be arranged in ascending and descending order
  58. . value in pandas_ Usage of counts()
  59. 202111 | some hands-on practice of Python time function
  60. 202111 | in Python, timestamp, time string and real date time are converted to each other