Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RSE 23 Group Assignment Shervud Pitawanik Franz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Niklas Franz
RSE 23 Group Assignment Shervud Pitawanik Franz
Commits
b07769a6
Commit
b07769a6
authored
1 year ago
by
Alexander Shervud
Browse files
Options
Downloads
Patches
Plain Diff
Added functionality and requirements
parent
337498d2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/requirements.md
+2
-3
2 additions, 3 deletions
docs/requirements.md
src/Dataset.py
+67
-0
67 additions, 0 deletions
src/Dataset.py
with
69 additions
and
3 deletions
docs/requirements.md
+
2
−
3
View file @
b07769a6
...
...
@@ -9,10 +9,9 @@
-
Users should be able to get an overview of the dataset at hand:
-
how many rows are there?
-
what columns are there?
-
what relations do these columns have?
-
Users should be able to get metrics like mean of a single column of a dataset
-
Users should be able to extract a few rows based on a selective criteria (for example only rows with specific value in a column)
-
Users should be able to be able to drop specific rows and columns in my data
-
Users should be able to extract a few rows that matches a selected criteria.
-
Users should be able to be able to treat outliers in a set. That way you can circumvent fake/joke answers and prevent a plot from blowing up.
#### Plotting
...
...
This diff is collapsed.
Click to expand it.
src/Dataset.py
+
67
−
0
View file @
b07769a6
...
...
@@ -340,3 +340,70 @@ class Dataset:
if
ascending
is
None
else
grouped_size
.
sort_values
(
ascending
=
ascending
)
)
def
get_column_count
(
self
)
->
int
:
"""
get_column_count returns the amount of columns in the dataframe.
Returns:
int: column_count
"""
return
len
(
self
.
dataframe
.
columns
)
def
get_row_count
(
self
)
->
int
:
"""
get_rowcount returns the amount of rows in the dataframe.
Returns:
int: row_count
"""
return
len
(
self
.
dataframe
)
def
get_column_mean
(
self
,
colname
:
str
)
->
int
:
"""
get_column_mean returns the mean value of all entries in one column.
Args:
colname (str): Index of the columns in the dataframe.
(Indexes can be get by calling get_columns()).
Returns:
int: column_mean
"""
if
type
(
colname
)
!=
str
:
logging
.
error
(
"
parameter `colname` is not a string
"
)
raise
ValueError
(
f
"
{
colname
}
is not a string
"
)
if
colname
not
in
self
.
dataframe
.
columns
:
logging
.
error
(
"
column requested not in dataframe
"
)
raise
KeyError
(
f
"
{
colname
}
is not a column in dataframe
"
)
return
self
.
dataframe
[
colname
].
mean
()
def
filtered_rows
(
self
,
colname
:
str
,
criteria
:
str
)
->
pd
.
DataFrame
:
"""
filtered_rows returns a filtered dataframe
Args:
colname (str): Column including the value you want to filter by.
criteria (str): criteria that matches all the rows you want to keep
Returns:
pd.DataFrame: _description_
"""
if
type
(
colname
)
!=
str
:
logging
.
error
(
"
parameter `colname` is not a string
"
)
raise
ValueError
(
f
"
{
colname
}
is not a string
"
)
if
colname
not
in
self
.
dataframe
.
columns
:
logging
.
error
(
"
column requested not in dataframe
"
)
raise
KeyError
(
f
"
{
colname
}
is not a column in dataframe
"
)
return
self
.
dataframe
[
self
.
dataframe
[
colname
]
==
criteria
]
def
get_columns
(
self
)
->
pd
.
Series
:
"""
get_columns returns all column headers/indexes
Returns:
pd.Series: List of all column headers
"""
return
self
.
dataframe
.
columns
\ No newline at end of file
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