Cheatography
https://cheatography.com
Useful Imports
Importing Pandas |
import pandas as pd |
Importing Matplot |
import matplotlib.pyplot as plt |
For Checking Data Type |
from pandas.api.types import is_numeric_dtype |
Plotting Parallel Coordinates |
from pandas.plotting import parallel_coordinates |
Column Data Type Manipulation
Changing All Columns |
data.astype('int64').dtypes |
Changing Selected Column |
data.astype( {'col1': 'int64'} ).dtypes |
|
|
Basic Stuff
Reading CSV |
data = pd.read_csv('changeme.csv', header=None) |
Assigning Column Names |
data.columns = ['column1', 'column2', 'class'] |
Checking Column Data Type |
data.dtypes |
Listing the Dataset |
data |
Plotting
Line Graph |
plt.plot(data.x, data.y, 'o') |
Boxplot |
data.boxplot(column=['col1', 'col2', 'col3'] |
Histogram |
data['col1'].hist(bins=20) |
Parallel Coordinates |
parallel_coordinates(nutrient_csv, 'ClassCol', cols = ['col1', 'col2']) |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets