diff --git a/examples/ndd_member_update.ipynb b/examples/ndd_member_update.ipynb index 0daeb5d..4d98d45 100644 --- a/examples/ndd_member_update.ipynb +++ b/examples/ndd_member_update.ipynb @@ -12,10 +12,23 @@ "cell_type": "code", "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "'0.0.7'" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from pandarize.frame import Pandarizer\n", - "import pandas as pd" + "import pandarize\n", + "import pandas as pd\n", + "pandarize.__version__" ] }, { @@ -84,6 +97,7 @@ " url\n", " usere\n", " file\n", + " priority\n", " \n", " \n", " \n", @@ -91,12 +105,12 @@ " 0\n", " incollection\n", " jovo\n", - " Joshua Vogelstein\n", + " Vogelstein, Joshua\n", " Director\n", " Chief Unity Ninja\n", " \n", " \n", - " --\n", + " –\n", " \n", " \n", " \n", @@ -105,42 +119,44 @@ " director\n", " jovo\n", " jovo@jhu.edu\n", - " neurodata.io/about/jovo\n", + " neurodata.io/about/jovo/\n", " safe-zone\n", " vogelstein_joshua.jpg\n", + " 0.0\n", " \n", " \n", " 1\n", " incollection\n", - " tylertomita\n", - " Tyler Tomita\n", - " Postdoctoral Fellow\n", + " cep\n", + " Priebe, Carey\n", + " Professor\n", " \n", - " 8\n", - " 2014\n", - " 08/14 --\n", " \n", - " Developed Sparse Projection Oblique Randomer F...\n", - " MSE\n", - " BME, JHU\n", - " postdoc\n", - " postdoc\n", - " ttomita\n", " \n", + " –\n", " \n", " \n", - " tomita_tyler.jpg\n", + " \n", + " AMS, JHU\n", + " faculty\n", + " director\n", + " \n", + " cep@jhu.edu\n", + " \n", + " \n", + " priebe_carey.jpg\n", + " 1.0\n", " \n", " \n", " 2\n", " incollection\n", " jongshin\n", - " Jong Shin\n", + " Shin, Jong\n", " Software Engineer\n", - " Tech Support\n", + " Chief Digital Officer\n", " 9\n", " 2020\n", - " 09/20 --\n", + " 09/20 –\n", " \n", " Currently investigating the effect of inductiv...\n", " MS\n", @@ -152,90 +168,93 @@ " \n", " safe-zone\n", " jong_shin.png\n", + " 2.0\n", " \n", " \n", " 3\n", " incollection\n", - " aligeisa\n", - " Ali Geisa\n", - " Research Assistant\n", + " tylertomita\n", + " Tomita, Tyler\n", + " Postdoctoral Fellow\n", " \n", - " 3\n", - " 2020\n", - " 03/20 --\n", + " 8\n", + " 2014\n", + " 08/14 –\n", " \n", - " Researching progressive and lifelong learning ...\n", - " MS\n", + " Developed Sparse Projection Oblique Randomer F...\n", + " MSE\n", " BME, JHU\n", - " faculty - research\n", - " staffresearch\n", - " \n", - " \n", + " postdoc\n", + " postdoc\n", + " ttomita\n", + " ttomita2@jhmi.edu\n", " \n", " \n", - " ali_geisa.jpg\n", + " tomita_tyler.jpg\n", + " 3.0\n", " \n", " \n", " 4\n", " incollection\n", - " kareefullah\n", - " Kareef Ullah\n", - " Undergraduate Researcher\n", - " Cup Stacker\n", - " 9\n", - " 2021\n", - " 09/21 --\n", - " \n", - " Assisted with fixing issues in graspologic and...\n", - " \n", - " BME, JHU\n", - " undergrad\n", - " undergrad\n", + " jhow\n", + " How, Javier J.\n", + " Postdoctoral Fellow\n", " \n", - " kullah2@jhu.edu\n", + " 11\n", + " 2020\n", + " 11/20 –\n", " \n", + " Javier studies how larval zebrafish learn how ...\n", + " Ph.D.\n", + " Neurosciences, UCSD\n", + " postdoc\n", + " postdoc\n", + " javierhow\n", + " jhow@jhu.edu\n", " \n", - " kareef_ullah.jpg\n", + " safe-zone\n", + " javier_how.jpg\n", + " 3.0\n", " \n", " \n", "\n", "" ], "text/plain": [ - " type alias author usera \\\n", - "0 incollection jovo Joshua Vogelstein Director \n", - "1 incollection tylertomita Tyler Tomita Postdoctoral Fellow \n", - "2 incollection jongshin Jong Shin Software Engineer \n", - "3 incollection aligeisa Ali Geisa Research Assistant \n", - "4 incollection kareefullah Kareef Ullah Undergraduate Researcher \n", + " type alias author usera \\\n", + "0 incollection jovo Vogelstein, Joshua Director \n", + "1 incollection cep Priebe, Carey Professor \n", + "2 incollection jongshin Shin, Jong Software Engineer \n", + "3 incollection tylertomita Tomita, Tyler Postdoctoral Fellow \n", + "4 incollection jhow How, Javier J. Postdoctoral Fellow \n", "\n", - " userw month year number series \\\n", - "0 Chief Unity Ninja -- \n", - "1 8 2014 08/14 -- \n", - "2 Tech Support 9 2020 09/20 -- \n", - "3 3 2020 03/20 -- \n", - "4 Cup Stacker 9 2021 09/21 -- \n", + " userw month year number series \\\n", + "0 Chief Unity Ninja – \n", + "1 – \n", + "2 Chief Digital Officer 9 2020 09/20 – \n", + "3 8 2014 08/14 – \n", + "4 11 2020 11/20 – \n", "\n", - " abstract userb userc \\\n", - "0 BME, JHU \n", - "1 Developed Sparse Projection Oblique Randomer F... MSE BME, JHU \n", - "2 Currently investigating the effect of inductiv... MS BME, JHU \n", - "3 Researching progressive and lifelong learning ... MS BME, JHU \n", - "4 Assisted with fixing issues in graspologic and... BME, JHU \n", + " abstract userb \\\n", + "0 \n", + "1 \n", + "2 Currently investigating the effect of inductiv... MS \n", + "3 Developed Sparse Projection Oblique Randomer F... MSE \n", + "4 Javier studies how larval zebrafish learn how ... Ph.D. \n", "\n", - " userd keywords doi note \\\n", - "0 director director jovo jovo@jhu.edu \n", - "1 postdoc postdoc ttomita \n", - "2 staff staffresearch jshinm jshin69@jhu.edu \n", - "3 faculty - research staffresearch \n", - "4 undergrad undergrad kullah2@jhu.edu \n", + " userc userd keywords doi note \\\n", + "0 BME, JHU director director jovo jovo@jhu.edu \n", + "1 AMS, JHU faculty director cep@jhu.edu \n", + "2 BME, JHU staff staffresearch jshinm jshin69@jhu.edu \n", + "3 BME, JHU postdoc postdoc ttomita ttomita2@jhmi.edu \n", + "4 Neurosciences, UCSD postdoc postdoc javierhow jhow@jhu.edu \n", "\n", - " url usere file \n", - "0 neurodata.io/about/jovo safe-zone vogelstein_joshua.jpg \n", - "1 tomita_tyler.jpg \n", - "2 safe-zone jong_shin.png \n", - "3 ali_geisa.jpg \n", - "4 kareef_ullah.jpg " + " url usere file priority \n", + "0 neurodata.io/about/jovo/ safe-zone vogelstein_joshua.jpg 0.0 \n", + "1 priebe_carey.jpg 1.0 \n", + "2 safe-zone jong_shin.png 2.0 \n", + "3 tomita_tyler.jpg 3.0 \n", + "4 safe-zone javier_how.jpg 3.0 " ] }, "execution_count": 4, @@ -256,6 +275,13 @@ "pdr.df.to_excel(filepath, index=False, engine='xlsxwriter')" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Make changes to the downloaded and converted file" + ] + }, { "cell_type": "code", "execution_count": 6, @@ -318,12 +344,12 @@ " 0\n", " incollection\n", " jovo\n", - " Joshua Vogelstein\n", + " Vogelstein, Joshua\n", " Director\n", " Chief Unity Ninja\n", " \n", " \n", - " --\n", + " –\n", " \n", " \n", " \n", @@ -332,44 +358,44 @@ " director\n", " jovo\n", " jovo@jhu.edu\n", - " neurodata.io/about/jovo\n", + " neurodata.io/about/jovo/\n", " safe-zone\n", " vogelstein_joshua.jpg\n", - " 0\n", + " 0.0\n", " \n", " \n", " 1\n", " incollection\n", - " tylertomita\n", - " Tyler Tomita\n", - " Postdoctoral Fellow\n", + " cep\n", + " Priebe, Carey\n", + " Professor\n", " \n", - " 8\n", - " 2014\n", - " 08/14 --\n", " \n", - " Developed Sparse Projection Oblique Randomer F...\n", - " MSE\n", - " BME, JHU\n", - " postdoc\n", - " postdoc\n", - " ttomita\n", - " ttomita2@jhmi.edu\n", " \n", + " –\n", " \n", - " tomita_tyler.jpg\n", - " 3\n", + " \n", + " \n", + " AMS, JHU\n", + " faculty\n", + " director\n", + " \n", + " cep@jhu.edu\n", + " \n", + " \n", + " priebe_carey.jpg\n", + " 1.0\n", " \n", " \n", " 2\n", " incollection\n", " jongshin\n", - " Jong Shin\n", + " Shin, Jong\n", " Software Engineer\n", - " Tech Support\n", + " Chief Digital Officer\n", " 9\n", " 2020\n", - " 09/20 --\n", + " 09/20 –\n", " \n", " Currently investigating the effect of inductiv...\n", " MS\n", @@ -381,93 +407,93 @@ " \n", " safe-zone\n", " jong_shin.png\n", - " 2\n", + " 2.0\n", " \n", " \n", " 3\n", " incollection\n", - " aligeisa\n", - " Ali Geisa\n", - " Research Assistant\n", + " tylertomita\n", + " Tomita, Tyler\n", + " Postdoctoral Fellow\n", " \n", - " 3\n", - " 2020\n", - " 03/20 -- 08/22\n", - " 2022\n", - " Researching progressive and lifelong learning ...\n", - " MS\n", - " BME, JHU\n", - " faculty - research\n", - " staffresearch\n", + " 8\n", + " 2014\n", + " 08/14 –\n", " \n", - " realaligeisa@gmail.com\n", + " Developed Sparse Projection Oblique Randomer F...\n", + " MSE\n", + " BME, JHU\n", + " postdoc\n", + " postdoc\n", + " ttomita\n", + " ttomita2@jhmi.edu\n", " \n", " \n", - " ali_geisa.jpg\n", - " 9\n", + " tomita_tyler.jpg\n", + " 3.0\n", " \n", " \n", " 4\n", " incollection\n", - " kareefullah\n", - " Kareef Ullah\n", - " Undergraduate Researcher\n", - " Cup Stacker\n", - " 9\n", - " 2021\n", - " 09/21 --\n", - " \n", - " Assisted with fixing issues in graspologic and...\n", - " \n", - " BME, JHU\n", - " undergrad\n", - " undergrad\n", + " jhow\n", + " How, Javier J.\n", + " Postdoctoral Fellow\n", " \n", - " kullah2@jhu.edu\n", + " 11\n", + " 2020\n", + " 11/20 –\n", " \n", + " Javier studies how larval zebrafish learn how ...\n", + " Ph.D.\n", + " Neurosciences, UCSD\n", + " postdoc\n", + " postdoc\n", + " javierhow\n", + " jhow@jhu.edu\n", " \n", - " kareef_ullah.jpg\n", - " 6\n", + " safe-zone\n", + " javier_how.jpg\n", + " 3.0\n", " \n", " \n", "\n", "" ], "text/plain": [ - " type alias author usera \\\n", - "0 incollection jovo Joshua Vogelstein Director \n", - "1 incollection tylertomita Tyler Tomita Postdoctoral Fellow \n", - "2 incollection jongshin Jong Shin Software Engineer \n", - "3 incollection aligeisa Ali Geisa Research Assistant \n", - "4 incollection kareefullah Kareef Ullah Undergraduate Researcher \n", + " type alias author usera \\\n", + "0 incollection jovo Vogelstein, Joshua Director \n", + "1 incollection cep Priebe, Carey Professor \n", + "2 incollection jongshin Shin, Jong Software Engineer \n", + "3 incollection tylertomita Tomita, Tyler Postdoctoral Fellow \n", + "4 incollection jhow How, Javier J. Postdoctoral Fellow \n", "\n", - " userw month year number series \\\n", - "0 Chief Unity Ninja -- \n", - "1 8 2014 08/14 -- \n", - "2 Tech Support 9 2020 09/20 -- \n", - "3 3 2020 03/20 -- 08/22 2022 \n", - "4 Cup Stacker 9 2021 09/21 -- \n", + " userw month year number series \\\n", + "0 Chief Unity Ninja – \n", + "1 – \n", + "2 Chief Digital Officer 9 2020 09/20 – \n", + "3 8 2014 08/14 – \n", + "4 11 2020 11/20 – \n", "\n", - " abstract userb userc \\\n", - "0 BME, JHU \n", - "1 Developed Sparse Projection Oblique Randomer F... MSE BME, JHU \n", - "2 Currently investigating the effect of inductiv... MS BME, JHU \n", - "3 Researching progressive and lifelong learning ... MS BME, JHU \n", - "4 Assisted with fixing issues in graspologic and... BME, JHU \n", + " abstract userb \\\n", + "0 \n", + "1 \n", + "2 Currently investigating the effect of inductiv... MS \n", + "3 Developed Sparse Projection Oblique Randomer F... MSE \n", + "4 Javier studies how larval zebrafish learn how ... Ph.D. \n", "\n", - " userd keywords doi note \\\n", - "0 director director jovo jovo@jhu.edu \n", - "1 postdoc postdoc ttomita ttomita2@jhmi.edu \n", - "2 staff staffresearch jshinm jshin69@jhu.edu \n", - "3 faculty - research staffresearch realaligeisa@gmail.com \n", - "4 undergrad undergrad kullah2@jhu.edu \n", + " userc userd keywords doi note \\\n", + "0 BME, JHU director director jovo jovo@jhu.edu \n", + "1 AMS, JHU faculty director cep@jhu.edu \n", + "2 BME, JHU staff staffresearch jshinm jshin69@jhu.edu \n", + "3 BME, JHU postdoc postdoc ttomita ttomita2@jhmi.edu \n", + "4 Neurosciences, UCSD postdoc postdoc javierhow jhow@jhu.edu \n", "\n", - " url usere file priority \n", - "0 neurodata.io/about/jovo safe-zone vogelstein_joshua.jpg 0 \n", - "1 tomita_tyler.jpg 3 \n", - "2 safe-zone jong_shin.png 2 \n", - "3 ali_geisa.jpg 9 \n", - "4 kareef_ullah.jpg 6 " + " url usere file priority \n", + "0 neurodata.io/about/jovo/ safe-zone vogelstein_joshua.jpg 0.0 \n", + "1 priebe_carey.jpg 1.0 \n", + "2 safe-zone jong_shin.png 2.0 \n", + "3 tomita_tyler.jpg 3.0 \n", + "4 safe-zone javier_how.jpg 3.0 " ] }, "execution_count": 7, @@ -485,6 +511,7 @@ "metadata": {}, "outputs": [], "source": [ + "pdr.df.priority = pdr.df.priority.astype(float)\n", "pdr.df.sort_values(['priority'], ascending=True, inplace=True)#.reset_index(drop=True)" ] }, @@ -541,12 +568,12 @@ " 0\n", " incollection\n", " jovo\n", - " Joshua Vogelstein\n", + " Vogelstein, Joshua\n", " Director\n", " Chief Unity Ninja\n", " \n", " \n", - " --\n", + " –\n", " \n", " \n", " \n", @@ -555,21 +582,21 @@ " director\n", " jovo\n", " jovo@jhu.edu\n", - " neurodata.io/about/jovo\n", + " neurodata.io/about/jovo/\n", " safe-zone\n", " vogelstein_joshua.jpg\n", - " 0\n", + " 0.0\n", " \n", " \n", " 1\n", " incollection\n", " cep\n", - " Carey Priebe\n", + " Priebe, Carey\n", " Professor\n", " \n", " \n", " \n", - " --\n", + " –\n", " \n", " \n", " \n", @@ -581,18 +608,18 @@ " \n", " \n", " priebe_carey.jpg\n", - " 1\n", + " 1.0\n", " \n", " \n", " 2\n", " incollection\n", " jongshin\n", - " Jong Shin\n", + " Shin, Jong\n", " Software Engineer\n", - " Tech Support\n", + " Chief Digital Officer\n", " 9\n", " 2020\n", - " 09/20 --\n", + " 09/20 –\n", " \n", " Currently investigating the effect of inductiv...\n", " MS\n", @@ -604,18 +631,18 @@ " \n", " safe-zone\n", " jong_shin.png\n", - " 2\n", + " 2.0\n", " \n", " \n", " 3\n", " incollection\n", " tylertomita\n", - " Tyler Tomita\n", + " Tomita, Tyler\n", " Postdoctoral Fellow\n", " \n", " 8\n", " 2014\n", - " 08/14 --\n", + " 08/14 –\n", " \n", " Developed Sparse Projection Oblique Randomer F...\n", " MSE\n", @@ -627,18 +654,18 @@ " \n", " \n", " tomita_tyler.jpg\n", - " 3\n", + " 3.0\n", " \n", " \n", " 4\n", " incollection\n", " jhow\n", - " Javier Josue How\n", + " How, Javier J.\n", " Postdoctoral Fellow\n", " \n", " 11\n", " 2020\n", - " 11/20 --\n", + " 11/20 –\n", " \n", " Javier studies how larval zebrafish learn how ...\n", " Ph.D.\n", @@ -650,231 +677,47 @@ " \n", " safe-zone\n", " javier_how.jpg\n", - " 3\n", - " \n", - " \n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " \n", - " \n", - " 80\n", - " incollection\n", - " ivankuznetsov\n", - " Ivan Kuznetsov\n", - " \n", - " \n", - " 2\n", - " 2015\n", - " 02/15 -- 05/16\n", - " 2016\n", - " Currently an MD, PhD Candidate at the UPenn, w...\n", - " BSE\n", - " BME, JHU\n", - " undergrad\n", - " undergrad\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 9\n", - " \n", - " \n", - " 81\n", - " incollection\n", - " leoduan\n", - " Leo Duan\n", - " Post-doctoral Fellow\n", - " \n", - " 5\n", - " 2016\n", - " 05/16 -- 06/17\n", - " 2017\n", - " Went on to do a second postdoc with Leo Dunson...\n", - " Ph.D.\n", - " CIS, JHU\n", - " postdoc\n", - " postdoc\n", - " \n", - " \n", - " \n", - " \n", - " duan-leo.jpg\n", - " 9\n", - " \n", - " \n", - " 82\n", - " incollection\n", - " gregkiar\n", - " Greg Kiar\n", - " MSE advisee\n", - " \n", - " 8\n", - " 2014\n", - " 08/14 -- 06/17\n", - " 2017\n", - " Developer of m2g, the only existing \"soup to n...\n", - " BSE\n", - " BME, JHU\n", - " student\n", - " MSstudent\n", - " gkiar\n", - " \n", - " gkiar.github.com\n", - " \n", - " kiar_greg.jpg\n", - " 9\n", - " \n", - " \n", - " 83\n", - " incollection\n", - " guillermo_sapiro\n", - " Guillermo Sapiro\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " other\n", - " other\n", - " \n", - " guillermo.sapiro@gmail.com\n", - " \n", - " \n", - " guillermo_sapiro.jpg\n", - " 9\n", - " \n", - " \n", - " 84\n", - " incollection\n", - " rosslawrence\n", - " Ross Lawrence\n", - " MS advisee\n", - " MIA\n", - " 7\n", - " 2019\n", - " 07/19 -- 04/22\n", - " 2022\n", - " Lead m2g developer, maintainer of neuroparc, M...\n", - " BSE\n", - " BME, JHU\n", - " student\n", - " MSstudent\n", - " lawreros\n", - " rlawre18@jhu.edu\n", - " \n", - " safe-zone\n", - " ross-lawrence.jpg\n", - " 9\n", + " 3.0\n", " \n", " \n", "\n", - "

