And 3 other Pandas Tricks to Process your Data Efficiently

Image for post
Image for post
Photo by Lisa Kohnen on Unsplash

Motivation

  • Assign new columns to a DataFrame
  • Exclude the outliers in a column
  • Select or drop all columns that start with ‘X’
  • Filter rows only if the column contains values from another list

Assign New Columns to a DataFrame


Master Unit Testing in Python with These 4 Tips

Image for post
Image for post
Photo by Gayatri Malhotra on Unsplash

Motivation

  • Test one function with multiple…


Get more Features Out of your Time Series Dataset in One Line of Code

Image for post
Image for post
Photo by Maddi Bazzocco on Unsplash

Motivation

Import and Process Data

!wget https://raw.githubusercontent.com/jbrownlee/Datasets/master/daily-total-female-births.csv


Get more insights out of your text within one line of code!

Image for post
Image for post
Photo by Thomas Kelley on Unsplash

Motivation

What is TextBlob?


And how Triple your Graphic Card’s Memory Speeds the Training 10X Faster!

Motivation


Improve your Coding Speed with These 9 Keyboard Shortcuts

Image for post
Image for post
Photo by Jordan Opel on Unsplash

Motivation


Automate Boring Stuff with Python and Bash For Loop

Image for post
Image for post
Photo by Sincerely Media on Unsplash

Motivation

  • Loop through files in a directory
  • Create nested files if they do not exist
  • Run one file with different inputs using bash for loop

Loop through Files in a Directory


Why not Make Python’s Best Practices Easier to Adopt?

Image for post
Image for post
Photo by ThisisEngineering RAEng on Unsplash

Motivation

  • Include type hint
  • Write good documentation
  • Keep the relevant variables and functions and import relevant packages
  • Highlight the code that needs attention or improvements
  • Avoid other trivial mistakes such as forgetting to declare the variables


Just like Git, but with Data!

Image for post
Image for post
Photo by Franki Chamaki on Unsplash

Motivation

  • It is messy to compare the change in different versions of data with Git. I remember that I need to manually accept about 100 lines of data that were changed between 2 commits when using git pulland it was a…


Now you can Work on Other Projects while Waiting for the Training to be Done

Image for post
Image for post
Photo by Brett Jordan on Unsplash

Motivation

  • noise
  • email
  • slack

Make noise

About

Khuyen Tran

Data scientist. Subscribe to my daily data science tips and tools here: https://mathdatasimplified.com/

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