- Here we use the global dataset of the number of new crown infections as our test data, let's first look at the data as a whole import pandas as pd df = pd.read_csv("owid-covid-data.csv") df_0608 = df[df['date'] == '2022-06-08']
- Recently, when I was deploying a front-end project, I needed to upload the front-end project zip file to the /tmp directory of the application server via the fortress machine, then enter the application server, use the mv command to move the zip
- Example: The output is the following case H e l l o W o r l d This can be done using a for loop. for name in "Hello World": print(name) This can also be done using the join method print("\n".join("Hello World"))
- In Python 3.0 onwards, keyboard input uses the input function >>> x=input >>> 123 123 There is no display on the command line, and the input 123 is directly assigned to x and printed. Using input alone can't solve most of the data processing, usually
- To avoid functional problems caused by some network or other uncontrollable factors, such as. For example, when sending a request, there will be a request timeout problem often due to network instability.
- Write your own code only for yourself to see, in fact, how to write. Once you have a team to work with, or to share your code, you have to write it properly, and professional code can accumulate technical influence for yourself.
- Sometimes we may need to use a list to sort another list, so we will have a list of numbers (indexes) and a list that we want to sort using these indexes
- We are often faced with lists containing strings that we need to sort alphabetically, by length, or any other factor we want or need for our application
- This set of daily list tasks are sorting tasks, and depending on the data types of the elements contained in the list, we will sort them in a slightly different way.
- Suppose we have two lists in Python and we want to merge them into dictionary form, with the items of one list as the keys of the dictionary and the other as the values. This is a very common problem that is often encountered when writing code in Python