software:python
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| software:python [2020/12/27 04:25] – [What problem does pandas solve?] superwizard | software:python [2024/08/03 02:18] (current) – [Python install] superwizard | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ------------------------------------------------------------------------------------------------------------------------------------------------\\ | ------------------------------------------------------------------------------------------------------------------------------------------------\\ | ||
| + | |||
| + | ====== Python install ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| + | 2024-08-02 | ||
| + | |||
| + | python -m pip install pandas | ||
| + | |||
| + | But when you use python -m pip with python being the specific interpreter you want to use, all of the above ambiguity is gone. If I say python3.8 -m pip then I know pip will be using and installing for my Python 3.8 interpreter (same goes for if I had said python3.7). | ||
| + | And if you're on Windows there is an added benefit to using python -m pip as it lets pip update itself. Basically because pip.exe is considered running when you do pip install --upgrade pip, Windows won't let you overwrite pip.exe. But if you do python -m pip install --upgrade pip you avoid that issue as it's python.exe that's running, not pip.exe. | ||
| + | |||
| + | From < | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | ====== Wireshark tcpdump to neo4j plot ====== | ||
| + | |||
| <WRAP center round box > | <WRAP center round box > | ||
| Line 531: | Line 549: | ||
| From < | From < | ||
| + | </ | ||
| + | ====== Regular Expression ====== | ||
| + | |||
| + | |||
| + | <WRAP center round box > | ||
| 2019-05-29 | 2019-05-29 | ||
| Line 555: | Line 578: | ||
| From < | From < | ||
| - | |||
| - | |||
| - | |||
| - | |||
| </ | </ | ||
| - | ====== | + | ====== |
| <WRAP center round box > | <WRAP center round box > | ||
| Line 572: | Line 591: | ||
| From < | From < | ||
| + | </ | ||
| + | ====== The built-in os module has a number of useful functions ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| The built-in os module has a number of useful functions that can be used to list directory contents and filter the results. To get a list of all the files and folders in a particular directory in the filesystem, use os.listdir() in legacy versions of Python or os.scandir() in Python 3.x. os.scandir() is the preferred method to use if you also want to get file and directory properties such as file size and modification date. | The built-in os module has a number of useful functions that can be used to list directory contents and filter the results. To get a list of all the files and folders in a particular directory in the filesystem, use os.listdir() in legacy versions of Python or os.scandir() in Python 3.x. os.scandir() is the preferred method to use if you also want to get file and directory properties such as file size and modification date. | ||
| Line 579: | Line 602: | ||
| + | </ | ||
| + | |||
| + | ====== Splitting, Concatenating, | ||
| + | |||
| + | <WRAP center round box > | ||
| 2019-05-20 | 2019-05-20 | ||
| Line 586: | Line 614: | ||
| + | </ | ||
| + | |||
| + | ====== Regex Testor ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| Regex Testor | Regex Testor | ||
| Line 591: | Line 624: | ||
| https:// | https:// | ||
| + | </ | ||
| + | |||
| + | ====== processdokuwikifile ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| 2019-05-15 | 2019-05-15 | ||
| Line 623: | Line 661: | ||
| From < | From < | ||
| + | </ | ||
| + | ====== PASS BY OBJECT REFERENCE (Case in python): ====== | ||
| + | <WRAP center round box > | ||
| 2019-04-08 | 2019-04-08 | ||
| Line 656: | Line 697: | ||
| From < | From < | ||
| + | </ | ||
| + | ====== Plotly ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| 2019-03-31 | 2019-03-31 | ||
| Line 673: | Line 718: | ||
| + | </ | ||
| + | |||
| + | ====== Python write to CSV ====== | ||
| + | |||
| + | |||
| + | <WRAP center round box > | ||
| 2019-03-29 | 2019-03-29 | ||
| Line 705: | Line 756: | ||
| From < | From < | ||
| + | </ | ||
| + | ====== CSV in Python adding an extra carriage return, on Windows ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| CSV in Python adding an extra carriage return, on Windows | CSV in Python adding an extra carriage return, on Windows | ||
| Line 717: | Line 772: | ||
| From < | From < | ||
| + | </ | ||
| + | |||
| + | ====== Examples of simple type checking in Python: ====== | ||
| + | |||
| + | |||
| + | <WRAP center round box > | ||
| 2019-02-17 | 2019-02-17 | ||
| Line 740: | Line 801: | ||
| From < | From < | ||
| + | </ | ||
| + | |||
| + | ====== isinstance() ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| With one argument, return the type of an object. The return value is a type object. The isinstance() built-in function is recommended for testing | With one argument, return the type of an object. The return value is a type object. The isinstance() built-in function is recommended for testing | ||
| Line 757: | Line 823: | ||
| From < | From < | ||
| + | </ | ||
| + | ====== graph-cli ====== | ||
| - | + | <WRAP center round box > | |
| - | </ | + | |
| - | + | ||
| - | <WRAP center round box 60%> | + | |
| 2019-01-05 | 2019-01-05 | ||
| Line 773: | Line 838: | ||
| + | </ | ||
| + | |||
| + | ====== copy2 ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| 2018-12-25 | 2018-12-25 | ||
| Line 785: | Line 855: | ||
| From < | From < | ||
| + | </ | ||
| + | |||
| + | ====== Start of String Only: \A ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| Start of String Only: \A | Start of String Only: \A | ||
| Line 790: | Line 865: | ||
| From < | From < | ||
| + | |||
| + | </ | ||
| + | |||
| + | ====== Decimals interact well with much of the rest of Python ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| decimal — Decimal fixed point and floating point arithmetic | decimal — Decimal fixed point and floating point arithmetic | ||
| Line 821: | Line 902: | ||
| From < | From < | ||
| + | |||
| + | </ | ||
| + | |||
| + | ====== splitting a number into the integer and decimal parts ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| + | |||
| splitting a number into the integer and decimal parts | splitting a number into the integer and decimal parts | ||
| Line 856: | Line 944: | ||
| From < | From < | ||
| + | </ | ||
| + | |||
| + | ====== Module datetime provides ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| Module datetime provides classes for manipulating date and time in more object oriented way. One of them is datetime.datetime.now which return number of seconds since the epoch. | Module datetime provides classes for manipulating date and time in more object oriented way. One of them is datetime.datetime.now which return number of seconds since the epoch. | ||
| Line 876: | Line 969: | ||
| + | </ | ||
| + | |||
| + | ====== Example 2: Right justify string and fill the remaining spaces ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| Example 2: Right justify string and fill the remaining spaces | Example 2: Right justify string and fill the remaining spaces | ||
| Line 889: | Line 987: | ||
| From < | From < | ||
| + | </ | ||
| + | ====== Practical Business Python ====== | ||
| + | <WRAP center round box > | ||
| 2018-12-24 | 2018-12-24 | ||
| Practical Business Python | Practical Business Python | ||
| - | |||
| pbpython/ | pbpython/ | ||
| Line 902: | Line 1001: | ||
| + | </ | ||
| + | ====== The divmod() returns ====== | ||
| + | <WRAP center round box > | ||
| Line 913: | Line 1015: | ||
| From < | From < | ||
| + | </ | ||
| + | |||
| + | ====== numpy ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| 2018-11-18 | 2018-11-18 | ||
| Line 933: | Line 1040: | ||
| From < | From < | ||
| + | </ | ||
| + | |||
| + | ====== compare the use of lambda ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| Line 940: | Line 1052: | ||
| From < | From < | ||
| + | </ | ||
| + | |||
| + | ====== Key Functions ====== | ||
| + | |||
| + | <WRAP center round box > | ||
| Key Functions | Key Functions | ||
software/python.1609043157.txt.gz · Last modified: by superwizard
