I have imported an Excel table using Pandas. The table contains four columns representing Nodes, X, Y and Z data. I used the following script:
import pandas as pd
SolidFixity = pd.read_excel('GeomData.xlsx', sheetname = 'SurfaceFixitySolid')
What I would like to do next is filter this dataframe using the filter table to select the Node of interest. I used this command:
SolidFixity.filter(like = '797', axis = 'Nodes')
This did not work and threw the following error:
ValueError: No axis named Nodes for object type
I know there is an axis named Nodes because the following command:
In[17]SolidFixity.axes
Outputs the following:
Out[17]:
[RangeIndex(start=0, stop=809, step=1),
Index(['Nodes', 'X', 'Y ', 'Z'], dtype='object')]
Nodes is right there, shimmering like the sun.
What am I doing wrong here?
SolidFixity[SolidFixity.Node.eq('797')]?SolidFixity.filter(like = '797', axis = 1) Out[29]: Empty DataFrame Columns: [] Index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, ...] [809 rows x 0 columns]which is an empty dataframe. I know node 797 is in there