Simply I wanted to read the csv file that I converted from Data Frame after read the another csv file and same time I tried to remove header from in it.
Then I got the error below one :
PermissionError: [Errno 13] Permission denied: 'X_Data.csv'
My python code :
import pandas as pd
import numpy as np
df = pd.read_csv('input_doc.csv').replace(' ?', np.nan).dropna()
data_X = df.iloc[:, 1:15].values
data_Y = df.iloc[:, :1].values
clean_X = pd.DataFrame(data_X);
clean_Y = pd.DataFrame(data_Y);
clean_X.to_csv("X_Data.csv", index=False)
clean_Y.to_csv("Y_Data.csv", index=False)
X = pd.read_csv("X_Data.csv", encoding="utf-8", header=1)
Y = pd.read_csv("Y_Data.csv", encoding="utf-8", header=1)
Also I got the same error without removing header when reading.
I found several issues that similar to my problem , but those won't fix my problem.
I coded on Anaconda Spyder Editor in Windows 10.
How can I read this file without getting this error? What am I missing?
Thank you so much! Any Help would be appreciated!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…