python-3.x - 我尝试在 jupyter 上运行代码返回错误
问题描述
--------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-18-e20bfc399896> in <module>()
----> 1 collection = pd.read_csv("https://raw.githubusercontent.com/BBKdatasciencetaster/DS/main/data/paintings.csv", index_col=0)
2 collection.head() # Returns the first five rows
NameError: name 'pd' is not defined
解决方案
在单元格的开头添加以下代码:
import pandas as pd
然后重新执行单元格。必须解决这个问题。
推荐阅读
- c - 试图了解 *ramVectorTable 如何到达 ramVectorTable[ ]
- java - 0.0.0.0 的拆分方法的工作。&& 0.0.0.0
- xamarin.android - 如何从 xamarin android native-{content://com.google.android.gm.sapi/abc@gmail.com/ 中的谷歌附件获取 pkpass
- apache - 在 .htaccess 中强制使用尾随反斜杠导致 404 错误
- c++ - reinterpret_cast 可以将无效的指针值转换为有效的值吗?
- safari - 在 Safari Intelligent Tracking Prevention 将 cookie 限制为 1 天或沙盒本地存储后,如何保留 cookie?
- java - 无法在 jar 中找到或加载主类
- python - Python 和 IF 命令中的字符串匹配
- sql - PostgreSQL - 基于列数据的减法简化查询
- windows-10 - 如何检测拦截按键事件的 Windows 钩子?