Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dios
Manage
Activity
Members
Labels
Plan
Issues
11
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RDM
dios
Commits
5cd789a9
Commit
5cd789a9
authored
5 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
dddddooc
parent
33cc3cb2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/methods_and_properties.md
+76
-30
76 additions, 30 deletions
docs/methods_and_properties.md
with
76 additions
and
30 deletions
docs/methods_and_properties.md
+
76
−
30
View file @
5cd789a9
...
...
@@ -7,30 +7,41 @@ Methods
Brief
-
`copy(deep=True)`
: Return a copy. See also
[
pandas.DataFrame.copy
](
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.copy.html
)
-
`
copy_empty()
`
: Return a new DictOfSeries object, with same properties than the original.
-
[
copy_empty()
](
#diosdictofseriescopy_empty
)
: Return a new DictOfSeries object, with same properties than the original.
-
`all(axis=0)`
: Return whether all elements are True, potentially over an axis. See also
[
pandas.DataFrame.all
](
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.all.html
)
-
`any(axis=0)`
: Return whether any element is True, potentially over an axis. See also
[
pandas.DataFrame.any
](
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.any.html
)
-
`squeeze(axis=None)`
: Squeeze a 1-dimensional axis objects into scalars. Eg. a 1-column Dios is squeezes to the
underling Series. If
`axis=None`
it is also tried, to squeeze the possibly returned Series, from the (outer)
Dios-squeeze.
-
`squeeze(axis=None)`
: Squeeze a 1-dimensional axis objects into scalars.
See also
[
pandas.DataFrame.squeeze
](
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.squeeze.html
)
-
`
to_df()
`
: Transform the Dios to a pandas.DataFrame
-
[
to_df()
](
#diosdictofseriesto_df
)
: Transform the Dios to a pandas.DataFrame
-
`to_string(kwargs)`
: Return a string representation of the Dios.
-
`
apply(
func, args=(), **kwds)`
: apply the given function to every column in the dios eg.
-
[
apply(
)
](
#diosdictofseriesapply
)
: apply the given function to every column in the dios eg.
-
`astype()`
: Cast the data to the given data type.
-
`isin()`
: return a boolean dios, that indicates if the corresponding value is in the given array-like
-
`isna()`
: Return a bolean array that is
`True`
if the value is a Nan-value
-
`notna()`
: inverse of
`isnan()`
-
`dropna()`
: drop all Nan-values
-
`index_of(method='union)`
: Return a single(!) Index that is constructed from all the indexes of the columns.
-
`in`
-
`is`
-
[
index_of()
](
#diosdictofseriesindex_of
)
: Return a single(!) Index that is constructed from all the indexes of the columns.
-
`len(Dios)`
: return the number of columns the dios has.
`copy_empty(columns=True)`
--------------------------
Properties
----------
-
`columns`
: Column index
-
`indexes`
: Series of indexes of columns
-
`lengths`
: Series of lengths of columns
-
`values`
: A array of length of the columns, with arrays of values, as sub-arrays
-
`dtypes`
: Series of dtypes of columns
-
`itype`
: The index type the Dios accept
-
`empty`
: True if the dios holds no data. Nevertheless the dios can have empty columns.
dios.DictOfSeries.copy_empty
---------------------------
`DictOfSeries.copy_empty(columns=True)`
Return a new DictOfSeries object, with same properties than the original.
If
`columns=True`
, the copy will have the same, but empty columns like the original.
...
...
@@ -60,8 +71,11 @@ Columns: []
```
`to_df()`
---------
dios.DictOfSeries.to_df
----------------------
`DictOfSeries.to_df()`
Transform the Dios to a pandas.DataFrame. Missing common indices are filled with NaN's.
**Examples**
...
...
@@ -90,9 +104,11 @@ columns a b c d
10 NaN NaN NaN 4.0
```
dios.DictOfSeries.apply
-------------------------------------------------
`apply(func, axis=0, raw=False, args=(), **kwds)`
-----------------------
`DictOfSeries.apply(func, axis=0, raw=False, args=(), **kwds)`
Apply the given function to every column in the dios. This is a very mighty tool to apply functions that
are defined on pandas.Series to multiple columns.
...
...
@@ -187,21 +203,51 @@ dtype: object
dios.DictOfSeries.index_of
---------------------------
`index_of(method='union)`
`
DictOfSeries.
index_of(method='union)`
: return a single(!) Index that is constructed from all the indexes of the columns.
Aggregate indexes of all columns to one index by a given method.
**Parameters:**
-
**method : str, default "union"**
Aggregation method
- 'all' : get all indices from all columns
- 'shared' : get indices that are present in every columns
- 'uniques' : get indices that are only present in a single column
- 'union' : alias for 'all'
- 'intersection' : alias for 'shared'
- 'non-uniques' : get indices that are present in more than one column
-
**axis : {0 or ‘index’, 1 or ‘columns’}, default 0**
Properties
----------
-
`columns`
: Column index
-
`indexes`
: Series of indexes of columns
-
`lengths`
: Series of lengths of columns
-
`values`
: A array of length of the columns, with arrays of values, as sub-arrays
-
`dtypes`
: Series of dtypes of columns
-
`itype`
: The index type the Dios accept
-
`empty`
: True if the dios holds no data. Nevertheless the dios can have empty columns.
**Returns: pandas.Index**
The aggregated Index
**Examples**
```
>>> di
a | b | c | d |
===== | ====== | ====== | ===== |
0 0 | 2 5 | 4 7 | 6 0 |
1 7 | 3 6 | 5 17 | 7 1 |
2 14 | 4 7 | 6 27 | 8 2 |
3 21 | 5 8 | 7 37 | 9 3 |
4 28 | 6 9 | 8 47 | 10 4 |
5 35 | 7 10 | 9 57 | 11 5 |
6 42 | 8 11 | 10 67 | 12 6 |
7 49 | 9 12 | 11 77 | 13 7 |
8 56 | 10 13 | 12 87 | 14 8 |
9 63 | 11 14 | 13 97 | 15 9 |
>>> di.index_of()
RangeIndex(start=0, stop=16, step=1)
>>> di.index_of("shared")
Int64Index([6, 7, 8, 9], dtype='int64')
>>> di.index_of("uniques")
Int64Index([0, 1, 14, 15], dtype='int64')
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment