Skip to content

[FAQ] #402

Description

@YashBaviskar1

Course

machine-learning-zoomcamp

Question

Why am I getting TypeError: 'list' object is not callable when creating a NumPy array?

Answer

This usually happens when np.array was accidentally overwritten by a list in an earlier Jupyter cell. Since the Jupyter kernel retains previous variable assignments, simply editing or deleting the problematic cell may not fix it.

The quickest solution is to restart the Jupyter kernel (Kernel → Restart), then run:

import numpy as np

y = np.array([1100, 1300, 800, 900, 1000, 1100, 1200])

After restarting, np.array() will point back to NumPy's original function.

Checklist

  • I have searched existing FAQs and this question is not already answered
  • The answer provides accurate, helpful information
  • I have included any relevant code examples or links

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions