-1
Hello, I managed a Dataframe in Pandas with the following command:
df_projects7 = pd.pivot_table(df_projects8, index=['id_prj', 'Nome do Projeto', 'criado_em'], values=['Percent_executado', 'Atualizado'], aggfunc=[np.min, np.mean])
With the following result: The columns 'Id_prj', 'Project Name' and 'created in', remained as indexes and were aggregated columns: Amin with 'Percent_executed', Amin with 'Updated' and Mean with 'Percent_executed', Mean with 'Updated'.
The df_projects7.dtypes command returns:
Amin Updated int16 Percent_executado int64 Mean Updated float64 Percent_executado float64 dtype: Object
I need to delete the columns: Amin with 'Percent_run' and Mean with 'Updated'. Because only the columns make sense in context: Amin with 'Updated' and Mean with 'Percent_executed'
Thanks in advance.
Hello, Jcrrocha. Can you share with us a sample of the data so that it is reproducible? can be very small with up to 5 or 10 lines. Read here how to create an example Minimum, Complete and Verifiable
– Terry
Thanks for the help, however I ended up skirting the problem and found a solution that served me. I made a pivot_table for Percent_performed with 'Amin' and another pivot_table for 'Updated' with the 'Mean' function and then merged the two generated dataframes. Thanks!
– JcrRocha