You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lectures/polars.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ More sophisticated statistical functionality is left to other packages, such as
63
63
This lecture will provide a basic introduction to Polars.
64
64
65
65
```{tip}
66
-
*Why use Polars over pandas?* One reason is *performance*. As a general rule, it is recommended to have 5 to 10 times as much RAM as the size of the dataset to carry out operations in pandas, compared to 2 to 4 times needed for Polars. In addition, Polars is between 10 and 100 times as fast as pandas for common operations. A great article comparing the Polars and pandas can be found [in this JetBrains blog post](https://blog.jetbrains.com/pycharm/2024/07/polars-vs-pandas/).
66
+
*Why use Polars over pandas?* One reason is *performance*: as a general rule, it is recommended to have 5 to 10 times as much RAM as the size of the dataset to carry out operations in pandas, compared to 2 to 4 times needed for Polars; in addition, Polars is between 10 and 100 times as fast as pandas for common operations; a great article comparing Polars and pandas can be found [in this JetBrains blog post](https://blog.jetbrains.com/pycharm/2024/07/polars-vs-pandas/).
67
67
```
68
68
69
69
Throughout the lecture, we will assume that the following imports have taken place
@@ -73,7 +73,6 @@ import polars as pl
73
73
import pandas as pd
74
74
import numpy as np
75
75
import matplotlib.pyplot as plt
76
-
import requests
77
76
```
78
77
79
78
Two important data types defined by Polars are `Series` and `DataFrame`.
@@ -97,7 +96,7 @@ s
97
96
```
98
97
99
98
```{note}
100
-
You may notice the above series has no indices, unlike in [pd.Series](pandas:series). This is because Polars is column-centric and accessing data is predominantly managed through filtering and boolean masks. Here is [an interesting blog post discussing this in more detail](https://medium.com/data-science/understand-polars-lack-of-indexes-526ea75e413).
99
+
You may notice the above series has no indices, unlike in [pd.Series](pandas:series); this is because Polars' is columncentric and accessing data is predominantly managed through filtering and boolean masks; here is [an interesting blog post discussing this in more detail](https://medium.com/data-science/understand-polars-lack-of-indexes-526ea75e413).
101
100
```
102
101
103
102
Polars `Series` are built on top of Apache Arrow arrays and support many similar operations to Pandas `Series`.
0 commit comments