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
The `Modin* Vs. Pandas Performance` code illustrates how to use Modin* to replace the Pandas API. The sample compares the performance of Modin* and the performance of Pandas for specific dataframe operations.
3
+
The `Modin Vs. Pandas Performance` code illustrates how to use Modin* to replace the Pandas API. The sample compares the performance of Modin and the performance of Pandas for specific dataframe operations.
4
4
5
5
| Area | Description
6
6
|:--- |:---
7
7
| Category | Concepts and Functionality
8
-
| What you will learn | How to accelerate the Pandas API using Modin*.
8
+
| What you will learn | How to accelerate the Pandas API using Modin.
9
9
| Time to complete | Less than 10 minutes
10
10
11
11
## Purpose
@@ -19,77 +19,138 @@ You can run the sample locally or in Google Colaboratory (Colab).
> **Note**: AI and Analytics samples are validated on AI Tools Offline Installer. For the full list of validated platforms refer to [Platform Validation](https://github.com/oneapi-src/oneAPI-samples/tree/master?tab=readme-ov-file#platform-validation).
25
+
<!-- for migrated samples - modify the note above to provide information on samples validation and preferred installation option -->
23
26
24
27
## Key Implementation Details
25
28
26
-
This code sample is implemented for CPU using Python programming language. The sample requires NumPy, Pandas, Modin* libraries, and the time module in Python.
29
+
This code sample is implemented for CPU using Python programming language. The sample requires NumPy, Pandas, Modin libraries, and the time module in Python.
27
30
28
31
## Environment Setup
29
32
30
-
If you want to run the sample on a local system using a command-line interface (CLI), you must install the Modin in a new Conda* environment first.
33
+
You will need to download and install the following toolkits, tools, and components to use the sample.
34
+
<!-- Use numbered steps instead of subheadings -->
31
35
32
-
### Install Modin*
36
+
**1. Get AI Tools**
33
37
34
-
1. Create a Conda environment.
35
-
```
36
-
conda create --name modin
37
-
```
38
-
2. Activate the Conda environment.
39
-
```
40
-
source activate modin
41
-
```
42
-
3. Remove existing versions of Modin* (if any exist).
43
-
```
44
-
conda remove modin --y
45
-
```
46
-
4. Install Modin (v0.12.1 or newer).
47
-
```
48
-
pip install modin[all]==0.12.1
49
-
```
50
-
5. Install the NumPy and Pandas libraries.
51
-
```
52
-
pip install numpy
53
-
pip install pandas
54
-
```
55
-
6. Install ipython to run the notebook on your system.
56
-
```
57
-
pip install ipython
58
-
```
59
-
### Run the Sample
38
+
Required AI Tools: Modin
60
39
61
-
1. Change to the directory containing the `Modin_Vs_Pandas.ipynb` notebook file on your local system.
40
+
If you have not already, select and install these Tools via [AI Tools Selector](https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-tools-selector.html). AI and Analytics samples are validated on AI Tools Offline Installer. It is recommended to select Offline Installer option in AI Tools Selector.
62
41
63
-
2. Run the sample notebook.
64
-
```
65
-
ipython Modin_Vs_Pandas.ipynb
66
-
```
42
+
>**Note**: If Docker option is chosen in AI Tools Selector, refer to [Working with Preset Containers](https://github.com/intel/ai-containers/tree/main/preset) to learn how to run the docker and samples.
67
43
68
-
## Run the `Modin* Vs Pandas Performance` Sample in Google Colaboratory
44
+
**2. (Offline Installer) Activate the AI Tools bundle base environment**
45
+
<!-- this step is from AI Tools GSG, please don't modify unless GSG is updated -->
46
+
If the default path is used during the installation of AI Tools:
cd oneAPI-samples/AI-and-Analytics/Getting-Started-Samples/Modin_Vs_Pandas
69
+
```
71
70
72
-
2. Open the notebook file, and remove the prepended number sign (#) symbol from the following lines:
73
-
```
74
-
#!pip install modin[all]==0.12.1
75
-
#!pip install numpy
76
-
#!pip install pandas
77
-
```
78
-
These changes will install the Modin and the NumPy and Pandas libraries when run in the Colab notebook.
71
+
**5. Install dependencies**
72
+
<!-- It is required to have requirement.txt file in sample dir. It should list additional libraries, such as matplotlib, ipykernel etc. -->
73
+
>**Note**: Before running the following commands, make sure your Conda/Python environment with AI Tools installed is activated
79
74
80
-
3. Save your changes.
75
+
```
76
+
pip install -r requirements.txt
77
+
pip install notebook
78
+
```
79
+
For Jupyter Notebook, refer to [Installing Jupyter](https://jupyter.org/install) for detailed installation instructions.
81
80
82
-
4. Open [Google Colaboratory](https://colab.research.google.com/?utm_source=scs-index).
81
+
## Run the Sample
82
+
>**Note**: Before running the sample, make sure [Environment Setup](https://github.com/oneapi-src/oneAPI-samples/tree/master/AI-and-Analytics/Getting-Started-Samples/INC-Quantization-Sample-for-PyTorch#environment-setup) is completed.
83
83
84
-
5. Sign in to Colab using your Google account.
84
+
Go to the section which corresponds to the installation method chosen in [AI Tools Selector](https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-tools-selector.html) to see relevant instructions:
<!-- for migrated samples - it's acceptable to change the order of the sections based on the validated/preferred installation options. However, all 3 sections (Offline, Conda/PIP, Docker) should be present in the doc -->
89
+
### AI Tools Offline Installer (Validated)
85
90
86
-
6. Select **File** > **Upload notebook**.
91
+
**1. Register Conda kernel to Jupyter Notebook kernel**
87
92
88
-
7. Upload the modified notebook file.
93
+
If the default path is used during the installation of AI Tools:
<!-- add other flags to jupyter notebook command if needed, such as port 8888 or allow-root -->
136
+
```
137
+
jupyter notebook --ip=0.0.0.0
138
+
```
139
+
**3. Follow the instructions to open the URL with the token in your browser**
140
+
141
+
**4. Select the Notebook**
142
+
```
143
+
Modin_Vs_Pandas.ipynb
144
+
```
145
+
**5. Change the kernel to `<your-env-name>`**
146
+
<!-- leave <your-env-name> as a placeholder as user could choose any name for the env -->
147
+
148
+
**6. Run every cell in the Notebook in sequence**
149
+
150
+
### Docker
151
+
AI Tools Docker images already have Get Started samples pre-installed. Refer to [Working with Preset Containers](https://github.com/intel/ai-containers/tree/main/preset) to learn how to run the docker and samples.
152
+
153
+
<!-- Remove Intel® DevCloud section or other outdated sections -->
93
154
94
155
## Example Output
95
156
@@ -109,8 +170,11 @@ Example expected cell output is included in `Modin_Vs_Pandas.ipynb`.
109
170
## License
110
171
111
172
Code samples are licensed under the MIT license. See
112
-
[License.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/License.txt) for details.
Third party program licenses are at [third-party-programs.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/third-party-programs.txt).
0 commit comments