Comments (3)
@azachar - here's how you can compare DataFrames, ignoring the row order (see this commit):
assert_df_equality(df1, df2, transforms=[lambda df: df.sort(df.columns)])
Here's how you can compare two DataFrames, ignoring the column order:
assert_df_equality(df1, df2, transforms=[lambda df: df.select(sorted(df.columns))])
Let me know if that solves your issue, thanks!
from chispa.
Nice! Thank you @MrPowers.
Would you consider also some self speaking wrapper methods to hide that "sugar" code?
Cheers, Andrej
from chispa.
@azachar - I added additional options to assert_df_equality
:
def assert_df_equality(df1, df2, ignore_nullable=False, transforms=None, allow_nan_equality=False, ignore_column_order=False, ignore_row_order=False)
Let me know if those will work for you ;)
Thanks again for the suggestions!
from chispa.
Related Issues (20)
- Possibly set row comparison to true by default for DataFrame comparisons
- Make it easier for conda devs to setup virtual env to work on this project
- Implement all the DataFrame comparison options for approx comparisons as well HOT 1
- Adapt "ignore_nullable" parameter to handle data types within Arrays HOT 1
- Add support for NaN equality within Arrays HOT 2
- Add allow_nan_equality option to assert_approx_df_equality HOT 3
- Dataframe equality ignoring schema HOT 4
- Implement ingore_nullability for structtypes HOT 2
- SchemasNotEqualError not show more columns in one shcema HOT 1
- DataFramesNotEqualError when dataframes appear identical HOT 6
- `ignore_column_order` param for `assert_approx_df_equality` function HOT 3
- Add parameter to enable DataFramesNotEqualError to be raised without printing the differences between the two dataframes HOT 1
- Handle nested nullability HOT 3
- Flatten dataframe HOT 2
- Highlight mismatching values
- Fix the badges in the project README HOT 1
- The it_does_not_throw_with_different_schema test exposes a bug HOT 17
- pkg_resources is deprecated, prettytable produces warning HOT 1
- Reconfigure CI to run tests on pull requests
- Run tests for multiple PySpark versions in CI HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chispa.