Someone asked on Zhihu: What knowledge do you need to learn to use Python for office automation?
This may be a confusion faced by many non-IT professionals. They want to use Python at work, but don’t know how to start? Python is becoming more and more popular in the field of automated office, and batch processing is simply a blessing for overtime workers.
Automated office is nothing more than excel, ppt, word, email, file processing, data analysis and processing, crawlers, etc. This time, let’s take a look at the knowledge points of python automated office.
-
Python basics
-
excel automation
-
ppt automation
-
word automation
-
Mail handling
-
Batch processing of files
-
Data processing and analysis
-
Automated crawler
Let’s explain them one by one in detail below.
Python basics
The prerequisite for being able to do this is that you can use Python. At the very least, you must be familiar with basic syntax and be able to write small scripts.
For the Python syntax requirements, you can check what you need to learn by referring to the basic Python tutorial, find a free video tutorial to follow, and then practice coding more. If you are used to reading, you can buy an introductory book on python for reference.
Syntax | Main content |
---|---|
Basic data types | Immutable data (3): Number, String, Tuple |
Variable data (3): List (List), Dictionary (Dictionary), Set (Collection) | |
Operators | Arithmetic operators, logical operators , assignment operator, comparison operator, bit operator… |
Numeric type | Integer type (Int), floating point type (float), complex number (complex) |
Conditional control statement | if…elif…else statement |
Loop statement | While statement, for statement |
Function | def definition function, function call, parameter transfer, anonymous function… |
Iteration | Iteration process, iterator, generator, generator expression |
File operation | open() function, read, readline, readlines, write…methods |
os module | Processing system files and directories |
Module | Module import, commonly used standard modules, commonly used third-party libraries |
Errors and exceptions | try/except statement |
Object-oriented | Just master the object-oriented concept |
Method | Function |
---|---|
os.chdir(path) | Change the current working directory |
os.getcwd() | Return to the current working directory |
os.listdir() | Returns a list of the names of files or folders contained in the folder specified by path |
os.makedirs(path [, mode]) | Create a folder named path |
os.remove(path) | Remove the path as file of path |
… | … |
Data processing and analysis
I do data analysis work, and python is basically the main tool, so this is undoubtedly the most valuable part of python office automation.
The main libraries for data processing include: pandas, numpy, matplotlib, sklearn…
pandas is an ever-improving Python data science library. Its data structure is very suitable for data processing, and pandas incorporates a large number of analytical function methods, as well as commonly used statistical models and visualization processing.
If you use python for data analysis, almost 90% of the work during data preprocessing needs to be completed using pandas.
In some written examination questions for companies recruiting analysts, pandas has been used as a required tool, so if you want to become a data analyst, please work hard to learn to use pandas.
Numpy is a numerical calculation library for Python, and many analysis libraries, including pandas, are built on numpy.
Numpy’s core features include:
-
ndarray, a fast and space-efficient multidimensional array with vector arithmetic operations and complex broadcast capabilities
-
Standard mathematical functions for fast operations on entire sets of data (no need to write loops)
-
Tools for reading and writing disk data and tools for manipulating memory mapped files
-
Linear algebra, random number generation, and Fourier transform functions
-
A C API for integrating code written in C, C++, Fortran, etc.
Numpy is particularly important for numerical calculations because it can efficiently handle large arrays of data. This is because:
-
Numpy arrays use less memory than Python’s built-in sequences
-
Numpy can perform complex calculations on entire arrays without the need for Python’s for loops
matplotlib and seaborn are the main visualization tools in python. It is recommended that everyone learn them. Data presentation and data analysis are equally important.
sklearn and keras, sklearn is a python machine learning library that covers most machine learning models. Keras is a deep learning library that includes the efficient numerical libraries Theano and TensorFlow.
These are familiar god libraries and highly recommended to learn.
Automated crawler
I believe crawlers are what everyone is most interested in. Python crawlers have many implementation libraries, such as urllib, requests, scrapy, etc., as well as parsing libraries such as xpath and beautifulsoup.
It is easy to get started with crawlers, but difficult to master, so beginners can try to write some simple crawlers, such as Douban, Zhihu, and Weibo.
Others
Other less commonly used automated office libraries, such as processing PDFs, pictures, video and audio, etc., will not be introduced here.
If you are interested, you can leave a message at the end of this article. What incredible python libraries have you used and what problems have you solved?
Finally:
Python learning materials
If you want to learn Python to help you automate your office, or are preparing to learn Python or are currently learning it, you should be able to use the following and get it if you need it.
① Python learning roadmap for all directions, knowing what to learn in each direction ② More than 100 Python course videos, covering essential basics, crawlers and data analysis ③ More than 100 Python practical cases, learning is no longer just theory ④ Huawei’s exclusive Python comic tutorial, you can also learn it on your mobile phone ⑤Real Python interview questions from Internet companies over the years, very convenient for review
There are ways to get it at the end of the article
1. Learning routes in all directions of Python
The Python all-direction route is to organize the commonly used technical points of Python to form a summary of knowledge points in various fields. Its usefulness is that you can find corresponding learning resources according to the above knowledge points to ensure that you learn more comprehensively.
2. Python course video
When we watch videos and learn, we can’t just move our eyes and brain but not our hands. The more scientific learning method is to use them after understanding. At this time, hands-on projects are very suitable.
3. Python practical cases
Optical theory is useless. You must learn to follow along and practice it in order to apply what you have learned to practice. At this time, you can learn from some practical cases.
Four Python Comics Tutorial
Use easy-to-understand comics to teach you to learn Python, making it easier for you to remember and not boring.
5. Internet company interview questions
We must learn Python to find a high-paying job. The following interview questions are the latest interview materials from first-tier Internet companies such as Alibaba, Tencent, Byte, etc., and Alibaba bosses have given authoritative answers. After finishing this set I believe everyone can find a satisfactory job based on the interview information.
This complete version of the complete set of Python learning materials has been uploaded to CSDN. If friends need it, you can also scan the official QR code of csdn below or click on the WeChat card at the bottom of the homepage and article to get the method. [Guaranteed 100% free] strong>