2
I am with DF after some calculations, but I am not able to pass the data to an account, every time gives this error:
The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Code:
#biblilotecas
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_excel('Semana.xlsx') #leitura do excel
df1 = pd.read_excel('Semana1.xlsx') #leitura do excel
df2 = pd.read_excel('Semana2.xlsx') #leitura do excel
df3 = pd.read_excel('Semana3.xlsx') #leitura do excel
df = df + df1 + df2 + df3
df = df.T #girando tabela
df = df.drop(['Dia'], axis=0)
df = df.T #girando tabela
df = df // 4
df.columns = ['1', '2' ,'3','4','5','6','7']
Parte da conta:
Lamb = ' aqui tem que recebe o valor de cada posiçao '
u = 7
Caixas = 22
for lamb in lamb:
while(lamb/(Caixas*u) >= 0.9):
Caixas += 1
while(lamb/(Caixas*u) <= 0.5):
Caixas -= 1
else:
print('Resultados')
F = lamb/(Caixas*u)
F = F * 100
print('==========')
print(lamb, '/', Caixas,'*',u)
print('Numero de caixas recomendável e:',Caixas)
print('Caixas ficam ocupados' ,"%.0f" % F , "%")
can you give an example of how this data is? they have header? are of the same type?
– Giovana Morais
What is
lamb
?lamb
andLamb
are the same thing or are different variables?– Jorge Mendes
Cara has a lot wrong with your code, I recommend you go back a little and study repetition structure, conditionals, data structure and so of the continuation of this project
– Tmilitino
the Amb are repeated because it was trying another way that did not work.. Lamb = the values of DF u = 7 Boxes = 22 while(Lamb/(Boxesu) >= 0.9): print("addition of boxes") Boxes += 1 print(Boxes) Else: print("Reduction of boxes") while(Lamb/(Boxesu) <= 0.5): Boxes -= 1 print(Boxes) Else: print('Results') F = Lamb/(Boxesu) F = F * 100 print('==========') print(Lamb, '/', Boxes,'',u) print('Recommended box number and:'Boxes) print('Boxes get busy' ,"%.0f" %F , "%")
– Weslley S.S.
I want all DF data to pass through the account, then account ira returns a value and this value will be in DF
– Weslley S.S.