I am a newbi in Python and after upgrading to Mint 20.3 from 18.3 including installing all necessary again I get this Warning: Boolean Series key will be reindexed to match DataFrame index. I did not get the warning in the Pandas version I used in Mint 18.3
The warning is given in these two lines:
File name:Line number:UserWarning: Boolean Series key will be reindexed to match DataFrame index.
MaxDate =analysedata[data['Adj Close'] == Max]['Date']
File name:Line number:UserWarning: Boolean Series key will be reindexed to match DataFrame index.
MinDate =analysedata[data['Adj Close'] == Min]['Date']
I try to get the MinDate and MaxDate for the minimum and maximum value of the "Adj Close" row in the analyze area which is described between "analysestart" and "analyseend"
I think it is doing correct but I do not like to have the warning. Hope someone can give a hint
I did see the other question and answer but it did not help. Is it because my analysedata is shorter than data? I tried to make a new data frame analysedata2 but result is the same. If I use 'Date' instead of just Date I get syntax error.
for ferm in ferms:
stock = ferm
stockFile = ferm
data = pd.read_csv(ferm, header=0)
if os.stat(ferm).st_size > 4:
print(stockFile)
data['Date'] = pd.to_datetime(data['Date'])
data["20d"] = np.round(data["Adj Close"].rolling(window = 20, center = False).mean(), 2)
data["70d"] = np.round(data["Adj Close"].rolling(window = 70, center = False).mean(), 2)
data['plot'] = (data['Date'] > startplot) & (data['Date'] <= end)
plotdata=data[data['plot']]
plotdata
data['analyse'] = (data['Date'] > analysestart) & (data['Date'] <= analyseend)
analysedata=data[data['analyse']]
analysedata2 = analysedata.loc[data['analyse']]
analysedata2[analysedata2.Date.isnull()]
analysedata2
Max=analysedata2['Adj Close'].max()
MaxDate =analysedata2[data['Adj Close'] == Max]['Date']
Max2 = float("{0:.1f}".format(Max))
Min=analysedata2['Adj Close'].min()
MinDate =analysedata2[data['Adj Close'] == Min]['Date']