I previously imported the iris data set like this: data = pd.read_csv('D:\MNIST data set\iris.data')
This problem occurred: OSError: Initializing from file failed
It may be because my file name contains Chinese characters. I found that when calling the read_csv() method of pandas, the C engine is used as the parser engine by default. When the file name contains Chinese characters, C is used. The engine will go wrong under some circumstances. Therefore, specifying engine as Python when calling the read_csv() method can solve the problem.
Solution: data = pd.read_csv('D:\MNIST data set\iris.data', engine='python' )
Reference article: /qq_35318838/article/ details/80564938