Skip to content

Instantly share code, notes, and snippets.

@vallantin
vallantin / 001_import_and_load.py
Last active August 15, 2018 14:48
Pandas 101: import library and load data
import pandas as pd
# Check version
print(pd.__version__)
# Load data
url = 'data/my_file.csv'
data = pd.read_csv(url)
@vallantin
vallantin / 002-merge-list-array.ipynb
Last active August 15, 2018 19:39
Merge a list and an array into a dictionary
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vallantin
vallantin / 003-create-df-from-objects.ipynb
Last active August 15, 2018 19:41
Create a dataframe from other objects
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vallantin
vallantin / 004-data-frame-random-values.ipynb
Last active August 15, 2018 19:42
Create Data Frame from random values
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vallantin
vallantin / 005-describe-dataframe.ipynb
Last active August 15, 2018 19:44
Get the mean, minimum, maximum, standard deviation, 25th, 50th and 75th percentiles of a Data Frame
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vallantin
vallantin / 006-frequency-of-column.ipynb
Last active August 15, 2018 19:48
Get the frequency of the values on a Data Frame column
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vallantin
vallantin / replace-2-frequent-other.ipynb
Last active August 15, 2018 19:47
Given a data frame, replace all values on a column by 'Other' except the 2 most frequent ones
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vallantin
vallantin / convert-serie-df-shape.ipynb
Last active August 15, 2018 19:47
Convert a numpy array to a data frame given a (b , c) shape
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vallantin
vallantin / index-divisible-5.ipynb
Created August 15, 2018 19:54
Find the indexes of the elements that are divisible by 5 on a series
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vallantin
vallantin / take-from-serie.ipynb
Last active August 15, 2018 20:24
Extract elements from a Series using the indices from a list
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.