{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Growth rates and fluxes\n", "\n", "One of the major applications of micom is to identify growth rates and fluxes for a given community. We will return to our *E. coli* toy example." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n"
      ],
      "text/plain": [
       "\u001b[?25l"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1e9aca04b03846c494888870dc28f077",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "
\n",
       "
\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from micom import Community, data\n", "\n", "tax = data.test_taxonomy()\n", "com = Community(tax)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### FBA\n", "\n", "If one is only interested in the community growth rate $\\mu_c$ we can use normal FBA to optimize this growth rate. By default micom assigns the community growth rate as the objective for a community model. " ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1.0*community_objective\n" ] }, { "data": { "text/html": [ "community growth: 0.874
status: optimal
taxa:
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
abundancegrowth_ratereactionsmetabolites
compartments
Escherichia_coli_10.251.5264499572
Escherichia_coli_20.250.6530149572
Escherichia_coli_30.250.2424109572
Escherichia_coli_40.251.0738139572
mediumNaNNaN2020
\n", "
" ], "text/plain": [ "" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(com.objective.expression)\n", "com.optimize()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`optimize` returns a full-fledged solution object and you can inspect several aspects of it. For instance to get individual growth rates and information for the taxa:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
abundancegrowth_ratereactionsmetabolites
compartments
Escherichia_coli_10.251.5264499572
Escherichia_coli_20.250.6530149572
Escherichia_coli_30.250.2424109572
Escherichia_coli_40.251.0738139572
mediumNaNNaN2020
\n", "
" ], "text/plain": [ " abundance growth_rate reactions metabolites\n", "compartments \n", "Escherichia_coli_1 0.25 1.526449 95 72\n", "Escherichia_coli_2 0.25 0.653014 95 72\n", "Escherichia_coli_3 0.25 0.242410 95 72\n", "Escherichia_coli_4 0.25 1.073813 95 72\n", "medium NaN NaN 20 20" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sol = com.optimize()\n", "sol.members" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default micom does not return fluxes since that can be slow for realistic large community models. If you want fluxes as well you can do so by passing the `fluxes` argument to `optimize`. You can also specifiy if you would like the fluxes to be obtained by parsimonious FBA." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
reactionACALDACALDtACKrACONTaACONTbACt2rADK1AKGDHAKGt2rALCD2x...RPISUCCt2_2SUCCt3SUCDiSUCOASTALATHD2TKT1TKT2TPI
compartment
Escherichia_coli_10.00.00.0000009.6573729.6573720.0000000.08.0104900.00.0...-4.1242280.00.08.010490-8.0104902.7539370.02.7539372.20289012.573226
Escherichia_coli_20.00.00.0000004.7715204.7715200.0000000.04.0669850.00.0...-1.6576590.00.04.066985-4.0669851.0714490.01.0714490.8357115.752211
Escherichia_coli_30.00.00.0000002.4746642.4746640.0000000.02.2131290.00.0...-0.4981160.00.02.213129-2.2131290.2805060.00.2805060.1929962.545629
Escherichia_coli_40.00.0-0.0003277.1252037.125203-0.0003270.05.9666690.00.0...-2.8460220.00.05.966669-5.9666691.8820620.01.8820621.4944169.038452
mediumNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", "

5 rows × 115 columns

\n", "
" ], "text/plain": [ "reaction ACALD ACALDt ACKr ACONTa ACONTb ACt2r \\\n", "compartment \n", "Escherichia_coli_1 0.0 0.0 0.000000 9.657372 9.657372 0.000000 \n", "Escherichia_coli_2 0.0 0.0 0.000000 4.771520 4.771520 0.000000 \n", "Escherichia_coli_3 0.0 0.0 0.000000 2.474664 2.474664 0.000000 \n", "Escherichia_coli_4 0.0 0.0 -0.000327 7.125203 7.125203 -0.000327 \n", "medium NaN NaN NaN NaN NaN NaN \n", "\n", "reaction ADK1 AKGDH AKGt2r ALCD2x ... RPI SUCCt2_2 \\\n", "compartment ... \n", "Escherichia_coli_1 0.0 8.010490 0.0 0.0 ... -4.124228 0.0 \n", "Escherichia_coli_2 0.0 4.066985 0.0 0.0 ... -1.657659 0.0 \n", "Escherichia_coli_3 0.0 2.213129 0.0 0.0 ... -0.498116 0.0 \n", "Escherichia_coli_4 0.0 5.966669 0.0 0.0 ... -2.846022 0.0 \n", "medium NaN NaN NaN NaN ... NaN NaN \n", "\n", "reaction SUCCt3 SUCDi SUCOAS TALA THD2 TKT1 \\\n", "compartment \n", "Escherichia_coli_1 0.0 8.010490 -8.010490 2.753937 0.0 2.753937 \n", "Escherichia_coli_2 0.0 4.066985 -4.066985 1.071449 0.0 1.071449 \n", "Escherichia_coli_3 0.0 2.213129 -2.213129 0.280506 0.0 0.280506 \n", "Escherichia_coli_4 0.0 5.966669 -5.966669 1.882062 0.0 1.882062 \n", "medium NaN NaN NaN NaN NaN NaN \n", "\n", "reaction TKT2 TPI \n", "compartment \n", "Escherichia_coli_1 2.202890 12.573226 \n", "Escherichia_coli_2 0.835711 5.752211 \n", "Escherichia_coli_3 0.192996 2.545629 \n", "Escherichia_coli_4 1.494416 9.038452 \n", "medium NaN NaN \n", "\n", "[5 rows x 115 columns]" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sol = com.optimize(fluxes=True, pfba=True)\n", "sol.fluxes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By defaults fluxes are stratified by taxa and the external medium to aid further analysis. \n", "\n", "Returning to the growth rates we can see the major problem with regular FBA for community levels. Usually it will maximize growth for only a few taxa in the model yielding unrealistically high growth rates. However, in our setup we have 5 identical *E. coli* strains and we would expect all of the taxa to grow with the same rate (see Methods section)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Cooperative tradeoff\n", "\n", "Cooperative tradeoff is a two step methods that allows you to get a unique solution for the the individuals growth rates that favors individual growth but still allows for a sup-optimal community growth rate. For that we always have to decide on a fraction of the maximum community growth rate we want to enforce. Our own results based on a data set of 189 gut microbiomes suggest that this tradeoff has tobe substantially lower than the optimal community growth rate to yield realistic growth rates (<=50% optimum). For our *E. coli* model we can start with getting the best solution while still maintaining optimal community growth (100% of maximum).\n", "\n", "**Cooperative tradeoff requires a QP-capable solver such as cplex or gurobi (both have academic licenses available)!**" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "community growth: 0.874
status: optimal
taxa:
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
abundancegrowth_ratereactionsmetabolites
compartments
Escherichia_coli_10.250.8739229572
Escherichia_coli_20.250.8739229572
Escherichia_coli_30.250.8739229572
Escherichia_coli_40.250.8739229572
mediumNaNNaN2020
\n", "
" ], "text/plain": [ "" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sol = com.cooperative_tradeoff(fraction=1.0)\n", "sol" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As we see all taxa now grow at the same rate as would be expected. If we want fluxes as well we can again request those using the `fluxes` and `pfba` arguments." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
reactionACALDACALDtACKrACONTaACONTbACt2rADK1AKGDHAKGt2rALCD2x...RPISUCCt2_2SUCCt3SUCDiSUCOASTALATHD2TKT1TKT2TPI
compartment
Escherichia_coli_12.558942e-091.258398e-09-1.022332e-076.0072496.007249-1.022332e-072.584638e-095.0643761.595951e-091.300544e-09...-2.2815033.842359e-092.496730e-095.064376-5.0643761.4969842.593182e-091.4969841.1814987.477382
Escherichia_coli_22.558942e-091.258398e-09-1.022332e-076.0072496.007250-1.022332e-072.584638e-095.0643761.595951e-091.300544e-09...-2.2815033.842359e-092.496730e-095.064376-5.0643761.4969842.593182e-091.4969841.1814987.477382
Escherichia_coli_32.558942e-091.258398e-09-1.022332e-076.0072506.007249-1.022332e-072.584638e-095.0643751.595951e-091.300544e-09...-2.2815033.842359e-092.496730e-095.064375-5.0643751.4969842.593182e-091.4969841.1814987.477382
Escherichia_coli_42.558942e-091.258398e-09-1.022332e-076.0072496.007250-1.022332e-072.584638e-095.0643761.595951e-091.300544e-09...-2.2815033.842359e-092.496730e-095.064376-5.0643761.4969842.593182e-091.4969841.1814987.477382
mediumNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", "

5 rows × 115 columns

\n", "
" ], "text/plain": [ "reaction ACALD ACALDt ACKr ACONTa \\\n", "compartment \n", "Escherichia_coli_1 2.558942e-09 1.258398e-09 -1.022332e-07 6.007249 \n", "Escherichia_coli_2 2.558942e-09 1.258398e-09 -1.022332e-07 6.007249 \n", "Escherichia_coli_3 2.558942e-09 1.258398e-09 -1.022332e-07 6.007250 \n", "Escherichia_coli_4 2.558942e-09 1.258398e-09 -1.022332e-07 6.007249 \n", "medium NaN NaN NaN NaN \n", "\n", "reaction ACONTb ACt2r ADK1 AKGDH \\\n", "compartment \n", "Escherichia_coli_1 6.007249 -1.022332e-07 2.584638e-09 5.064376 \n", "Escherichia_coli_2 6.007250 -1.022332e-07 2.584638e-09 5.064376 \n", "Escherichia_coli_3 6.007249 -1.022332e-07 2.584638e-09 5.064375 \n", "Escherichia_coli_4 6.007250 -1.022332e-07 2.584638e-09 5.064376 \n", "medium NaN NaN NaN NaN \n", "\n", "reaction AKGt2r ALCD2x ... RPI SUCCt2_2 \\\n", "compartment ... \n", "Escherichia_coli_1 1.595951e-09 1.300544e-09 ... -2.281503 3.842359e-09 \n", "Escherichia_coli_2 1.595951e-09 1.300544e-09 ... -2.281503 3.842359e-09 \n", "Escherichia_coli_3 1.595951e-09 1.300544e-09 ... -2.281503 3.842359e-09 \n", "Escherichia_coli_4 1.595951e-09 1.300544e-09 ... -2.281503 3.842359e-09 \n", "medium NaN NaN ... NaN NaN \n", "\n", "reaction SUCCt3 SUCDi SUCOAS TALA THD2 \\\n", "compartment \n", "Escherichia_coli_1 2.496730e-09 5.064376 -5.064376 1.496984 2.593182e-09 \n", "Escherichia_coli_2 2.496730e-09 5.064376 -5.064376 1.496984 2.593182e-09 \n", "Escherichia_coli_3 2.496730e-09 5.064375 -5.064375 1.496984 2.593182e-09 \n", "Escherichia_coli_4 2.496730e-09 5.064376 -5.064376 1.496984 2.593182e-09 \n", "medium NaN NaN NaN NaN NaN \n", "\n", "reaction TKT1 TKT2 TPI \n", "compartment \n", "Escherichia_coli_1 1.496984 1.181498 7.477382 \n", "Escherichia_coli_2 1.496984 1.181498 7.477382 \n", "Escherichia_coli_3 1.496984 1.181498 7.477382 \n", "Escherichia_coli_4 1.496984 1.181498 7.477382 \n", "medium NaN NaN NaN \n", "\n", "[5 rows x 115 columns]" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sol = com.cooperative_tradeoff(fluxes=True, pfba=True)\n", "sol.fluxes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Also if you have prior information about the growth rates you can also enforce a minimum individual growth rate for the taxa." ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " \n" ] } ], "source": [ "sol1 = com.cooperative_tradeoff(min_growth=0.1) # single value\n", "sol2 = com.cooperative_tradeoff(min_growth=[0.1, 0.2, 0.3, 0.4]) # one value for each taxa\n", "print(sol1, sol2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, you might want to see the impact of the tradeoff parameter on your solution. For this you can simply pass in an array-like type as the `fraction` parameter." ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
tradeoffsolution
01.0<CommunitySolution 0.874 at 0x7f8bae2c3050>
10.9<CommunitySolution 0.787 at 0x7f8bae568490>
20.8<CommunitySolution 0.699 at 0x7f8bae742450>
30.7<CommunitySolution 0.612 at 0x7f8bae4893d0>
40.6<CommunitySolution 0.524 at 0x7f8bae540950>
50.5<CommunitySolution 0.437 at 0x7f8bae107650>
60.4<CommunitySolution 0.350 at 0x7f8bae1104d0>
70.3<CommunitySolution 0.262 at 0x7f8bae69b0d0>
80.2<CommunitySolution 0.175 at 0x7f8bae5311d0>
90.1<CommunitySolution 0.087 at 0x7f8bae437190>
\n", "
" ], "text/plain": [ " tradeoff solution\n", "0 1.0 \n", "1 0.9 \n", "2 0.8 \n", "3 0.7 \n", "4 0.6 \n", "5 0.5 \n", "6 0.4 \n", "7 0.3 \n", "8 0.2 \n", "9 0.1 " ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import numpy as np\n", "\n", "sols = com.cooperative_tradeoff(fraction=np.arange(0.1, 1.01, 0.1))\n", "sols" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The solutions can than be inspected by the usual pandas methods. See the [pandas documentation](https://pandas.pydata.org/pandas-docs/stable/) for more infos." ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
compartmentsEscherichia_coli_1Escherichia_coli_2Escherichia_coli_3Escherichia_coli_4medium
00.8739220.8739220.8739220.873922NaN
10.7865290.7865290.7865290.786529NaN
20.6991370.6991370.6991370.699137NaN
30.6117450.6117450.6117450.611745NaN
40.5243530.5243530.5243530.524353NaN
50.4369610.4369610.4369610.436961NaN
60.3495690.3495690.3495690.349569NaN
70.2621760.2621760.2621760.262176NaN
80.1747840.1747840.1747840.174784NaN
90.0873920.0873920.0873920.087392NaN
\n", "
" ], "text/plain": [ "compartments Escherichia_coli_1 Escherichia_coli_2 Escherichia_coli_3 \\\n", "0 0.873922 0.873922 0.873922 \n", "1 0.786529 0.786529 0.786529 \n", "2 0.699137 0.699137 0.699137 \n", "3 0.611745 0.611745 0.611745 \n", "4 0.524353 0.524353 0.524353 \n", "5 0.436961 0.436961 0.436961 \n", "6 0.349569 0.349569 0.349569 \n", "7 0.262176 0.262176 0.262176 \n", "8 0.174784 0.174784 0.174784 \n", "9 0.087392 0.087392 0.087392 \n", "\n", "compartments Escherichia_coli_4 medium \n", "0 0.873922 NaN \n", "1 0.786529 NaN \n", "2 0.699137 NaN \n", "3 0.611745 NaN \n", "4 0.524353 NaN \n", "5 0.436961 NaN \n", "6 0.349569 NaN \n", "7 0.262176 NaN \n", "8 0.174784 NaN \n", "9 0.087392 NaN " ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rates = sols.solution.apply(lambda x: x.members.growth_rate)\n", "rates" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.2" } }, "nbformat": 4, "nbformat_minor": 4 }