In [1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns from sklearn.preprocessing import OrdinalEncoder from sklearn.preprocessing import OneHotEncoder from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from sklearn.ensemble import ExtraTreesClassifier import warnings warnings.filterwarnings(‘ignore’) In [2]: df = pd.read_csv(‘data_telco.csv’) In [3]: df.head() Out[3]: customerID gender SeniorCitizen Partner Dependents tenure… Continue reading Data Profiling
Author: Alan
Latihan
Latihan Buatlah variabel dengan nama hobi, yang digunakan untuk menampung input dari user dengan label “Hobi kamu apa? : ” , kemudian Cetaklah dengan label Hobi kamu : {hobi} Buatlah variabel nama, yang digunakan untuk menampung input dari user dengan label “Siapa nama kamu? : ” , misal user mengisikan nama “Romi” maka akan tampil… Continue reading Latihan
Predicting the future with Google BigQuery
Data too large for file format Data too large for file format source Similar Notebooks planes correlation features exercise python and gbq forntite fbnr scrapping code
Diagnosing Slow Parallel Inner Products
In [1]: from IPython.parallel import Client, require, interactive In [2]: rc = Client() dv = rc.direct_view() lv = rc.load_balanced_view() In [3]: with dv.sync_imports(): import numpy importing numpy on engine(s) In [4]: mat = numpy.random.random_sample((800, 800)) mat = numpy.asfortranarray(mat) In [5]: def simple_inner(i): column = mat[:, i] # have to use a list comprehension to prevent closure return sum([numpy.inner(column, mat[:, j])… Continue reading Diagnosing Slow Parallel Inner Products
Parallel Inner Products
In [1]: from IPython.parallel import Client, require, interactive In [5]: rc = Client() dv = rc.direct_view() lv = rc.load_balanced_view() In [6]: with dv.sync_imports(): import numpy importing numpy on engine(s) In [7]: mat = numpy.random.random_sample((800, 800)) mat = numpy.asfortranarray(mat) In [8]: def simple_inner(i): column = mat[:, i] # have to use a list comprehension to prevent closure return sum([numpy.inner(column, mat[:, j])… Continue reading Parallel Inner Products
Timeseries with pandas
Data too large for file format Data too large for file format source Similar Notebooks pandas timeseries embedregression beautifulsoup test
Sum Two Columns Pandas Code Example
Snippet 1 sum_column = df[“col1”] + df[“col2”] Copyright © Code Fetcher 2020
Slicing Lexicographically Pandas Code Example
Snippet 1 Specifically, .loc[] allows you to select all rows with an index lexicographically using slice notation. This works only if the index is sorted (.sort_index()). Copyright © Code Fetcher 2020
Slicing In Pandas Code Example
Snippet 1 # Select rows 0, 1, 2 (row 3 is not selected) surveys_df[0:3] Snippet 2 # iloc[row slicing, column slicing] surveys_df.iloc[0:3, 1:4] Copyright © Code Fetcher 2020
Show All Rows With Nan For A Column Value Pandas Code Example
Snippet 1 df[df[‘col’].isnull()] Copyright © Code Fetcher 2020
See All Columns Pandas Code Example
Snippet 1 pd.set_option(‘display.max_columns’, None) pd.set_option(‘display.max_rows’, None) Snippet 2 pd.set_option(‘max_columns’, None) Snippet 3 pd.options.display.max_columns = None pd.options.display.max_rows = None Similar Snippets Pandas Select All Columns Except One Code Example – pandas How To Drop Columns In Pandas Code Example – pandas Dictionary To A Dataframe Pandas Arrays Must All Be Same Length Code Example – pandas… Continue reading See All Columns Pandas Code Example