Analytics Vidhya
Published in

Analytics Vidhya

Pandas tricks I wish I knew as a beginner

Pandas
Source: edureka.co

1. The dot notation

sliced_column = df['column1'] #Returns a pandas series
sliced_column = df.column1 #Returns the same pandas series as above

2. Replacing made easy

using loc for indexing

3. applymap() or apply()

Source: stackoverflow/cs95

4. Combining dataframes

Source: dofactory.com

5. Generating date ranges

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store