You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When it comes to writing unit tests that return a DataFrame or a TimeSeries there's a clear need to compare the output to the expected result. The comparison can be strict, or relaxed in terms of the order of columns and/or order of rows, and could also be forgiving for floats.
@rs2 Just the same as you otherwise build a small dataframe, eg pd.DataFrame(..) with eg a dictionary.
If you want to ahve something visual like the above, you can always pass such a string to read_csv or read_fwf
See also #9895 for proposal to make the testing functions more 'officially' public
When it comes to writing unit tests that return a
DataFrame
or aTimeSeries
there's a clear need to compare the output to the expected result. The comparison can be strict, or relaxed in terms of the order of columns and/or order of rows, and could also be forgiving for floats.I'm thinking of an approach implemented in https://pythonhosted.org/toytable/toytable.table.html#table-literals, i.e. defining a table as
and subsequently invoking
self.assertTableEqual
orself.assertTableContentsEqual
.Does anything similar exist in pandas (I could not find), and can the above approach be upvoted please?
The text was updated successfully, but these errors were encountered: