applying formats using fetch or to_frame makes all DataFrame columns objects
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Start by reproducing the behavior with tbl.to_frame(format=True) using the cars example and inspect the resulting SASDataFrame dtypes. Trace the formatting path used by to_frame or fetch, then add coverage showing that only formatted columns become objects while unformatted numeric columns retain numeric types.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
If you have formats on only a few columns in a CAS table and try to apply the formats to the SASDataFrame, the swat package converts all columns to objects, even if the column is a simple number.
For example:
Packages
import swat
import pandas as pd
Connect to CAS
conn = ##connection info
load data to CAS
data = r'https://support.sas.com/documentation/onlinedoc/viya/exampledatasets/cars.csv'
tbl = conn.upload_file(data,
casout = {'name':'cars_upload', 'caslib':'casuser','replace':True},
importoptions={
'stripBlanks':True,
'guessRows':200,
'vars':{
'MSRP':{'format':'dollar16.'},
'Weight':{'format':'comma16.'}
}})
Only the MSRP and Weight columns have a format
tbl.columnInfo()

Pull the CAS table to the client as a SASDataFrame and apply the formats. This works as expected
df = tbl.to_frame(format=True)
df.head()

View the data types of the SASDataFrame

Everything turns into an object. It seems like only the formatted columns should be converted. Numeric columns without formats should remain numbers.
- Vorherrschende Sprache
- Python
- Sterne
- 159
- Forks
- 66
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus sassoftware/python-swat
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
sassoftware/python-swat#191 · 1 Kommentar ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
sassoftware/python-swat#183 · 1 Kommentar ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
sassoftware/python-swat#180 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
sassoftware/python-swat#178 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
sassoftware/python-swat#177 · 1 Kommentar ·
Alle Issues in sassoftware/python-swat
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
its-me-prash/vwgroup-connect-ha#2019 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
KonstantinStarovoytov/kitden#21 ·
Maintainer antworten meist innerhalb von 1 Tag
-
RefactorOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ehmatthes/gh-profiler#166 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
smart-on-fhir/smart-fetch#73 ·
-
good first issue help wanted
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 85/100
RizgarOzan/playcal#13 ·