Closed pestyld closed 1 year ago
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.
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 NaNI also tested this with the head method on a CASTable object. I get this error:
castbl.head().round()
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()