Skip to content

Commit 1ac7b8d

Browse files
committed
MAINT: Clean up code
Fix small issues identified by ruff Improve typing
1 parent c840e31 commit 1ac7b8d

4 files changed

+8
-3
lines changed

examples/iv_basic-examples.ipynb

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@
3232
"outputs": [],
3333
"source": [
3434
"import numpy as np\n",
35-
"from linearmodels.datasets import mroz\n",
35+
"import pandas as pd\n",
3636
"from statsmodels.api import add_constant\n",
3737
"\n",
38+
"from linearmodels.datasets import mroz\n",
39+
"\n",
3840
"print(mroz.DESCR)\n",
3941
"data = mroz.load()\n",
4042
"data = data.dropna()\n",
@@ -573,7 +575,7 @@
573575
"metadata": {},
574576
"outputs": [],
575577
"source": [
576-
"import pandas as pd\n",
578+
"v = IV2SLS(data[endog], data[exog + instr], None, None).fit().resids\n",
577579
"\n",
578580
"v = IV2SLS(data[endog], data[exog + instr], None, None).fit().resids\n",
579581
"\n",

examples/panel_examples.ipynb

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"outputs": [],
3030
"source": [
3131
"import pandas as pd\n",
32+
"\n",
3233
"from linearmodels.datasets import wage_panel\n",
3334
"\n",
3435
"data = wage_panel.load()\n",
@@ -54,6 +55,7 @@
5455
"outputs": [],
5556
"source": [
5657
"import statsmodels.api as sm\n",
58+
"\n",
5759
"from linearmodels.panel import PooledOLS\n",
5860
"\n",
5961
"exog_vars = [\"black\", \"hisp\", \"exper\", \"expersq\", \"married\", \"educ\", \"union\", \"year\"]\n",

examples/system_examples.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"# Common libraries\n",
4242
"import numpy as np\n",
4343
"import pandas as pd\n",
44+
"import seaborn as sns\n",
4445
"import statsmodels.api as sm"
4546
]
4647
},
@@ -180,7 +181,6 @@
180181
"outputs": [],
181182
"source": [
182183
"import matplotlib.pyplot as plt\n",
183-
"import seaborn as sns\n",
184184
"\n",
185185
"cov = res.sigma\n",
186186
"std = np.sqrt(np.diag(res.sigma)[:, None])\n",

requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ isort>=5.12
66
ipython
77
matplotlib
88
ruff
9+
jupyterlab-code-formatter
910
flake8
1011
jupyter
1112
nbconvert

0 commit comments

Comments
 (0)