85 rows × 20 columns

\n", "" ], "text/plain": [ - " type alias author usera \\\n", - "0 incollection jovo Joshua Vogelstein Director \n", - "1 incollection cep Carey Priebe Professor \n", - "2 incollection jongshin Jong Shin Software Engineer \n", - "3 incollection tylertomita Tyler Tomita Postdoctoral Fellow \n", - "4 incollection jhow Javier Josue How Postdoctoral Fellow \n", - ".. ... ... ... ... \n", - "80 incollection ivankuznetsov Ivan Kuznetsov \n", - "81 incollection leoduan Leo Duan Post-doctoral Fellow \n", - "82 incollection gregkiar Greg Kiar MSE advisee \n", - "83 incollection guillermo_sapiro Guillermo Sapiro \n", - "84 incollection rosslawrence Ross Lawrence MS advisee \n", - "\n", - " userw month year number series \\\n", - "0 Chief Unity Ninja -- \n", - "1 -- \n", - "2 Tech Support 9 2020 09/20 -- \n", - "3 8 2014 08/14 -- \n", - "4 11 2020 11/20 -- \n", - ".. ... ... ... ... ... \n", - "80 2 2015 02/15 -- 05/16 2016 \n", - "81 5 2016 05/16 -- 06/17 2017 \n", - "82 8 2014 08/14 -- 06/17 2017 \n", - "83 \n", - "84 MIA 7 2019 07/19 -- 04/22 2022 \n", - "\n", - " abstract userb \\\n", - "0 \n", - "1 \n", - "2 Currently investigating the effect of inductiv... MS \n", - "3 Developed Sparse Projection Oblique Randomer F... MSE \n", - "4 Javier studies how larval zebrafish learn how ... Ph.D. \n", - ".. ... ... \n", - "80 Currently an MD, PhD Candidate at the UPenn, w... BSE \n", - "81 Went on to do a second postdoc with Leo Dunson... Ph.D. \n", - "82 Developer of m2g, the only existing \"soup to n... BSE \n", - "83 \n", - "84 Lead m2g developer, maintainer of neuroparc, M... BSE \n", + " type alias author usera \\\n", + "0 incollection jovo Vogelstein, Joshua Director \n", + "1 incollection cep Priebe, Carey Professor \n", + "2 incollection jongshin Shin, Jong Software Engineer \n", + "3 incollection tylertomita Tomita, Tyler Postdoctoral Fellow \n", + "4 incollection jhow How, Javier J. Postdoctoral Fellow \n", "\n", - " userc userd keywords doi \\\n", - "0 BME, JHU director director jovo \n", - "1 AMS, JHU faculty director \n", - "2 BME, JHU staff staffresearch jshinm \n", - "3 BME, JHU postdoc postdoc ttomita \n", - "4 Neurosciences, UCSD postdoc postdoc javierhow \n", - ".. ... ... ... ... \n", - "80 BME, JHU undergrad undergrad \n", - "81 CIS, JHU postdoc postdoc \n", - "82 BME, JHU student MSstudent gkiar \n", - "83 other other \n", - "84 BME, JHU student MSstudent lawreros \n", + " userw month year number series \\\n", + "0 Chief Unity Ninja – \n", + "1 – \n", + "2 Chief Digital Officer 9 2020 09/20 – \n", + "3 8 2014 08/14 – \n", + "4 11 2020 11/20 – \n", "\n", - " note url usere \\\n", - "0 jovo@jhu.edu neurodata.io/about/jovo safe-zone \n", - "1 cep@jhu.edu \n", - "2 jshin69@jhu.edu safe-zone \n", - "3 ttomita2@jhmi.edu \n", - "4 jhow@jhu.edu safe-zone \n", - ".. ... ... ... \n", - "80 \n", - "81 \n", - "82 gkiar.github.com \n", - "83 guillermo.sapiro@gmail.com \n", - "84 rlawre18@jhu.edu safe-zone \n", + " abstract userb \\\n", + "0 \n", + "1 \n", + "2 Currently investigating the effect of inductiv... MS \n", + "3 Developed Sparse Projection Oblique Randomer F... MSE \n", + "4 Javier studies how larval zebrafish learn how ... Ph.D. \n", "\n", - " file priority \n", - "0 vogelstein_joshua.jpg 0 \n", - "1 priebe_carey.jpg 1 \n", - "2 jong_shin.png 2 \n", - "3 tomita_tyler.jpg 3 \n", - "4 javier_how.jpg 3 \n", - ".. ... ... \n", - "80 9 \n", - "81 duan-leo.jpg 9 \n", - "82 kiar_greg.jpg 9 \n", - "83 guillermo_sapiro.jpg 9 \n", - "84 ross-lawrence.jpg 9 \n", + " userc userd keywords doi note \\\n", + "0 BME, JHU director director jovo jovo@jhu.edu \n", + "1 AMS, JHU faculty director cep@jhu.edu \n", + "2 BME, JHU staff staffresearch jshinm jshin69@jhu.edu \n", + "3 BME, JHU postdoc postdoc ttomita ttomita2@jhmi.edu \n", + "4 Neurosciences, UCSD postdoc postdoc javierhow jhow@jhu.edu \n", "\n", - "[85 rows x 20 columns]" + " url usere file priority \n", + "0 neurodata.io/about/jovo/ safe-zone vogelstein_joshua.jpg 0.0 \n", + "1 priebe_carey.jpg 1.0 \n", + "2 safe-zone jong_shin.png 2.0 \n", + "3 tomita_tyler.jpg 3.0 \n", + "4 safe-zone javier_how.jpg 3.0 " ] }, "execution_count": 9, @@ -883,7 +726,7 @@ } ], "source": [ - "pdr.df.reset_index(drop=True)" + "pdr.df.reset_index(drop=True).head(5)" ] }, { @@ -905,7 +748,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3.8.13 ('pdr')", + "display_name": "Python 3.9.15 ('pandarize')", "language": "python", "name": "python3" }, @@ -919,12 +762,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.9.15" }, "orig_nbformat": 4, "vscode": { "interpreter": { - "hash": "ec3ba36b413de325dd38d751e7a8a6eca65f333d1619da92dd7e369649a08d52" + "hash": "dad1adfa8d136b42bc671de9edd435b00b948a75d2c3d60fa318daadbc489ee6" } } }, diff --git a/examples/ndd_pubs_update.ipynb b/examples/ndd_pubs_update.ipynb index e3e6c83..a006991 100644 --- a/examples/ndd_pubs_update.ipynb +++ b/examples/ndd_pubs_update.ipynb @@ -16,7 +16,7 @@ { "data": { "text/plain": [ - "'0.0.6'" + "'0.0.7'" ] }, "execution_count": 1, @@ -106,102 +106,30 @@ " month\n", " address\n", " ...\n", - " elocation-id\n", + " adsnote\n", " urldate\n", " tag\n", " howpublished\n", - " note\n", - " day\n", " annotation\n", " acmid\n", " articleno\n", " issue_date\n", + " note\n", + " day\n", " \n", " \n", " \n", - " \n", - " 227\n", - " article\n", - " simhal2017probabilistic\n", - " Probabilistic fluorescence-based synapse detec...\n", - " Simhal, Anish K. and Aguerrebere, Cecilia and ...\n", - " 4=highlight\n", - " 2017\n", - " peer-reviewed\n", - " https://doi.org/10.1371/journal.pcbi.1005493\n", - " NaN\n", - " NaN\n", - " ...\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " \n", - " \n", - " 290\n", - " article\n", - " CloudReg\n", - " CloudReg: automatic terabyte-scale cross-modal...\n", - " Chandrashekhar, Vikram and Tward, Daniel J and...\n", - " 1=trainee,12=highlight\n", - " 2021\n", - " tech\n", - " https://doi.org/10.1038/s41592-021-01218-z\n", - " 7\n", - " NaN\n", - " ...\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " \n", " \n", "\n", - "

2 rows × 51 columns

\n", + "

0 rows × 51 columns

\n", "" ], "text/plain": [ - " type alias \\\n", - "227 article simhal2017probabilistic \n", - "290 article CloudReg \n", - "\n", - " title \\\n", - "227 Probabilistic fluorescence-based synapse detec... \n", - "290 CloudReg: automatic terabyte-scale cross-modal... \n", - "\n", - " author \\\n", - "227 Simhal, Anish K. and Aguerrebere, Cecilia and ... \n", - "290 Chandrashekhar, Vikram and Tward, Daniel J and... \n", - "\n", - " author+an year keywords \\\n", - "227 4=highlight 2017 peer-reviewed \n", - "290 1=trainee,12=highlight 2021 tech \n", + "Empty DataFrame\n", + "Columns: [type, alias, title, author, author+an, year, keywords, url, month, address, journal, pages, volume, number, booktitle, doi, isbn, abstract, organization, publisher, issn, pmid, numpages, location, series, eprint, archiveprefix, arxivid, editor, chapter, annote, archivePrefix, primaryClass, primaryclass, eprinttype, copyright, URL, elocation-id, shorttitle, eid, adsurl, adsnote, urldate, tag, howpublished, annotation, acmid, articleno, issue_date, note, day]\n", + "Index: []\n", "\n", - " url month address ... \\\n", - "227 https://doi.org/10.1371/journal.pcbi.1005493 NaN NaN ... \n", - "290 https://doi.org/10.1038/s41592-021-01218-z 7 NaN ... \n", - "\n", - " elocation-id urldate tag howpublished note day annotation acmid \\\n", - "227 NaN NaN NaN NaN NaN NaN NaN NaN \n", - "290 NaN NaN NaN NaN NaN NaN NaN NaN \n", - "\n", - " articleno issue_date \n", - "227 NaN NaN \n", - "290 NaN NaN \n", - "\n", - "[2 rows x 51 columns]" + "[0 rows x 51 columns]" ] }, "execution_count": 5, @@ -226,7 +154,7 @@ "metadata": {}, "outputs": [], "source": [ - "pdr.df = pd.read_excel(ufilepath, dtype=object, na_filter=False)" + "# pdr.df = pd.read_excel(ufilepath, dtype=object, na_filter=False)" ] }, { @@ -266,16 +194,16 @@ " month\n", " address\n", " ...\n", - " elocation-id\n", + " adsnote\n", " urldate\n", " tag\n", " howpublished\n", - " note\n", - " day\n", " annotation\n", " acmid\n", " articleno\n", " issue_date\n", + " note\n", + " day\n", " \n", " \n", " \n", @@ -292,112 +220,112 @@ " 6\n", " OHBM, Rome Italy\n", " ...\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", " 1\n", " inproceedings\n", - " hayden_naisys_2020\n", - " A Biological Implementation of Lifelong Learni...\n", - " Vogelstein, Joshua T. and Helm, Hayden and Ped...\n", - " 2=trainee;3=trainee;4=trainee;1=highlight\n", - " 2020\n", + " Allen2015synaptome\n", + " The Open Synaptome Project: Toward a Microscop...\n", + " Smith, Stephen J. and Burns, Randal and Chevil...\n", + " 8=highlight\n", + " 2015\n", " abspos\n", - " \n", - " 11\n", - " NAIsys, Cold Spring Harbor, NY, USA\n", + " https://figshare.com/articles/Open_Synaptome_P...\n", + " 10\n", + " Society for Neuroscience, Chicago, IL, USA\n", " ...\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", " 2\n", " inproceedings\n", - " berlin_2017\n", - " Processing and Analyzing Terascale Conjugate A...\n", - " Baden, Alex and Perlman, Eric and Collman, For...\n", - " 1=trainee;5=highlight\n", - " 2017\n", + " XBrain2015\n", + " X-Brain: Quantifying Mesoscale Neuroanatomy Us...\n", + " Deyer, Eva L. and Fernandes, Hugo L. and Ronca...\n", + " 5=highlight;3=trainee\n", + " 2015\n", " abspos\n", - " https://neurodata.io/talks/berlin_2017.pdf\n", - " \n", - " Berlin, Germany\n", + " https://figshare.com/articles/X_Brain_Quantify...\n", + " NaN\n", + " Figshare\n", " ...\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", " 3\n", " inproceedings\n", - " falk_open_data2019\n", - " NeuroData's Open Data Cloud Ecosystem\n", - " Falk, Benjamin and Vogelstein, Joshua T.\n", - " 2=highlight\n", - " 2019\n", + " Design2015\n", + " Optimal Design for Discovery Science: Applicat...\n", + " Wang, Shangsi and Yang, Zhi and Zuo, Xi-Nian a...\n", + " 1=trainee;7=highlight\n", + " 2015\n", " abspos\n", - " https://neurodata.io/talks/25_NeuroDatas_Open_...\n", - " 7\n", - " Harvard University, Cambridge, MA, USA\n", + " https://figshare.com/articles/Optimal_Design_f...\n", + " NaN\n", + " Figshare\n", " ...\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", " 4\n", " inproceedings\n", - " browneposter2019\n", - " Forest Packing: Fast Parallel Decision Forests\n", - " Browne, James and Mhembere, Disa and Tomita, T...\n", - " 1=trainee;2=trainee;3=trainee;4=highlight\n", - " 2019\n", + " Sparse2015\n", + " A Sparse High Dimensional State-Space Model wi...\n", + " Chen, Shaojie and Liu, Kai and Yuguang, Yang a...\n", + " 1=trainee;7=highlight\n", + " 2015\n", " abspos\n", - " https://figshare.com/articles/Forest_Packing_F...\n", - " 5\n", - " SIAM International Conference on Data Mining, ...\n", + " https://figshare.com/articles/A_Sparse_High_Di...\n", + " NaN\n", + " Figshare\n", " ...\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", "\n", @@ -407,52 +335,52 @@ "text/plain": [ " type alias \\\n", "0 inproceedings j12019 \n", - "1 inproceedings hayden_naisys_2020 \n", - "2 inproceedings berlin_2017 \n", - "3 inproceedings falk_open_data2019 \n", - "4 inproceedings browneposter2019 \n", + "1 inproceedings Allen2015synaptome \n", + "2 inproceedings XBrain2015 \n", + "3 inproceedings Design2015 \n", + "4 inproceedings Sparse2015 \n", "\n", " title \\\n", "0 Clustering Multi-Modal Connectomes \n", - "1 A Biological Implementation of Lifelong Learni... \n", - "2 Processing and Analyzing Terascale Conjugate A... \n", - "3 NeuroData's Open Data Cloud Ecosystem \n", - "4 Forest Packing: Fast Parallel Decision Forests \n", + "1 The Open Synaptome Project: Toward a Microscop... \n", + "2 X-Brain: Quantifying Mesoscale Neuroanatomy Us... \n", + "3 Optimal Design for Discovery Science: Applicat... \n", + "4 A Sparse High Dimensional State-Space Model wi... \n", "\n", " author \\\n", "0 Chung, Jaewon and Pedigo, Benjamin D. and Prie... \n", - "1 Vogelstein, Joshua T. and Helm, Hayden and Ped... \n", - "2 Baden, Alex and Perlman, Eric and Collman, For... \n", - "3 Falk, Benjamin and Vogelstein, Joshua T. \n", - "4 Browne, James and Mhembere, Disa and Tomita, T... \n", + "1 Smith, Stephen J. and Burns, Randal and Chevil... \n", + "2 Deyer, Eva L. and Fernandes, Hugo L. and Ronca... \n", + "3 Wang, Shangsi and Yang, Zhi and Zuo, Xi-Nian a... \n", + "4 Chen, Shaojie and Liu, Kai and Yuguang, Yang a... \n", "\n", - " author+an year keywords \\\n", - "0 1=trainee;2=trainee;4=highlight 2019 abspos \n", - "1 2=trainee;3=trainee;4=trainee;1=highlight 2020 abspos \n", - "2 1=trainee;5=highlight 2017 abspos \n", - "3 2=highlight 2019 abspos \n", - "4 1=trainee;2=trainee;3=trainee;4=highlight 2019 abspos \n", + " author+an year keywords \\\n", + "0 1=trainee;2=trainee;4=highlight 2019 abspos \n", + "1 8=highlight 2015 abspos \n", + "2 5=highlight;3=trainee 2015 abspos \n", + "3 1=trainee;7=highlight 2015 abspos \n", + "4 1=trainee;7=highlight 2015 abspos \n", "\n", " url month \\\n", "0 https://figshare.com/articles/Clustering_Multi... 6 \n", - "1 11 \n", - "2 https://neurodata.io/talks/berlin_2017.pdf \n", - "3 https://neurodata.io/talks/25_NeuroDatas_Open_... 7 \n", - "4 https://figshare.com/articles/Forest_Packing_F... 5 \n", + "1 https://figshare.com/articles/Open_Synaptome_P... 10 \n", + "2 https://figshare.com/articles/X_Brain_Quantify... NaN \n", + "3 https://figshare.com/articles/Optimal_Design_f... NaN \n", + "4 https://figshare.com/articles/A_Sparse_High_Di... NaN \n", "\n", - " address ... elocation-id \\\n", - "0 OHBM, Rome Italy ... \n", - "1 NAIsys, Cold Spring Harbor, NY, USA ... \n", - "2 Berlin, Germany ... \n", - "3 Harvard University, Cambridge, MA, USA ... \n", - "4 SIAM International Conference on Data Mining, ... ... \n", + " address ... adsnote urldate tag \\\n", + "0 OHBM, Rome Italy ... NaN NaN NaN \n", + "1 Society for Neuroscience, Chicago, IL, USA ... NaN NaN NaN \n", + "2 Figshare ... NaN NaN NaN \n", + "3 Figshare ... NaN NaN NaN \n", + "4 Figshare ... NaN NaN NaN \n", "\n", - " urldate tag howpublished note day annotation acmid articleno issue_date \n", - "0 \n", - "1 \n", - "2 \n", - "3 \n", - "4 \n", + " howpublished annotation acmid articleno issue_date note day \n", + "0 NaN NaN NaN NaN NaN NaN NaN \n", + "1 NaN NaN NaN NaN NaN NaN NaN \n", + "2 NaN NaN NaN NaN NaN NaN NaN \n", + "3 NaN NaN NaN NaN NaN NaN NaN \n", + "4 NaN NaN NaN NaN NaN NaN NaN \n", "\n", "[5 rows x 51 columns]" ] @@ -513,16 +441,16 @@ " month\n", " address\n", " ...\n", - " elocation-id\n", + " adsnote\n", " urldate\n", " tag\n", " howpublished\n", - " note\n", - " day\n", " annotation\n", " acmid\n", " articleno\n", " issue_date\n", + " note\n", + " day\n", " \n", " \n", " \n", @@ -539,112 +467,112 @@ " 6\n", " OHBM, Rome Italy\n", " ...\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", " 1\n", " inproceedings\n", - " Allen2015synaptome\n", - " The Open Synaptome Project: Toward a Microscop...\n", - " Smith, Stephen J. and Burns, Randal and Chevil...\n", - " 8=highlight\n", - " 2015\n", + " ThomasNeuro2020\n", + " Automated Neuron Tracing of Sparse Fluorescent...\n", + " Athey, Thomas L and Sulam, Jeremias and Vogels...\n", + " 3=highlight; 1=trainee\n", + " 2020\n", " abspos\n", - " https://figshare.com/articles/Open_Synaptome_P...\n", - " 10\n", - " Society for Neuroscience, Chicago, IL, USA\n", + " NaN\n", + " 11\n", + " Neuromatch 3\n", " ...\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", " 2\n", " inproceedings\n", - " XBrain2015\n", - " X-Brain: Quantifying Mesoscale Neuroanatomy Us...\n", - " Deyer, Eva L. and Fernandes, Hugo L. and Ronca...\n", - " 5=highlight;3=trainee\n", - " 2015\n", + " hayden_naisys_2020\n", + " A Biological Implementation of Lifelong Learni...\n", + " Vogelstein, Joshua T. and Helm, Hayden and Ped...\n", + " 2=trainee;3=trainee;4=trainee;1=highlight\n", + " 2020\n", " abspos\n", - " https://figshare.com/articles/X_Brain_Quantify...\n", - " \n", - " Figshare\n", + " NaN\n", + " 11\n", + " NAIsys, Cold Spring Harbor, NY, USA\n", " ...\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", " 3\n", " inproceedings\n", - " Design2015\n", - " Optimal Design for Discovery Science: Applicat...\n", - " Wang, Shangsi and Yang, Zhi and Zuo, Xi-Nian a...\n", - " 1=trainee;7=highlight\n", - " 2015\n", + " berlin_2017\n", + " Processing and Analyzing Terascale Conjugate A...\n", + " Baden, Alex and Perlman, Eric and Collman, For...\n", + " 1=trainee;5=highlight\n", + " 2017\n", " abspos\n", - " https://figshare.com/articles/Optimal_Design_f...\n", - " \n", - " Figshare\n", + " https://neurodata.io/talks/berlin_2017.pdf\n", + " NaN\n", + " Berlin, Germany\n", " ...\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", " 4\n", " inproceedings\n", - " Sparse2015\n", - " A Sparse High Dimensional State-Space Model wi...\n", - " Chen, Shaojie and Liu, Kai and Yuguang, Yang a...\n", - " 1=trainee;7=highlight\n", - " 2015\n", + " falk_open_data2019\n", + " NeuroData's Open Data Cloud Ecosystem\n", + " Falk, Benjamin and Vogelstein, Joshua T.\n", + " 2=highlight\n", + " 2019\n", " abspos\n", - " https://figshare.com/articles/A_Sparse_High_Di...\n", - " \n", - " Figshare\n", + " https://neurodata.io/talks/25_NeuroDatas_Open_...\n", + " 7\n", + " Harvard University, Cambridge, MA, USA\n", " ...\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", "\n", @@ -654,52 +582,52 @@ "text/plain": [ " type alias \\\n", "0 inproceedings j12019 \n", - "1 inproceedings Allen2015synaptome \n", - "2 inproceedings XBrain2015 \n", - "3 inproceedings Design2015 \n", - "4 inproceedings Sparse2015 \n", + "1 inproceedings ThomasNeuro2020 \n", + "2 inproceedings hayden_naisys_2020 \n", + "3 inproceedings berlin_2017 \n", + "4 inproceedings falk_open_data2019 \n", "\n", " title \\\n", "0 Clustering Multi-Modal Connectomes \n", - "1 The Open Synaptome Project: Toward a Microscop... \n", - "2 X-Brain: Quantifying Mesoscale Neuroanatomy Us... \n", - "3 Optimal Design for Discovery Science: Applicat... \n", - "4 A Sparse High Dimensional State-Space Model wi... \n", + "1 Automated Neuron Tracing of Sparse Fluorescent... \n", + "2 A Biological Implementation of Lifelong Learni... \n", + "3 Processing and Analyzing Terascale Conjugate A... \n", + "4 NeuroData's Open Data Cloud Ecosystem \n", "\n", " author \\\n", "0 Chung, Jaewon and Pedigo, Benjamin D. and Prie... \n", - "1 Smith, Stephen J. and Burns, Randal and Chevil... \n", - "2 Deyer, Eva L. and Fernandes, Hugo L. and Ronca... \n", - "3 Wang, Shangsi and Yang, Zhi and Zuo, Xi-Nian a... \n", - "4 Chen, Shaojie and Liu, Kai and Yuguang, Yang a... \n", + "1 Athey, Thomas L and Sulam, Jeremias and Vogels... \n", + "2 Vogelstein, Joshua T. and Helm, Hayden and Ped... \n", + "3 Baden, Alex and Perlman, Eric and Collman, For... \n", + "4 Falk, Benjamin and Vogelstein, Joshua T. \n", "\n", - " author+an year keywords \\\n", - "0 1=trainee;2=trainee;4=highlight 2019 abspos \n", - "1 8=highlight 2015 abspos \n", - "2 5=highlight;3=trainee 2015 abspos \n", - "3 1=trainee;7=highlight 2015 abspos \n", - "4 1=trainee;7=highlight 2015 abspos \n", + " author+an year keywords \\\n", + "0 1=trainee;2=trainee;4=highlight 2019 abspos \n", + "1 3=highlight; 1=trainee 2020 abspos \n", + "2 2=trainee;3=trainee;4=trainee;1=highlight 2020 abspos \n", + "3 1=trainee;5=highlight 2017 abspos \n", + "4 2=highlight 2019 abspos \n", "\n", " url month \\\n", "0 https://figshare.com/articles/Clustering_Multi... 6 \n", - "1 https://figshare.com/articles/Open_Synaptome_P... 10 \n", - "2 https://figshare.com/articles/X_Brain_Quantify... \n", - "3 https://figshare.com/articles/Optimal_Design_f... \n", - "4 https://figshare.com/articles/A_Sparse_High_Di... \n", + "1 NaN 11 \n", + "2 NaN 11 \n", + "3 https://neurodata.io/talks/berlin_2017.pdf NaN \n", + "4 https://neurodata.io/talks/25_NeuroDatas_Open_... 7 \n", "\n", - " address ... elocation-id urldate tag \\\n", - "0 OHBM, Rome Italy ... \n", - "1 Society for Neuroscience, Chicago, IL, USA ... \n", - "2 Figshare ... \n", - "3 Figshare ... \n", - "4 Figshare ... \n", + " address ... adsnote urldate tag \\\n", + "0 OHBM, Rome Italy ... NaN NaN NaN \n", + "1 Neuromatch 3 ... NaN NaN NaN \n", + "2 NAIsys, Cold Spring Harbor, NY, USA ... NaN NaN NaN \n", + "3 Berlin, Germany ... NaN NaN NaN \n", + "4 Harvard University, Cambridge, MA, USA ... NaN NaN NaN \n", "\n", - " howpublished note day annotation acmid articleno issue_date \n", - "0 \n", - "1 \n", - "2 \n", - "3 \n", - "4 \n", + " howpublished annotation acmid articleno issue_date note day \n", + "0 NaN NaN NaN NaN NaN NaN NaN \n", + "1 NaN NaN NaN NaN NaN NaN NaN \n", + "2 NaN NaN NaN NaN NaN NaN NaN \n", + "3 NaN NaN NaN NaN NaN NaN NaN \n", + "4 NaN NaN NaN NaN NaN NaN NaN \n", "\n", "[5 rows x 51 columns]" ] diff --git a/pandarize/__init__.py b/pandarize/__init__.py index d85b28e..7d53ea3 100644 --- a/pandarize/__init__.py +++ b/pandarize/__init__.py @@ -1 +1 @@ -__version__ = "0.0.6" \ No newline at end of file +__version__ = "0.0.7" \ No newline at end of file diff --git a/pandarize/_util.py b/pandarize/_util.py index 0e26a18..fa83f29 100644 --- a/pandarize/_util.py +++ b/pandarize/_util.py @@ -44,18 +44,46 @@ def rfindall(string, pattern): return indexes -def bib_parser(raw): +def rfindall_matched(string, pattern, key): + '''Find all indices of the match pattern w.r.t to the key value + + E.g., the function returns [5] when attempts to find + pattern ({abc}) in the string '123{abc}def' w.r.t. the key (b) + + Args: + ----- + string : string; string to be searched + pattern : regex; regex pattern to be searched in string + key : string; a character from the string + + Returns: + out : list; returns a list of integers for each index + ''' + match_index = [] + for match in re.finditer(pattern, string): + match_index.append(match.start() + match.group().rfind(key)) + return match_index + +def bib_preprocessing(raw): + '''Pre-processes raw bib file''' + + raw = raw.replace('\n', '').replace('\r', '') #remove linebreaks and linefeed + raw = re.sub(' +', ' ', raw) #contract whitespace + + return raw + +def bib_parser(raw, idxkey): '''Main bib parsing logic''' all_lst = [] lst = [] start = None standby = None - raw = raw.replace('\n', '').replace('\r', '') #remove linebreaks and linefeed - raw = re.sub(' +', ' ', raw) #contract whitespace - for i, c in enumerate(raw): if c == '@': + if not i in idxkey: #skip if not true start + continue + if lst: # fixes cases when extra comma is added to the last key:value item fix = raw[curr_idx:last_pair-2] + raw[last_pair-2:last_pair+1].replace(',', '') @@ -111,12 +139,14 @@ def _itemize_bib(lst): dic['type'] = s[ii:jj].replace('@', '') dic['alias'] = s[jj:kk].replace('{', '') else: - ii = sorted(rfindall(s, '='))[0] - if s[-1] == ',': - s = s[:-1] - out = LatexNodes2Text().latex_to_text(s[ii+1:]).strip() - dic[s[:ii].strip()] = out - + if s: + # print(s, sorted(rfindall(s, '='))) + ii = sorted(rfindall(s, '='))[0] + if s[-1] == ',': + s = s[:-1] + out = LatexNodes2Text().latex_to_text(s[ii+1:]).strip() + dic[s[:ii].strip()] = out + for i in lst: new_lst.append(LatexNodes2Text().latex_to_text(i)) @@ -276,7 +306,7 @@ def parse(row, types=types, alias=alias): for i in items: out_text += i out_text = out_text[:-2] #remove last comma - out_text += '\n}\n' + out_text += '\n},\n' return out_text @@ -286,7 +316,10 @@ def parse(row, types=types, alias=alias): out = stamper(target='bib') for i in range(N): - out += parse(df.iloc[i,:]) + '\n' + if i == N-1: #remove the very last comma + out += parse(df.iloc[i,:])[:-3] + parse(df.iloc[i,:])[-3:].replace(',', '') + '\n' + else: + out += parse(df.iloc[i,:]) + '\n' if not os.path.exists(path=dirs): os.mkdir(path=dirs) diff --git a/pandarize/frame.py b/pandarize/frame.py index 106aa1a..cfa42e8 100644 --- a/pandarize/frame.py +++ b/pandarize/frame.py @@ -5,17 +5,20 @@ class Pandarizer: def __init__(self): self.raw = None self.df = None + self.idxkey = None def load(self, source=None, savefile=None): '''Loads raw data from either local file or the url ''' self.raw = source_loader(source=source, savefile=savefile) + self.raw = bib_preprocessing(raw=self.raw) + self.idxkey = rfindall_matched(self.raw, r'[.*]?@[^}]*{*[,]', '@') def fit(self, kind='bib'): '''Method that infers data structure (in the future) ''' if kind == 'bib': - self.df = bib_parser(raw=self.raw) + self.df = bib_parser(raw=self.raw, idxkey=self.idxkey) def transform(self, formats='bib', types=None, alias=None, dirs=None): '''Transform loaded data into a specified data type