Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datahub.berkeley.edu notebooks suddenly produce an error message on any use of .hist. #5115

Closed
Montereytony opened this issue Oct 7, 2023 · 2 comments
Assignees
Labels

Comments

@Montereytony
Copy link

Bug description

This code worked fine a few days ago. Prof suspects it’s due to a library version change or similar. Need a fix for UGBA88 students’ lab work.

Environment & setup

  • Hub: Datahub
  • Language: Python

How to reproduce

Import some useful functions

from numpy import *
from numpy.random import *
from datascience import *
from statsmodels.formula.api import *

Define some useful functions

def correlation (array_1, array_2):
return corrcoef(array_1, array_2) •item(1)

Customize Look of graphics

import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
plt.rcParams['figure.dpi' ] = 60
%matplotlib inline

Force display of all values

from IPython.core. interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"

Handle some obnoxious warning messages

import warnings
warnings. filterwarnings ("ignore")

data.hist('AMOUNT', normed=False, bins=10, range=make_array(0,100))

#Error message attached.

ugab88error

@ryanlovett
Copy link
Collaborator

Thanks @Montereytony for filing the issue.

Do you have the full path to a notebook in your or Richard's home directory where the problem is evident? In the sample code you provided, data is not defined.

Apparently numpy.int was deprecated in numpy 1.20.0 and removed in 1.24.0. We pin numpy to 1.21.*, however CI upgrades numpy to 1.25.2 when it reads requirements.txt.

I don't see any relevant recent commit that might have triggered this:
https://github.com/berkeley-dsep-infra/datahub/commits/staging/deployments/datahub/images/default

One potential workaround is to try running numpy.int = numpy.int_ before the call in question.

Long term I think the image building needs to read in requirements.txt at the same time as it reads environment.yml.

@ryanlovett
Copy link
Collaborator

The instructor confirmed that inserting numpy.int = numpy.int_ before the call to .hist() is an adequate workaround. He will notify students to have them modify their notebooks.

The larger issue #5117 about unexpected versions is still outstanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants