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

UnboundLocalError: local variable 'array' referenced before assignment #2

Open
qiriro opened this issue Apr 15, 2023 · 1 comment
Open

Comments

@qiriro
Copy link

qiriro commented Apr 15, 2023

@BorjaRei @manwestc , great library you've created! It's so helpful, and I have recently been exploring how to create something similar myself. I'm glad you created it before I did.

I found a small bug that needs fixing. In the model.py the following code generates UnboundLocalError: local variable 'array' referenced before assignment

# Read the CSV
       if type(data)==str:
           dataset = pd.read_csv(data)
           array = dataset.values
       elif type(data)==pd:
           array = data.values

The elif statement in this code is incorrect. Here's a corrected version:

 # Read the CSV
        if type(data)==str:
            dataset = pd.read_csv(data)
            array = dataset.values
        elif isinstance(data, pd.DataFrame):
            array = data.values
@BorjaRei
Copy link
Collaborator

You are totally right. This isn't the final version, we will be fixing bugs and adding functionalities in the next weeks.
Thank you!

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

No branches or pull requests

2 participants