Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anarinsk committed Aug 3, 2023
1 parent 2a7685d commit fb9cbcb
Show file tree
Hide file tree
Showing 9 changed files with 1,109 additions and 0 deletions.
59 changes: 59 additions & 0 deletions my-project/python-notebooks/check_packages-version.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"trusted": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"scikit-learn: 1.1.1\n",
"pandas: 1.4.2\n",
"numpy: 1.22.4\n",
"scipy: 1.8.1\n",
"3.10.2 (main, Sep 15 2022, 23:28:12) [Clang 15.0.0 (https://github.com/llvm/llvm-project 7effcbda49ba32991b8955821b8f\n"
]
}
],
"source": [
"# Test for package version installed\n",
"\n",
"\n",
"import sklearn; print(\"scikit-learn: \" +sklearn.__version__)\n",
"import pandas; print(\"pandas: \" + pandas.__version__)\n",
"import numpy; print(\"numpy: \" + numpy.__version__)\n",
"import scipy; print(\"scipy: \" + scipy.__version__)\n",
"import pyodide; print(\"pyodide: \" + pyodide.__version__)\n",
"\n",
"print(\"-\"*25)\n",
"\n",
"import sys; print(sys.version)\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python (Pyodide)",
"language": "python",
"name": "python"
},
"language_info": {
"codemirror_mode": {
"name": "python",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
145 changes: 145 additions & 0 deletions my-project/python-notebooks/pandas_read-csv-http.ipynb

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions my-project/python-notebooks/setup_mpl-korfont.ipynb

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions my-project/python-notebooks/test_latex-printing.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "python",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8"
},
"kernelspec": {
"name": "python",
"display_name": "Python (Pyodide)",
"language": "python"
}
},
"nbformat_minor": 4,
"nbformat": 4,
"cells": [
{
"cell_type": "markdown",
"source": "$$\nT(x,y) = x + \\beta y^3\n$$",
"metadata": {}
},
{
"cell_type": "code",
"source": "1+1",
"metadata": {
"trusted": true
},
"execution_count": 1,
"outputs": [
{
"execution_count": 1,
"output_type": "execute_result",
"data": {
"text/plain": "2"
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"source": "import numpy as np",
"metadata": {
"trusted": true
},
"execution_count": 1,
"outputs": []
},
{
"cell_type": "code",
"source": "",
"metadata": {},
"execution_count": null,
"outputs": []
}
]
}
64 changes: 64 additions & 0 deletions my-project/python-notebooks/test_sklearn-fetch.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"metadata": {
"kernelspec": {
"display_name": "Python (Pyodide)",
"language": "python",
"name": "python"
},
"language_info": {
"codemirror_mode": {
"name": "python",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8"
}
},
"nbformat_minor": 4,
"nbformat": 4,
"cells": [
{
"cell_type": "markdown",
"source": "- `pyodide-http` 패키지와 함께 쓰면 그냥 pyodide에서도 잘 작동한다. ",
"metadata": {}
},
{
"cell_type": "code",
"source": "%pip -q install pyodide-http",
"metadata": {
"trusted": true
},
"execution_count": 2,
"outputs": []
},
{
"cell_type": "code",
"source": "from sklearn.datasets import fetch_california_housing\nimport pandas as pd \nimport pyodide_http \npyodide_http.patch_all() # Patch all libraries\n\ntest = fetch_california_housing(as_frame=True)\n\ntest",
"metadata": {
"trusted": true
},
"execution_count": 3,
"outputs": [
{
"execution_count": 3,
"output_type": "execute_result",
"data": {
"text/plain": "{'data': MedInc HouseAge AveRooms AveBedrms Population AveOccup Latitude \\\n 0 8.3252 41.0 6.984127 1.023810 322.0 2.555556 37.88 \n 1 8.3014 21.0 6.238137 0.971880 2401.0 2.109842 37.86 \n 2 7.2574 52.0 8.288136 1.073446 496.0 2.802260 37.85 \n 3 5.6431 52.0 5.817352 1.073059 558.0 2.547945 37.85 \n 4 3.8462 52.0 6.281853 1.081081 565.0 2.181467 37.85 \n ... ... ... ... ... ... ... ... \n 20635 1.5603 25.0 5.045455 1.133333 845.0 2.560606 39.48 \n 20636 2.5568 18.0 6.114035 1.315789 356.0 3.122807 39.49 \n 20637 1.7000 17.0 5.205543 1.120092 1007.0 2.325635 39.43 \n 20638 1.8672 18.0 5.329513 1.171920 741.0 2.123209 39.43 \n 20639 2.3886 16.0 5.254717 1.162264 1387.0 2.616981 39.37 \n \n Longitude \n 0 -122.23 \n 1 -122.22 \n 2 -122.24 \n 3 -122.25 \n 4 -122.25 \n ... ... \n 20635 -121.09 \n 20636 -121.21 \n 20637 -121.22 \n 20638 -121.32 \n 20639 -121.24 \n \n [20640 rows x 8 columns],\n 'target': 0 4.526\n 1 3.585\n 2 3.521\n 3 3.413\n 4 3.422\n ... \n 20635 0.781\n 20636 0.771\n 20637 0.923\n 20638 0.847\n 20639 0.894\n Name: MedHouseVal, Length: 20640, dtype: float64,\n 'frame': MedInc HouseAge AveRooms AveBedrms Population AveOccup Latitude \\\n 0 8.3252 41.0 6.984127 1.023810 322.0 2.555556 37.88 \n 1 8.3014 21.0 6.238137 0.971880 2401.0 2.109842 37.86 \n 2 7.2574 52.0 8.288136 1.073446 496.0 2.802260 37.85 \n 3 5.6431 52.0 5.817352 1.073059 558.0 2.547945 37.85 \n 4 3.8462 52.0 6.281853 1.081081 565.0 2.181467 37.85 \n ... ... ... ... ... ... ... ... \n 20635 1.5603 25.0 5.045455 1.133333 845.0 2.560606 39.48 \n 20636 2.5568 18.0 6.114035 1.315789 356.0 3.122807 39.49 \n 20637 1.7000 17.0 5.205543 1.120092 1007.0 2.325635 39.43 \n 20638 1.8672 18.0 5.329513 1.171920 741.0 2.123209 39.43 \n 20639 2.3886 16.0 5.254717 1.162264 1387.0 2.616981 39.37 \n \n Longitude MedHouseVal \n 0 -122.23 4.526 \n 1 -122.22 3.585 \n 2 -122.24 3.521 \n 3 -122.25 3.413 \n 4 -122.25 3.422 \n ... ... ... \n 20635 -121.09 0.781 \n 20636 -121.21 0.771 \n 20637 -121.22 0.923 \n 20638 -121.32 0.847 \n 20639 -121.24 0.894 \n \n [20640 rows x 9 columns],\n 'target_names': ['MedHouseVal'],\n 'feature_names': ['MedInc',\n 'HouseAge',\n 'AveRooms',\n 'AveBedrms',\n 'Population',\n 'AveOccup',\n 'Latitude',\n 'Longitude'],\n 'DESCR': '.. _california_housing_dataset:\\n\\nCalifornia Housing dataset\\n--------------------------\\n\\n**Data Set Characteristics:**\\n\\n :Number of Instances: 20640\\n\\n :Number of Attributes: 8 numeric, predictive attributes and the target\\n\\n :Attribute Information:\\n - MedInc median income in block group\\n - HouseAge median house age in block group\\n - AveRooms average number of rooms per household\\n - AveBedrms average number of bedrooms per household\\n - Population block group population\\n - AveOccup average number of household members\\n - Latitude block group latitude\\n - Longitude block group longitude\\n\\n :Missing Attribute Values: None\\n\\nThis dataset was obtained from the StatLib repository.\\nhttps://www.dcc.fc.up.pt/~ltorgo/Regression/cal_housing.html\\n\\nThe target variable is the median house value for California districts,\\nexpressed in hundreds of thousands of dollars ($100,000).\\n\\nThis dataset was derived from the 1990 U.S. census, using one row per census\\nblock group. A block group is the smallest geographical unit for which the U.S.\\nCensus Bureau publishes sample data (a block group typically has a population\\nof 600 to 3,000 people).\\n\\nAn household is a group of people residing within a home. Since the average\\nnumber of rooms and bedrooms in this dataset are provided per household, these\\ncolumns may take surpinsingly large values for block groups with few households\\nand many empty houses, such as vacation resorts.\\n\\nIt can be downloaded/loaded using the\\n:func:`sklearn.datasets.fetch_california_housing` function.\\n\\n.. topic:: References\\n\\n - Pace, R. Kelley and Ronald Barry, Sparse Spatial Autoregressions,\\n Statistics and Probability Letters, 33 (1997) 291-297\\n'}"
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"source": "",
"metadata": {},
"execution_count": null,
"outputs": []
}
]
}
Loading

0 comments on commit fb9cbcb

Please sign in to comment.