diff --git a/adding-procedures.html b/adding-procedures.html index a228076a..7862385a 100644 --- a/adding-procedures.html +++ b/adding-procedures.html @@ -4,7 +4,7 @@ -
This method returns the list of currently assigned librefs
Like Linux ‘cat’ - open and print the contents of a file
This method imports a Pandas DataFrame to a SAS Data Set, returning the SASdata object for the new Data Set.
Also note that DataFrame indexes (row label) are not transferred over as columns, as they aren’t actualy in df.columns. You can simpley use df.reset_index() before this method and df.set_index() after to have the index be a column which @@ -679,7 +679,7 @@
This method is used to query a libref. The results show information about the libref including members.
This is an alias for ‘dataframe2sasdata’. Why type all that?
Also note that DataFrame indexes (row label) are not transferred over as columns, as they aren’t actualy in df.columns. You can simpley use df.reset_index() before this method and df.set_index() after to have the index be a column which @@ -701,7 +701,7 @@
df – pandas.DataFrame Pandas DataFrame to import to a SAS Data Set
pandas.DataFrame
table – the name of the SAS Data Set to create
libref – the libref for the SAS Data Set being created. Defaults to WORK, or USER if assigned
results – format of results, SASsession.results is default, PANDAS, HTML or TEXT are the alternatives
This is a utility method for df2sd, use to get the character columns lengths from a DataFrame to use to create a SAS data set. This can be called by the user and the returned dict can be passed in to df2sd via the char_lengths= option. For big DataFrames, this can take a long time, so this can be used to do it once, @@ -769,7 +769,7 @@
df – pandas.DataFrame Pandas DataFrames to import to a SAS Data Set
encode_errors – ‘fail’, ‘replace’ - default is to ‘fail’, other choice is to ‘replace’ invalid chars with the replacement char. This is only when calculating byte lengths, which is dependent upon the value of char_lengths=. When calculating char lengths, this parameter is ignored in this method (encoding is deferred to the data transfer step in df2sd).
char_lengths –
How to determine (and declare) lengths for CHAR variables in the output SAS data set SAS declares lenghts in bytes, not characters, so multibyte encodings require more bytes per character (BPC)
This method returns the directory list for the path specified where SAS is running
This method downloads a remote file from the SAS servers file system.
Does the SAS data set currently exist
Boolean True it the Data Set exists and False if it does not
bool
This method copies one external file to another on the SAS server side
This method deletes an external file or directory on the SAS server side
This method returns a dictionary containing the file attributes for the file name provided
If you would like a Pandas DataFrame returned instead of a dictionary, specify results=’pandas’
This method is used to get the LOG from the most recetly executed submit() method. That is either a user submitted submit() or internally submitted by any saspy method. This is just a convenience over the saslog() method, to just see the LOG for the last code that was submitted instead of the @@ -901,14 +901,14 @@
SAS log (partial)
str
libref – the libref to get the path from
This method returns a list of tuples containing MEMNAME, MEMTYPE of members in the library of memtype data or view
If you would like a Pandas DataFrame returned instead of a list, specify results=’pandas’
Method to define an existing SAS dataset so that it can be accessed via SASPy
This method exports the SAS Data Set to a Pandas DataFrame, returning the DataFrame object.
This method exports the SAS Data Set to a Parquet file. This is a user contributed method created to work around data sets that are too large to be able to reside in a data frame; not enough memory for Python to have it in Pandas. So, this writes the data out to a parquet file so it can be instantiated back in Python using Arrow.
This method is used to get the current, full contents of the SASLOG
SAS log
This is an alias for ‘sasdata2dataframe’. Why type all that?
This is an alias for ‘sasdata2dataframe’ specifying method=’CSV’. Why type all that?
This is an alias for ‘sasdata2dataframe’ specifying method=’DISK’. Why type all that?
This method exports the SAS Data Set to a Parquet file. This is an alias for sasdata2parquet. This is a user contributed method created to work around data sets that are too large to be able to reside in a data frame; not enough memory for Python to have it in Pandas. So, this writes the data out to a parquet file so it can be instantiated back in Python using Arrow.
This method sets the batch attribute for the SASsession object; it stays in effect until changed. For methods that just display results like SASdata object methods (head, tail, hist, series, etc.) and SASresult object results, you can set ‘batch’ to true to get the results back directly so you @@ -1552,7 +1552,7 @@
This method set the results attribute for the SASsession object; it stays in effect till changed
string of the return type
Alias for simple_interest_loan
Calculate the amortization schedule of a simple interest load given 3 of the 4 variables You must specify 3 of the for variables, to solve for the 4th.
This method is used to submit any SAS code. It returns the Log and Listing as a python dictionary.
This method is a convenience wrapper around the submit() method. It executes the submit then prints the LOG that was returned.
This method is a convenience wrapper around the submit() method. It executes the submit then renders the LST that was returned, as either HTML or TEXT, depending upon results. The method= parameter allows you to adjust what gets returned to suit your needs.
@@ -1671,7 +1671,7 @@ SAS Session Object -symexist(name: str)¶ +symexist(name: str)¶ Parameters: name – [required] name of the macro varable to check for existence @@ -1684,7 +1684,7 @@ SAS Session Object -symget(name: str, outtype=None)¶ +symget(name: str, outtype=None)¶ Parameters: @@ -1697,7 +1697,7 @@ SAS Session Object -symput(name: str, value, quoting='NRBQUOTE')¶ +symput(name: str, value, quoting='NRBQUOTE')¶ Parameters: @@ -1711,7 +1711,7 @@ SAS Session Object -teach_me_SAS(nosub: bool)¶ +teach_me_SAS(nosub: bool)¶ Parameters: nosub – bool. True means don’t submit the code, print it out so I can see what the SAS code would be. False means run normally - submit the code. @@ -1721,7 +1721,7 @@ SAS Session Object -upload(localfile: str, remotefile: str, overwrite: bool = True, permission: str = '', **kwargs)¶ +upload(localfile: str, remotefile: str, overwrite: bool = True, permission: str = '', **kwargs)¶ This method uploads a local file to the SAS servers file system. Parameters: @@ -1741,7 +1741,7 @@ SAS Session Object -validvarname(df: DataFrame, version: str = 'v7') → DataFrame¶ +validvarname(df: DataFrame, version: str = 'v7') → DataFrame¶ Creates a copy of a DataFrame with SAS compatible column names. The version= parameter allows you to choose the compatability setting to use. @@ -1775,7 +1775,7 @@ SAS Session Object -write_csv(file: str, table: str, libref: str = '', dsopts: Optional[dict] = None, opts: Optional[dict] = None) → str¶ +write_csv(file: str, table: str, libref: str = '', dsopts: Optional[dict] = None, opts: Optional[dict] = None) → str¶ Parameters: @@ -1829,7 +1829,7 @@ SAS Session Object¶ -class saspy.sasdata.SASdata(sassession, libref, table, results='', dsopts: Optional[dict] = None)¶ +class saspy.sasdata.SASdata(sassession, libref, table, results='', dsopts: Optional[dict] = None)¶ Overview The SASdata object is a reference to a SAS Data Set or View. It is used to access data that exists in the SAS session. You create a SASdata object by using the sasdata() method of the SASsession object. @@ -1866,7 +1866,7 @@ SAS Data Object -add_vars(vars: dict, out: Optional[object] = None, **kwargs)¶ +add_vars(vars: dict, out: Optional[object] = None, **kwargs)¶ Copy table to itesf, or to ‘out=’ table and add any vars if you want Parameters: @@ -1895,7 +1895,7 @@ SAS Data Object -append(data, force: bool = False)¶ +append(data, force: bool = False)¶ Append ‘data’ to this SAS Data Set. data can either be another SASdataobject or a Pandas DataFrame, in which case dataframe2sasdata(data) will be run for you to load the data into a SAS data Set which will then be appended to this data set. @@ -1914,7 +1914,7 @@ SAS Data Object -assessModel(target: str, prediction: str, nominal: bool = True, event: str = '', **kwargs)¶ +assessModel(target: str, prediction: str, nominal: bool = True, event: str = '', **kwargs)¶ This method will calculate assessment measures using the SAS AA_Model_Eval Macro used for SAS Enterprise Miner. Not all datasets can be assessed. This is designed for scored data that includes a target and prediction columns TODO: add code example of build, score, and then assess @@ -1936,7 +1936,7 @@ SAS Data Object -bar(var: str, title: str = '', label: str = '') → object¶ +bar(var: str, title: str = '', label: str = '') → object¶ This method requires a character column (use the contents method to see column types) and generates a bar chart. @@ -2009,7 +2009,7 @@ SAS Data Object -heatmap(x: str, y: str, options: str = '', title: str = '', label: str = '') → object¶ +heatmap(x: str, y: str, options: str = '', title: str = '', label: str = '') → object¶ Documentation link: http://support.sas.com/documentation/cdl/en/grstatproc/67909/HTML/default/viewer.htm#n0w12m4cn1j5c6n12ak64u1rys4w.htm Parameters: @@ -2029,7 +2029,7 @@ SAS Data Object -hist(var: str, title: str = '', label: str = '') → object¶ +hist(var: str, title: str = '', label: str = '') → object¶ This method requires a numeric column (use the contents method to see column types) and generates a histogram. Parameters: @@ -2047,7 +2047,7 @@ SAS Data Object -impute(vars: dict, replace: bool = False, prefix: str = 'imp_', out: Optional[SASdata] = None) → SASdata¶ +impute(vars: dict, replace: bool = False, prefix: str = 'imp_', out: Optional[SASdata] = None) → SASdata¶ Imputes missing values for a SASdata object. Parameters: @@ -2088,7 +2088,7 @@ SAS Data Object -modify(formats: Optional[dict] = None, informats: Optional[dict] = None, label: Optional[str] = None, renamevars: Optional[dict] = None, labelvars: Optional[dict] = None)¶ +modify(formats: Optional[dict] = None, informats: Optional[dict] = None, label: Optional[str] = None, renamevars: Optional[dict] = None, labelvars: Optional[dict] = None)¶ Modify a table, setting formats, informats or changing the data set name itself or renaming variables or adding labels to variables Parameters: @@ -2108,7 +2108,7 @@ SAS Data Object -obs(force: bool = False) → int¶ +obs(force: bool = False) → int¶ Parameters: force – if nobs isn’t availble, set to True to force it to be calculated; may take time @@ -2121,7 +2121,7 @@ SAS Data Object -partition(var: str = '', fraction: float = 0.7, seed: int = 9878, kfold: int = 1, out: Optional[SASdata] = None, singleOut: bool = True) → object¶ +partition(var: str = '', fraction: float = 0.7, seed: int = 9878, kfold: int = 1, out: Optional[SASdata] = None, singleOut: bool = True) → object¶ Partition a sas data object using SRS sampling or if a variable is specified then stratifying with respect to that variable @@ -2143,7 +2143,7 @@ SAS Data Object -rename(name: Optional[str] = None)¶ +rename(name: Optional[str] = None)¶ Rename this data set Parameters: @@ -2157,7 +2157,7 @@ SAS Data Object -scatter(x: str, y: list, title: str = '') → object¶ +scatter(x: str, y: list, title: str = '') → object¶ This method plots a scatter of x,y coordinates. You can provide a list of y columns for multiple line plots. Parameters: @@ -2175,7 +2175,7 @@ SAS Data Object -score(file: str = '', code: str = '', out: Optional[SASdata] = None) → SASdata¶ +score(file: str = '', code: str = '', out: Optional[SASdata] = None) → SASdata¶ This method is meant to update a SAS Data object with a model score file. Parameters: @@ -2193,7 +2193,7 @@ SAS Data Object -series(x: str, y: list, title: str = '') → object¶ +series(x: str, y: list, title: str = '') → object¶ This method plots a series of x,y coordinates. You can provide a list of y columns for multiple line plots. Parameters: @@ -2211,7 +2211,7 @@ SAS Data Object -set_results(results: str)¶ +set_results(results: str)¶ This method set the results attribute for the SASdata object; it stays in effect till changed results - set the default result type for this SASdata object. ‘Pandas’ or ‘HTML’ or ‘TEXT’. @@ -2226,7 +2226,7 @@ SAS Data Object -sort(by: str, out: object = '', **kwargs) → SASdata¶ +sort(by: str, out: object = '', **kwargs) → SASdata¶ Sort the SAS Data Set Parameters: @@ -2270,7 +2270,7 @@ SAS Data Object -to_csv(file: str, opts: Optional[dict] = None) → str¶ +to_csv(file: str, opts: Optional[dict] = None) → str¶ This method will export a SAS Data Set to a file in CSV format. Parameters: @@ -2297,7 +2297,7 @@ SAS Data Object -to_df(method: str = 'MEMORY', **kwargs) → DataFrame¶ +to_df(method: str = 'MEMORY', **kwargs) → DataFrame¶ Export this SAS Data Set to a Pandas Data Frame Parameters: @@ -2347,7 +2347,7 @@ SAS Data Object -to_df_CSV(tempfile: Optional[str] = None, tempkeep: bool = False, opts: Optional[dict] = None, **kwargs) → DataFrame¶ +to_df_CSV(tempfile: Optional[str] = None, tempkeep: bool = False, opts: Optional[dict] = None, **kwargs) → DataFrame¶ This is an alias for ‘to_df’ specifying method=’CSV’. Parameters: @@ -2397,7 +2397,7 @@ SAS Data Object -to_df_DISK(rowsep: str = '\x01', colsep: str = '\x02', rowrep: str = ' ', colrep: str = ' ', **kwargs) → DataFrame¶ +to_df_DISK(rowsep: str = '\x01', colsep: str = '\x02', rowrep: str = ' ', colrep: str = ' ', **kwargs) → DataFrame¶ This is an alias for ‘to_df’ specifying method=’DISK’. Parameters: @@ -2441,7 +2441,7 @@ SAS Data Object -to_frame(**kwargs) → DataFrame¶ +to_frame(**kwargs) → DataFrame¶ This is just an alias for to_df() Parameters: @@ -2458,7 +2458,7 @@ SAS Data Object -to_json(pretty: bool = False, sastag: bool = False, **kwargs) → str¶ +to_json(pretty: bool = False, sastag: bool = False, **kwargs) → str¶ Export this SAS Data Set to a JSON Object PROC JSON documentation: http://go.documentation.sas.com/?docsetId=proc&docsetVersion=9.4&docsetTarget=p06hstivs0b3hsn1cb4zclxukkut.htm&locale=en @@ -2477,7 +2477,7 @@ SAS Data Object -to_pq(parquet_file_path: str, pa_parquet_kwargs=None, pa_pandas_kwargs=None, partitioned=False, partition_size_mb=128, chunk_size_mb=4, coerce_timestamp_errors=True, static_columns: Optional[list] = None, rowsep: str = '\x01', colsep: str = '\x02', rowrep: str = ' ', colrep: str = ' ', **kwargs) → None¶ +to_pq(parquet_file_path: str, pa_parquet_kwargs=None, pa_pandas_kwargs=None, partitioned=False, partition_size_mb=128, chunk_size_mb=4, coerce_timestamp_errors=True, static_columns: Optional[list] = None, rowsep: str = '\x01', colsep: str = '\x02', rowrep: str = ' ', colrep: str = ' ', **kwargs) → None¶ This method exports the SAS Data Set to a Parquet file. This is an alias for sasdata2parquet. Parameters: @@ -2528,7 +2528,7 @@ SAS Data Object -top(var: str, n: int = 10, order: str = 'freq', title: str = '') → object¶ +top(var: str, n: int = 10, order: str = 'freq', title: str = '') → object¶ Return the most commonly occuring items (levels) Parameters: @@ -2547,7 +2547,7 @@ SAS Data Object -where(where: str) → SASdata¶ +where(where: str) → SASdata¶ This method returns a clone of the SASdata object, with the where attribute set. The original SASdata object is not affected. Parameters: diff --git a/configuration.html b/configuration.html index 41871ccd..6902c74e 100644 --- a/configuration.html +++ b/configuration.html @@ -4,7 +4,7 @@ - Configuration — saspy 5.100.3 documentation + Configuration — saspy 5.100.4 documentation @@ -38,7 +38,7 @@ saspy - 5.100.3 + 5.100.4 diff --git a/genindex.html b/genindex.html index 6baa04ae..df68ddf8 100644 --- a/genindex.html +++ b/genindex.html @@ -3,7 +3,7 @@ - Index — saspy 5.100.3 documentation + Index — saspy 5.100.4 documentation @@ -35,7 +35,7 @@ saspy - 5.100.3 + 5.100.4 diff --git a/getting-started.html b/getting-started.html index f3218ffd..04fbe070 100644 --- a/getting-started.html +++ b/getting-started.html @@ -4,7 +4,7 @@ - Getting started — saspy 5.100.3 documentation + Getting started — saspy 5.100.4 documentation @@ -38,7 +38,7 @@ saspy - 5.100.3 + 5.100.4 diff --git a/index.html b/index.html index 710d0e8f..5511e838 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - SASPy — saspy 5.100.3 documentation + SASPy — saspy 5.100.4 documentation @@ -37,7 +37,7 @@ saspy - 5.100.3 + 5.100.4 @@ -409,7 +409,7 @@ SASPy¶ -Date: Sep 11, 2024 Version: 5.100.3 +Date: Oct 28, 2024 Version: 5.100.4 Source Repository: http://github.com/sassoftware/saspy Issues and Ideas: https://github.com/sassoftware/saspy/issues Example Repo: https://github.com/sassoftware/saspy-examples diff --git a/install.html b/install.html index a63e933a..5d652701 100644 --- a/install.html +++ b/install.html @@ -4,7 +4,7 @@ - Installation — saspy 5.100.3 documentation + Installation — saspy 5.100.4 documentation @@ -38,7 +38,7 @@ saspy - 5.100.3 + 5.100.4 diff --git a/license.html b/license.html index 66ca2f2c..bd3bd347 100644 --- a/license.html +++ b/license.html @@ -4,7 +4,7 @@ - License — saspy 5.100.3 documentation + License — saspy 5.100.4 documentation @@ -37,7 +37,7 @@ saspy - 5.100.3 + 5.100.4 diff --git a/limitations.html b/limitations.html index 434a481e..37fb6e54 100644 --- a/limitations.html +++ b/limitations.html @@ -4,7 +4,7 @@ - Limitations, restrictions and work arounds — saspy 5.100.3 documentation + Limitations, restrictions and work arounds — saspy 5.100.4 documentation @@ -38,7 +38,7 @@ saspy - 5.100.3 + 5.100.4 diff --git a/py-modindex.html b/py-modindex.html index 8700ef53..de00a404 100644 --- a/py-modindex.html +++ b/py-modindex.html @@ -3,7 +3,7 @@ - Python Module Index — saspy 5.100.3 documentation + Python Module Index — saspy 5.100.4 documentation @@ -42,7 +42,7 @@ saspy - 5.100.3 + 5.100.4 diff --git a/search.html b/search.html index 117e688b..69658414 100644 --- a/search.html +++ b/search.html @@ -3,7 +3,7 @@ - Search — saspy 5.100.3 documentation + Search — saspy 5.100.4 documentation @@ -38,7 +38,7 @@ saspy - 5.100.3 + 5.100.4 diff --git a/troubleshooting.html b/troubleshooting.html index 8ff8a0cb..8407e981 100644 --- a/troubleshooting.html +++ b/troubleshooting.html @@ -4,7 +4,7 @@ - Troubleshooting — saspy 5.100.3 documentation + Troubleshooting — saspy 5.100.4 documentation @@ -38,7 +38,7 @@ saspy - 5.100.3 + 5.100.4
name – [required] name of the macro varable to check for existence
nosub – bool. True means don’t submit the code, print it out so I can see what the SAS code would be. False means run normally - submit the code.
This method uploads a local file to the SAS servers file system.
Creates a copy of a DataFrame with SAS compatible column names. The version= parameter allows you to choose the compatability setting to use.
Overview
The SASdata object is a reference to a SAS Data Set or View. It is used to access data that exists in the SAS session. You create a SASdata object by using the sasdata() method of the SASsession object.
Copy table to itesf, or to ‘out=’ table and add any vars if you want
Append ‘data’ to this SAS Data Set. data can either be another SASdataobject or a Pandas DataFrame, in which case dataframe2sasdata(data) will be run for you to load the data into a SAS data Set which will then be appended to this data set.
This method will calculate assessment measures using the SAS AA_Model_Eval Macro used for SAS Enterprise Miner. Not all datasets can be assessed. This is designed for scored data that includes a target and prediction columns TODO: add code example of build, score, and then assess
This method requires a character column (use the contents method to see column types) and generates a bar chart.
Documentation link: http://support.sas.com/documentation/cdl/en/grstatproc/67909/HTML/default/viewer.htm#n0w12m4cn1j5c6n12ak64u1rys4w.htm
This method requires a numeric column (use the contents method to see column types) and generates a histogram.
Imputes missing values for a SASdata object.
Modify a table, setting formats, informats or changing the data set name itself or renaming variables or adding labels to variables
force – if nobs isn’t availble, set to True to force it to be calculated; may take time
Partition a sas data object using SRS sampling or if a variable is specified then stratifying with respect to that variable
Rename this data set
This method plots a scatter of x,y coordinates. You can provide a list of y columns for multiple line plots.
This method is meant to update a SAS Data object with a model score file.
This method plots a series of x,y coordinates. You can provide a list of y columns for multiple line plots.
This method set the results attribute for the SASdata object; it stays in effect till changed results - set the default result type for this SASdata object. ‘Pandas’ or ‘HTML’ or ‘TEXT’.
Sort the SAS Data Set
This method will export a SAS Data Set to a file in CSV format.
Export this SAS Data Set to a Pandas Data Frame
This is an alias for ‘to_df’ specifying method=’CSV’.
This is an alias for ‘to_df’ specifying method=’DISK’.
This is just an alias for to_df()
Export this SAS Data Set to a JSON Object PROC JSON documentation: http://go.documentation.sas.com/?docsetId=proc&docsetVersion=9.4&docsetTarget=p06hstivs0b3hsn1cb4zclxukkut.htm&locale=en
This method exports the SAS Data Set to a Parquet file. This is an alias for sasdata2parquet.
Return the most commonly occuring items (levels)
This method returns a clone of the SASdata object, with the where attribute set. The original SASdata object is not affected.
Date: Sep 11, 2024 Version: 5.100.3
Date: Oct 28, 2024 Version: 5.100.4
Source Repository: http://github.com/sassoftware/saspy
Issues and Ideas: https://github.com/sassoftware/saspy/issues
Example Repo: https://github.com/sassoftware/saspy-examples