Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with the round method on SASDataFrame objects #141

Closed
pestyld opened this issue Nov 9, 2022 · 1 comment
Closed

Issues with the round method on SASDataFrame objects #141

pestyld opened this issue Nov 9, 2022 · 1 comment

Comments

@pestyld
Copy link

pestyld commented Nov 9, 2022

There seems to be an issue with the round method on a SASDataFrame object.

For example, i'll load the following file as a CAS Table

castbl = conn.read_csv(r'https://support.sas.com/documentation/onlinedoc/viya/exampledatasets/cars.csv', casout = {'name':'hmeq', 'caslib':'casuser', 'replace':True})

Then i'll execute the describe and round methods on the CASTable objects. The describe method returns a SASDataFrame, and the round method should round that DataFrame.

castbl.describe().round()
The results show it makes all the values NaN
Round Describe

I also tested this with the head method on a CASTable object. I get this error:
castbl.head().round()
Error

If you use traditional Pandas and create a traditional DataFrame, the round method works each time.

df = pd.read_csv(r'https://support.sas.com/documentation/onlinedoc/viya/exampledatasets/cars.csv')
df.describe().round()
df.head().round()

dataframeround

@bkemper24
Copy link
Contributor

This appears to be a problem with pandas. The problem was introduced in pandas version 1.2.0.
The problem occurs when a class that subclasses pandas.DataFrame ( in this case the SASDataFrame class ) contains an original property named "name" that is included in the _metadata list.

The problem is fixed in pandas version 2.0.0 that was released last month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants