Year | District | Geometry | TRUE/FALSE |
---|---|---|---|
1900 | 101 | POLYGON ((-89.26355 41.32246, -89.26171 41.322... | TRUE |
1902 | 101 | POLYGON ((-89.26355 41.33246, -89.26171 41.322... | FALSE |
I have a dataframe with a large number of columns and rows (only a sample above) and I am trying to create a new column with a conditional response, not based on values within the same row (all of the posts I have read so far seem to just refer to conditional column creation based on values in another column within the same row).
I want to compare the Geometry column, which is a GeometryArray datatype, with the same geometry column of the same district two years earlier.
Phrased as a question: Is the geometry of district 101 in 1902 the same as district 101 in 1900? TRUE/FALSE
df['geometry change from last year'] = np.where(df['geometry'].at[df.index[i]]!= climate[geometry].at[df.index[i-2]], 'True', 'False')