-
Notifications
You must be signed in to change notification settings - Fork 80
Conversation
🚀 Deployed on https://deploy-preview-809--etna-docs.netlify.app |
etna/datasets/tsdataset.py
Outdated
return self.to_flatten(self.df) | ||
if columns is None: | ||
return self.df.copy() | ||
return self.df.loc[:, self.idx[:, columns]].copy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should investigate is it a problem to pass ":" here in place of segments.
The problem is described here: #775.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure that it is important here, as this method just return the copy of dataframe with the specified columns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it leads to swapping values of columns (that was a mistake), then you will get a broken dataframe. Ask the author of that bug about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made it deterministic, add comment in #775 to fix this place either
Codecov Report
@@ Coverage Diff @@
## tsdataset_2 #809 +/- ##
================================================
- Coverage 84.01% 49.43% -34.59%
================================================
Files 125 125
Lines 7193 7218 +25
================================================
- Hits 6043 3568 -2475
- Misses 1150 3650 +2500
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
etna/datasets/tsdataset.py
Outdated
"""Return pandas DataFrame with flatten index. | ||
|
||
Parameters | ||
---------- | ||
df: | ||
DataFrame in ETNA format. | ||
|
||
columns: | ||
List of columns to return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we want to check that columns are present? Or we are content with error from pandas itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I do not get an error on pandas 1.3.5, anyway error from pandas won't be ambiguous, it will be clear that there is no such column in the dataset
etna/datasets/tsdataset.py
Outdated
@@ -595,7 +602,9 @@ def to_pandas(self, flatten: bool = False) -> pd.DataFrame: | |||
* If False, return pd.DataFrame with multiindex | |||
|
|||
* If True, return with flatten index | |||
|
|||
columns: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Don't we want to check that columns are present? Or we are content with error from pandas itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix documentation and look at comments above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Before submitting (must do checklist)
Proposed Changes
Closing issues
closes #793