-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH : GH11729 added index parameter in series to_string #11750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3181,6 +3181,16 @@ def test_to_string_float_na_spacing(self): | |
'4 NaN') | ||
self.assertEqual(result, expected) | ||
|
||
def test_to_string_without_index(self): | ||
#GH 11729 Test index=False option | ||
s= Series([1, 2, 3, 4]) | ||
result = s.to_string(index=False) | ||
expected = (u(' 1\n') + | ||
' 2\n' + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jorisvandenbossche does this look right? (e.g. I know we add a space, but seems odd with no index....) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems more logical to me that the space is not there if no index is added. But,
Of course not necessarily a reason to do it here as well |
||
' 3\n' + | ||
' 4') | ||
self.assertEqual(result, expected) | ||
|
||
def test_unicode_name_in_footer(self): | ||
s = Series([1, 2], name=u('\u05e2\u05d1\u05e8\u05d9\u05ea')) | ||
sf = fmt.SeriesFormatter(s, name=u('\u05e2\u05d1\u05e8\u05d9\u05ea')) | ||
|
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.
is this really what dataframe does ? (e.g. with the adjoin)? for the no index case
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.
any thoughts here?
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.
Dataframe does not use adjoin. In dataframe we use a list and insert index into that. I was expecting that dataframe and series formatter code will be similar but this is not the case .