* **By default, decimal characters, alphanumerics and whitespaces from all alphabets are matched unless `'flags=re.ASCII'` argument is used.**
* **By default, decimal characters, alphanumerics and whitespaces from all alphabets are matched unless `'flags=re.ASCII'` argument is used.**
* **As shown below, it restricts special sequence matches to the first 128 characters and prevents `'\s'` from accepting `'[\x1c-\x1f]'` (the so-called separator characters).**
* **As shown below, it restricts special sequence matches to the first 128 characters and prevents `'\s'` from accepting `'[\x1c-\x1f]'` (the so-called separator characters).**
* **Use a capital letter for negation.**
* **Use a capital letter for negation.**
```python
```python
'\d' == '[0-9]' # Matches decimal characters.
'\d' == '[0-9]' # Matches decimal characters.
'\w' == '[a-zA-Z0-9_]' # Matches alphanumerics and underscore.
'\w' == '[a-zA-Z0-9_]' # Matches alphanumerics and underscore.
@ -1548,7 +1549,7 @@ Open
```
```
* **`'encoding=None'` means that the default encoding is used, which is platform dependent. Best practice is to use `'encoding="utf-8"'` whenever possible.**
* **`'encoding=None'` means that the default encoding is used, which is platform dependent. Best practice is to use `'encoding="utf-8"'` whenever possible.**
* **`'newline=None'` means all different end of line combinations are converted to '\n' on read, while on write all '\n' characters are converted to system's default line separator.**
* **`'newline=None'` means all different end of line combinations are converted to '\n' on read, while on write all '\n' characters are converted to system's default line separator.**
* **`'newline=""'` means no conversions take place, but input is still broken into chunks by readline() and readlines() on '\n', '\r' and '\r\n'.**
* **`'newline=""'` means no conversions take place, but input is still broken into chunks by readline() and readlines() on every '\n', '\r' and '\r\n'.**
### Modes
### Modes
* **`'r'` - Read (default).**
* **`'r'` - Read (default).**
@ -1898,8 +1899,7 @@ with <conn>: # Exits the block with commit()
```
```
### Example
### Example
**In this example values are not actually saved because `'conn.commit()'` is omitted!**
**Values are not actually saved in this example because `'conn.commit()'` is omitted!**
```python
```python
>>> conn = sqlite3.connect('test.db')
>>> conn = sqlite3.connect('test.db')
>>> conn.execute('CREATE TABLE person (person_id INTEGER PRIMARY KEY, name, height)')
>>> conn.execute('CREATE TABLE person (person_id INTEGER PRIMARY KEY, name, height)')
* **The way `'agg()'` and `'transform()'` find out whether the passed function accepts an element or the whole Series is by passing it a single value at first and if it raises an error, then they pass it the whole Series. `'agg()'` only accepts Attribute/Type/ValueError.**
```python
```python
>>> sr = Series([1, 2], index=['x', 'y'])
>>> sr = Series([1, 2], index=['x', 'y'])
@ -3173,6 +3172,12 @@ y 2
```
```
* **Last result has a hierarchical index. Use `'<Sr>[key_1, key_2]'` to get its values.**
* **Last result has a hierarchical index. Use `'<Sr>[key_1, key_2]'` to get its values.**
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'encoding=None'</span></code> means that the default encoding is used, which is platform dependent. Best practice is to use <codeclass="python hljs"><spanclass="hljs-string">'encoding="utf-8"'</span></code> whenever possible.</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'encoding=None'</span></code> means that the default encoding is used, which is platform dependent. Best practice is to use <codeclass="python hljs"><spanclass="hljs-string">'encoding="utf-8"'</span></code> whenever possible.</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'newline=None'</span></code> means all different end of line combinations are converted to '\n' on read, while on write all '\n' characters are converted to system's default line separator.</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'newline=None'</span></code> means all different end of line combinations are converted to '\n' on read, while on write all '\n' characters are converted to system's default line separator.</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'newline=""'</span></code> means no conversions take place, but input is still broken into chunks by readline() and readlines() on '\n', '\r' and '\r\n'.</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'newline=""'</span></code> means no conversions take place, but input is still broken into chunks by readline() and readlines() on every '\n', '\r' and '\r\n'.</strong></li>
<div><h3id="example">Example</h3><p><strong>In this example values are not actually saved because <codeclass="python hljs"><spanclass="hljs-string">'conn.commit()'</span></code> is omitted!</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-meta">>>></span>conn = sqlite3.connect(<spanclass="hljs-string">'test.db'</span>)
<div><h3id="example">Example</h3><p><strong>Values are not actually saved in this example because <codeclass="python hljs"><spanclass="hljs-string">'conn.commit()'</span></code> is omitted!</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-meta">>>></span>conn = sqlite3.connect(<spanclass="hljs-string">'test.db'</span>)
<spanclass="hljs-meta">>>></span>conn.execute(<spanclass="hljs-string">'CREATE TABLE person (person_id INTEGER PRIMARY KEY, name, height)'</span>)
<spanclass="hljs-meta">>>></span>conn.execute(<spanclass="hljs-string">'CREATE TABLE person (person_id INTEGER PRIMARY KEY, name, height)'</span>)
<spanclass="hljs-meta">>>></span>conn.execute(<spanclass="hljs-string">'INSERT INTO person VALUES (NULL, ?, ?)'</span>, (<spanclass="hljs-string">'Jean-Luc'</span>, <spanclass="hljs-number">187</span>)).lastrowid
<spanclass="hljs-meta">>>></span>conn.execute(<spanclass="hljs-string">'INSERT INTO person VALUES (NULL, ?, ?)'</span>, (<spanclass="hljs-string">'Jean-Luc'</span>, <spanclass="hljs-number">187</span>)).lastrowid
<li><strong>The way <codeclass="python hljs"><spanclass="hljs-string">'agg()'</span></code> and <codeclass="python hljs"><spanclass="hljs-string">'transform()'</span></code> find out whether the passed function accepts an element or the whole Series is by passing it a single value at first and if it raises an error, then they pass it the whole Series. <codeclass="python hljs"><spanclass="hljs-string">'agg()'</span></code> only accepts Attribute/Type/ValueError.</strong></li>
@ -2580,6 +2577,10 @@ y <span class="hljs-number">2</span>
<ul>
<ul>
<li><strong>Last result has a hierarchical index. Use <codeclass="python hljs"><spanclass="hljs-string">'<Sr>[key_1, key_2]'</span></code> to get its values.</strong></li>
<li><strong>Last result has a hierarchical index. Use <codeclass="python hljs"><spanclass="hljs-string">'<Sr>[key_1, key_2]'</span></code> to get its values.</strong></li>