Only list-like objects are allowed to be passed to isn()

Advertisements I have a dropdown menu: dcc.Dropdown( id="select", options = list(all_df[‘Device’].unique()), value = list(all_df[‘Device’].unique()[0]) ) dcc.Graph(id = ‘shared’ , figure={} ), to enable a selection of a device (or devices) to plot later on: @app.callback( Output("shared", "figure"), Input("select", "value") ) def update_signal_chart(select): df4 = all_df[all_df[‘Device’].isin(select)] (…) and whatever I try, it’s always resulting in TypeError:… Read More Only list-like objects are allowed to be passed to isn()

How to split a tolist result in two groups (new lists)?

Advertisements I have a problem, I try many things and I can’t manage to do this. It’s a code that check if the delivery numbers are on our sales report. Here it’s the code: dfn = dfn.astype(‘str’) diff = dfn[~dfn[‘Numero de Envio’].isin(dfn[‘Unnamed: 13’])].dropna()[[‘Numero de Envio’,’Fecha’]].values.tolist() print(f"\n Hay ventas que podrían no ser nuestras: \U0001F611 -… Read More How to split a tolist result in two groups (new lists)?

Need to check all my variables for an ampersand, I put variables in a list and check using a for loop, but Python only changes value inside list

Advertisements I’ve got the following code, but unfortunately it only changes the value inside the list. Is there any way I can change the value outside the list, so it can be used later in the script? street_number = "100 & 102" street_name = "Fake Street" suburb = "Faketown" allvariables = [street_number, street_name, suburb] ampersand… Read More Need to check all my variables for an ampersand, I put variables in a list and check using a for loop, but Python only changes value inside list

rank for nan values based on group

Advertisements I have dataframe with column d1 and now i am trying calculate ‘out’ column after ranking that column when there in ‘nan’ value with in a column. data_input = {‘Name’:[‘Renault’, ‘Renault’, ‘Renault’, ‘Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’], ‘type’:[‘Duster’, ‘Duster’, ‘Duster’,’Duster’,’Duster’,’Duster’,’Duster’,’Triber’,’Triber’,’Triber’,’Triber’,’Triber’,’Triber’,’Triber’], ‘d1’:[‘nan’,’10’,’10’,’10’,’nan’,’nan’,’20’,’20’,’nan’,’nan’,’30’,’30’,’30’,’nan’]} df_input = pd.DataFrame(data_input) data_out = {‘Name’:[‘Renault’, ‘Renault’, ‘Renault’, ‘Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’,’Renault’], ‘type’:[‘Duster’, ‘Duster’, ‘Duster’,’Duster’,’Duster’,’Duster’,’Duster’,’Triber’,’Triber’,’Triber’,’Triber’,’Triber’,’Triber’,’Triber’], ‘d1’:[‘nan’,’10’,’10’,’10’,’nan’,’nan’,’20’,’20’,’nan’,’nan’,’30’,’30’,’30’,’nan’], ‘out’:[1,np.NaN,np.NaN,np.NaN,2,2,np.NaN,np.NaN,1,1,np.NaN,np.NaN,np.NaN,2]} df_out = pd.DataFrame(data_out)… Read More rank for nan values based on group