with_exp
This commit is contained in:
32
test.ipynb
32
test.ipynb
@@ -136,6 +136,38 @@
|
||||
"\n",
|
||||
"print(mp.cpu_count())"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"71\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from orm import engine\n",
|
||||
"import pandas as pd\n",
|
||||
"import pickle\n",
|
||||
"str_sql = \"select e_id, count, max_max_ts, dct_lst_init_remove_firm_prod from iiabmdb.without_exp_experiment as a \" \\\n",
|
||||
"\"inner join \" \\\n",
|
||||
"\"(select e_id, count(id) as count, max(max_ts) as max_max_ts from iiabmdb.without_exp_sample as a \" \\\n",
|
||||
"\"inner join (select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id) as b \" \\\n",
|
||||
"\"on a.id = b.s_id \" \\\n",
|
||||
"\"group by e_id) as b \" \\\n",
|
||||
"\"on a.id = b.e_id \" \\\n",
|
||||
"\"order by count desc;\"\n",
|
||||
"result = pd.read_sql(sql=str_sql, con=engine)\n",
|
||||
"result['dct_lst_init_remove_firm_prod'] = result['dct_lst_init_remove_firm_prod'].apply(lambda x: pickle.loads(x))\n",
|
||||
"# print(result)\n",
|
||||
"list_dct = result.loc[result['count']>=9, 'dct_lst_init_remove_firm_prod'].to_list()\n",
|
||||
"print(len(list_dct))"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
Reference in New Issue
Block a user