MORSECorp / snappiershot

Apache License 2.0
30 stars 2 forks source link

[BUG] Pandas dataframe snapshots are abbreviated #83

Closed IkeKap closed 2 years ago

IkeKap commented 3 years ago

Describe the bug A snapshot of a pandas dataframe is abbreviated with ... instead of showing the complete dataframe

To Reproduce Snapshot a large dataframe (my issue occurred with one 16 * 8 dataframe)

Expected behavior The snapshot to contain the entire data without any abbreviations

Screenshots

image image

Versions:

Conniemac commented 2 years ago

@IkeKap I think this is a matter of print formatting. Just to confirm is the screenshot you posted from calling print(df)? I made a similar data frame (4 rows x 10 columns). I checked the json file that was produced by storing that data frame as a snap shot and it appears all the data is stored correctly. The code calls df.to_dict() then stores the resulting dictionary in a json file.

These are screen shots from the json file that is stored by the code. Each list is a row (4 rows in the data frame) and each list is 10 long (10 columns total).

Screen Shot 2021-12-12 at 9 04 53 PM Screen Shot 2021-12-12 at 9 05 18 PM

If I call print(df) I see an abbreviated view like you posted. If I call print(df.to_string()) I see all 10 columns printed. Calling print(df):

Screen Shot 2021-12-12 at 9 04 18 PM

Calling print(df.to_string():

Screen Shot 2021-12-12 at 9 19 17 PM Screen Shot 2021-12-12 at 9 19 24 PM

Just to be sure no data is missing I changed one of the values in column 3. This is one of the columns that is abbreviated in the screenshot above.

Let me know what you think.

Conniemac commented 2 years ago

I think this is just a print formatting issue so closing this for now. Feel free to re-open if I missed something.