Reputation: 11
I'm new to Python and I'm trying to make a program that automate some daily Excel work.
I just want to copy data from a sheet to another using pandas but I got an error. Can anyone help?
import pandas as pd
File1 = pd.read_excel('FileName1.xlsx', sheet_name='Sheet1')
print(File1.columns)
print(File1['Date'][2])
File2 = pd.read_excel('FileName2.xlsx', sheet_name='Sheet2')
File1['Date'][0] = File2['Date'][0]
Here's the error:
SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame
Upvotes: 1
Views: 89