Skip to content

Python Libraries

Ananyeah edited this page Mar 6, 2018 · 4 revisions

Python import Library

Vectors

import numpy as np

Dataframes

import pandas as pd

Plotting

import matplotlib.pyplot as plt

import seaborn as sns

Seaborn and matplotlib work well together though they are both plotting

Fancy plotting

!pip install plotly

import plotly as py

!pip install cufflinks

import cufflinks as cf

Machine Learning

from sklearn.preprocessing import Imputer from sklearn.linear_model import logistic regression(scikit learn)

Preprocessing Label Encoder Scikit learn requires numbers You label encode your target, not your features. For features, you should one-hot encode

Diff between dummy variables and label encoding is 'it doesn't create the columns'

Clone this wiki locally