I have a data frame with column names
** RI Na Mg Al Si K Ca Ba Fe Type **
Type column is categorical and consists of 4 types. How to extract only RI, Al, Si, Ba columns whose type is 2 using dictionary?
I have tried using the below code:
pd.DataFrame.from_dict(data=df[df['Type']==2], orient='index',columns=['RI','Al','Si','Ba'])
I am getting an error:
'numpy.ndarray' object is not callable
How do I select only specific columns of type 2?