用jupyter打开pandas文件运行不了代码,访问Excel得到的结果乱码

  1. jupyter打开pandas文件运行,数据文件与代码文件在同一各文件目录下,但是有多种报错
    name 'pd' is not defined
    SyntaxError: invalid syntax
    OSError: Initializing from file failed
    除以上之外,在pandas读取Excel文件时出现乱码

img

img

2.
Windows系统,Windows11,anaconda3下的jupyter notebook

  1. 尝试过的解决方法

import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import cross_val_score
import matplotlib.pyplot as plt
以上能在网上找到的解决办法都使用过了,但是没有解决问题

  1. 如何可以正常读取同一个文件夹目录下的文件