By "material code"
To see how much of the material has been used over a given period of time,
ex)January 1st to January 31st
Pivot raw data and
pivot_Data = pd.pivot_table (rawData, index = ['material code', 'material details', 'use date'], values = ['quantity'], agfunc = np.sum)
To use value_counts(),
I changed the index name and wrote value_counts() as shown below.
It says there are no codes in the data frame.
pivot_Data.index.names = ['codes', 'title', 'rundate']
pivot_Data.codes.value_counts()
Error history: AttributeError: 'DataFrame' object has no attribute 'codes'
There is also a way to change the column name while preprocessing the data in the CSV file Is there a way to change it while coding?
index multiindex python
In other cases, when Rename in DataFrame
df = pd.DataFrame([[ij for ij in i ]for i in rows])
df.rename(columns={0:'ID',1:'DATETIME',2:'TEMP',3:'HUMI'}, inplace=True);
df = df.sort_values(['ID'], ascending=[1]);
df.head()
I changed the name like this and used it.
914 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
581 PHP ssh2_scp_send fails to send files as intended
578 Understanding How to Configure Google API Key
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.