Skip to content

Instantly share code, notes, and snippets.

View Pratipkhandelwal's full-sized avatar
🎯
Focusing

Pratip Khandelwal Pratipkhandelwal

🎯
Focusing
View GitHub Profile
@Pratipkhandelwal
Pratipkhandelwal / README-Template.md
Created July 26, 2019 07:33 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!
@Pratipkhandelwal
Pratipkhandelwal / primes.py
Created September 18, 2017 02:22 — forked from jeetsukumaran/primes.py
Some useful mathematical functions in Python
# from: http://www.4dsolutions.net/cgi-bin/py2html.cgi?script=/ocn/python/primes.py
"""
primes.py -- Oregon Curriculum Network (OCN)
Feb 1, 2001 changed global var primes to _primes, added relative primes test
Dec 17, 2000 appended probable prime generating methods, plus invmod
Dec 16, 2000 revised to use pow(), removed methods not in text, added sieve()
Dec 12, 2000 small improvements to erastosthenes()
Dec 10, 2000 added Euler test
Oct 3, 2000 modified fermat test