This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Mon Mar 5 14:21:42 2018 | |
| @author: nilesh-tawari | |
| email: tawari.nilesh@gmail.com | |
| GitHub: https://github.com/nilesh-tawari | |
| """ | |
| from __future__ import print_function | |
| import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| # fix SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Either of following | |
| pd.options.mode.chained_assignment = None # default='warn' | |
| df.is_copy = False | |
| # read big csv | |
| df = pd.read_csv(FILE_PATH, sep='\t', comment = '#', chunksize=1000, \ | |
| low_memory=False, iterator = True, compression='gzip') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create git repository and push to remote | |
| cd workspace/Clinical_genomics_framework/ | |
| git init | |
| git add . | |
| git commit -m "Clinical genomics framework" | |
| echo "# Clinical_genomics_framework" >> README.md | |
| git add README.md | |
| git commit -m "Readme file" | |
| Create a repo online using browser then push local to remote |