dalejn / cleanBib

Probabilistically assign gender and race proportions of first/last authors pairs in bibliography entries
MIT License
149 stars 31 forks source link

TypeError: cannot unpack non-iterable numpy.float64 object #21

Closed rlashare closed 3 years ago

rlashare commented 3 years ago

hi there, Having trouble with Step 4. I get the following error: TypeError: cannot unpack non-iterable numpy.float64 object (also pasted below). In case it's helpful, I'm attaching the cleanedBib.csv file generated in Step 2 and updated before I ran Step 3 (which seemed to run fine though the incompleteKeys.csv and incompleteRows.csv are both empty). Not a coder but would love to be able to use this tool - thanks so much for posting it!

cleanedBib.pdf

first author is Rebecca Ashare last author is Robert Schnoll we don't count these, but check the predictions file to ensure your names did not slip through! looping through your references, predicting gender and race /srv/conda/envs/notebook/lib/python3.7/site-packages/numpy/core/fromnumeric.py:3373: RuntimeWarning: Mean of empty slice. out=out, **kwargs) /srv/conda/envs/notebook/lib/python3.7/site-packages/numpy/core/_methods.py:170: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount)

TypeError Traceback (most recent call last)

in 175 idx = idx + 1 176 --> 177 mm,wm,mw,ww = np.mean(gender,axis=0)*100 178 WW,aw,wa,aa = np.mean(race,axis=0)*100 179 TypeError: cannot unpack non-iterable numpy.float64 object
dalejn commented 3 years ago

Thanks for your interest in using our tool! I'm happy to help debug.

Could you send me the .bib file that you uploaded to generate the cleanedBib.csv file that you attached?

rlashare commented 3 years ago

Thank you! Here is the .bib file, which I downloaded from Web of Science. Best,

On Mon, Nov 23, 2020 at 1:38 PM Dale Zhou notifications@github.com wrote:

Thanks for your interest in using our tool! I'm happy to help debug.

Could you send me the .bib file that you uploaded to generate the cleanedBib.csv file that you attached?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dalejn/cleanBib/issues/21#issuecomment-732350090, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR3TUBBZ4VIS64WSS4OJC33SRKT3BANCNFSM4T7XSYPQ .

--

Rebecca Ashare, Ph.D.

Associate Professor

Center for Interdisciplinary Research on Nicotine Addiction

Senior Fellow, Center for Public Health Initiatives

Perelman School of Medicine at the University of Pennsylvania

3535 Market St, Suite 4100

Philadelphia, PA 19104

phone: (215) 746-5789

email: rlashare@pennmedicine.upenn.edu

dalejn commented 3 years ago

Thanks again for using our tool! To summarize: resolved this issue by adding instructions pointing to previous code for analyzing published papers, under Can I use this code to analyze published article(s) instead of manuscripts in progress? Sent email with the result of running the .bib file successfully through the code with the modified instructions. Will work on re-integrating this feature of analyzing published articles to the main line analysis including race predictions and probabilistic calculation of proportions.