Reputation: 35
i want to know each column in pandas data frame are in ascending order or not.
**col1** **col2** **col3**
99 102 103
97 103 107
100 108 109
for col1, col2 and col3 how to find which columns are in ascending order and which columns are not.
Upvotes: 0
Views: 1290
Reputation: 1855
is_monotonic
is deprecated. Now use:
assert df["x"].is_monotonic_increasing
assert df["y"].is_monotonic_increasing
assert df["z"].is_monotonic_increasing
Upvotes: 1