Skip to content

Conversation

@alimcmaster1
Copy link
Member

@alimcmaster1 alimcmaster1 commented Nov 2, 2019

See the image below which highlights what i've done here

image

flake8-rst doc/source --filename=/getting_started/basics.rst runs clean

cc. @datapythonista to review

@alimcmaster1
Copy link
Member Author

Unsure why the code coverage has dramatically reduced..

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to avoid using lambdas where possible

"""
Chicago, IL -> Chicago for city_name column
"""
df['city_name'] = df['city_and_code'].apply(lambda x: x.split(', ')[0])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
df['city_name'] = df['city_and_code'].apply(lambda x: x.split(', ')[0])
df['city_name'] = df['city_and_code'].str.split(",").str.get(0)

Chicago -> Chicago-US for city_name column
"""
col = 'city_name'
df['city_and_country'] = df[col].apply(lambda x: f'{x}-{country_name}')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
df['city_and_country'] = df[col].apply(lambda x: f'{x}-{country_name}')
df['city_and_country'] = df[col] + "-USA"

@alimcmaster1
Copy link
Member Author

Thanks for the comments @WillAyd totally agree - updated

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm @datapythonista care to take a look here?

@WillAyd WillAyd added this to the 1.0 milestone Nov 4, 2019
@WillAyd WillAyd merged commit bdf1292 into pandas-dev:master Nov 6, 2019
@WillAyd
Copy link
Member

WillAyd commented Nov 6, 2019

Thanks @alimcmaster1

@alimcmaster1
Copy link
Member Author

Thanks @WillAyd

@datapythonista
Copy link
Member

Sorry I couldn't check this before. Looks great, good job @alimcmaster1. Happy to see this finally improved.

Reksbril pushed a commit to Reksbril/pandas that referenced this pull request Nov 18, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC: Fix pipe example in the Essential basic functionality page

3 participants