path stringlengths 13 17 | screenshot_names listlengths 1 873 | code stringlengths 0 40.4k | cell_type stringclasses 1
value |
|---|---|---|---|
72083691/cell_35 | [
"text_html_output_1.png"
] | from mlxtend.frequent_patterns import apriori, association_rules,fpgrowth,fpmax
from mlxtend.preprocessing import TransactionEncoder
from mlxtend.preprocessing import TransactionEncoder
import pandas as pd
import time
data = pd.read_csv('../input/groceries-dataset/Groceries_dataset.csv')
data.shape
all_transacti... | code |
72083691/cell_43 | [
"image_output_1.png"
] | from mlxtend.frequent_patterns import apriori, association_rules,fpgrowth,fpmax
def compute_association_rule(rule_matrix, metric='lift', min_thresh=1):
"""
Compute the final association rule
rule_matrix: the corresponding algorithms matrix
metric: the metric to be used (default is lift)
... | code |
72083691/cell_31 | [
"text_html_output_1.png"
] | from mlxtend.frequent_patterns import apriori, association_rules,fpgrowth,fpmax
def compute_association_rule(rule_matrix, metric='lift', min_thresh=1):
"""
Compute the final association rule
rule_matrix: the corresponding algorithms matrix
metric: the metric to be used (default is lift)
... | code |
72083691/cell_46 | [
"text_plain_output_1.png"
] | from mlxtend.frequent_patterns import apriori, association_rules,fpgrowth,fpmax
from mlxtend.preprocessing import TransactionEncoder
from mlxtend.preprocessing import TransactionEncoder
import pandas as pd
data = pd.read_csv('../input/groceries-dataset/Groceries_dataset.csv')
data.shape
all_transactions = [transa... | code |
72083691/cell_24 | [
"text_html_output_1.png"
] | val = {'name': 12}
value = list(val.items())[0]
value | code |
72083691/cell_14 | [
"text_html_output_1.png"
] | import pandas as pd
data = pd.read_csv('../input/groceries-dataset/Groceries_dataset.csv')
data.shape
all_transactions = [transaction[1]['itemDescription'].tolist() for transaction in list(data.groupby(['Member_number', 'Date']))]
len(all_transactions) | code |
72083691/cell_27 | [
"text_plain_output_1.png"
] | fpgrowth_matrix.head() | code |
72083691/cell_37 | [
"text_html_output_1.png"
] | apriori_matrix.tail() | code |
72083691/cell_12 | [
"text_plain_output_1.png"
] | import pandas as pd
data = pd.read_csv('../input/groceries-dataset/Groceries_dataset.csv')
data.shape
data.head() | code |
72083691/cell_36 | [
"text_plain_output_1.png"
] | apriori_matrix.head() | code |
106212906/cell_21 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
total_restaurent = df_new['Area'].value_counts()
total_restaurent | code |
106212906/cell_13 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
category = df_new['Category'].value_counts(ascending=False)
category | code |
106212906/cell_25 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
df_new.describe() | code |
106212906/cell_23 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
df_new['Cost for Two (in Rupees)'].unique() | code |
106212906/cell_30 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
df1 = df_new['Category'].value_counts()
df1
df2 = df1.iloc[1:]
d... | code |
106212906/cell_33 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
df1 = df_new['Category'].value_counts()
df1
df2 = df1.iloc[1:]
d... | code |
106212906/cell_20 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].unique() | code |
106212906/cell_29 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
df1 = df_new['Category'].value_counts()
df1 | code |
106212906/cell_26 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
df_new.head() | code |
106212906/cell_11 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.head() | code |
106212906/cell_19 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new.head() | code |
106212906/cell_7 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df.head() | code |
106212906/cell_18 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape | code |
106212906/cell_32 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
df1 = df_new['Category'].value_counts()
df1
df2 = df1.iloc[1:]
d... | code |
106212906/cell_28 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
df_new.head() | code |
106212906/cell_8 | [
"text_plain_output_1.png",
"image_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df.info() | code |
106212906/cell_16 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
category = df_new['Category'].value_counts(ascending=False)
category
category_less_then_100 = category[category < 100]
category_less_then_100
def handl... | code |
106212906/cell_3 | [
"text_plain_output_2.png",
"application_vnd.jupyter.stderr_output_1.png",
"image_output_1.png"
] | from IPython.display import Image
Image('../input/swiggy/swiggy.jpg', width=750) | code |
106212906/cell_17 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape | code |
106212906/cell_35 | [
"text_html_output_1.png"
] | import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
plt.xtick... | code |
106212906/cell_24 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
df_new['Cost for Two (in Rupees)'].value_counts() | code |
106212906/cell_14 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
category = df_new['Category'].value_counts(ascending=False)
category
category_less_then_100 = category[category < 100]
category_less_then_100 | code |
106212906/cell_22 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
df_new.head() | code |
106212906/cell_10 | [
"image_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df.head() | code |
106212906/cell_27 | [
"text_plain_output_1.png"
] | import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new.shape
df_new.drop_duplicates(inplace=True)
df_new.shape
df_new['Area'].dropna
plt.figur... | code |
106212906/cell_12 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')
df = df.drop(['Offer'], axis=1)
df_new = df.drop(['Rating', 'URL'], axis=1)
df_new['Category'].nunique() | code |
32065944/cell_25 | [
"text_plain_output_1.png",
"image_output_1.png"
] | import matplotlib.pyplot as plt
import seaborn as sns
sns.clustermap(data=distance_matrix, col_linkage=Z, row_linkage=Z, cmap=plt.get_cmap('RdBu')) | code |
32065944/cell_34 | [
"text_plain_output_1.png"
] | import gc
del clustermap
del distance_matrix
del distances
del Z
gc.collect() | code |
32065944/cell_20 | [
"text_plain_output_1.png"
] | from sklearn.feature_extraction.text import TfidfVectorizer
import numpy as np
import pandas as pd
df = pd.read_csv('/kaggle/input/cleaning-cord-19-metadata/cord_metadata_cleaned.csv')
df = df.dropna(subset=['text_simplified']).reset_index(drop=True)
tfidf_vectorizer = TfidfVectorizer(input='content', lowercase=Fal... | code |
32065944/cell_40 | [
"image_output_1.png"
] | from itertools import chain
import pandas as pd
df = pd.read_csv('/kaggle/input/cleaning-cord-19-metadata/cord_metadata_cleaned.csv')
df = df.dropna(subset=['text_simplified']).reset_index(drop=True)
tokens = df['text_simplified'].str.split(' ').tolist()
tokens = pd.Series(chain(*tokens))
tokens_count = tokens.value... | code |
32065944/cell_29 | [
"image_output_1.png"
] | from itertools import chain
import pandas as pd
df = pd.read_csv('/kaggle/input/cleaning-cord-19-metadata/cord_metadata_cleaned.csv')
df = df.dropna(subset=['text_simplified']).reset_index(drop=True)
tokens = df['text_simplified'].str.split(' ').tolist()
tokens = pd.Series(chain(*tokens))
tokens_count = tokens.value... | code |
32065944/cell_2 | [
"text_plain_output_1.png"
] | !pip install fastcluster | code |
32065944/cell_28 | [
"image_output_1.png"
] | from itertools import chain
import pandas as pd
df = pd.read_csv('/kaggle/input/cleaning-cord-19-metadata/cord_metadata_cleaned.csv')
df = df.dropna(subset=['text_simplified']).reset_index(drop=True)
tokens = df['text_simplified'].str.split(' ').tolist()
tokens = pd.Series(chain(*tokens))
tokens_count = tokens.value... | code |
32065944/cell_16 | [
"image_output_1.png"
] | from sklearn.feature_extraction.text import TfidfVectorizer
import pandas as pd
df = pd.read_csv('/kaggle/input/cleaning-cord-19-metadata/cord_metadata_cleaned.csv')
df = df.dropna(subset=['text_simplified']).reset_index(drop=True)
tfidf_vectorizer = TfidfVectorizer(input='content', lowercase=False, preprocessor=lam... | code |
32065944/cell_43 | [
"image_output_1.png"
] | from itertools import chain
import pandas as pd
df = pd.read_csv('/kaggle/input/cleaning-cord-19-metadata/cord_metadata_cleaned.csv')
df = df.dropna(subset=['text_simplified']).reset_index(drop=True)
tokens = df['text_simplified'].str.split(' ').tolist()
tokens = pd.Series(chain(*tokens))
tokens_count = tokens.value... | code |
32065944/cell_31 | [
"text_plain_output_1.png",
"image_output_1.png"
] | from itertools import chain
from scipy.cluster.hierarchy import fcluster
from sklearn.feature_extraction.text import TfidfVectorizer
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
df = pd.read_csv('/kaggle/input/cleaning-cord-19-... | code |
32065944/cell_46 | [
"text_html_output_1.png"
] | from itertools import chain
from scipy.cluster.hierarchy import fcluster
from sklearn.feature_extraction.text import TfidfVectorizer
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
df = pd.read_csv('/kaggle/input/cleaning-cord-19-... | code |
32065944/cell_24 | [
"text_plain_output_1.png"
] | distances = squareform(distance_matrix, force='tovector')
Z = fastcluster.linkage(distances, method='complete', preserve_input=True) | code |
32065944/cell_14 | [
"image_output_1.png"
] | from itertools import chain
import pandas as pd
df = pd.read_csv('/kaggle/input/cleaning-cord-19-metadata/cord_metadata_cleaned.csv')
df = df.dropna(subset=['text_simplified']).reset_index(drop=True)
tokens = df['text_simplified'].str.split(' ').tolist()
tokens = pd.Series(chain(*tokens))
tokens_count = tokens.value... | code |
32065944/cell_22 | [
"text_plain_output_1.png"
] | distance_matrix = pairwise_distances(features_sample, metric='cosine') | code |
32065944/cell_10 | [
"text_plain_output_1.png"
] | from itertools import chain
import pandas as pd
df = pd.read_csv('/kaggle/input/cleaning-cord-19-metadata/cord_metadata_cleaned.csv')
df = df.dropna(subset=['text_simplified']).reset_index(drop=True)
tokens = df['text_simplified'].str.split(' ').tolist()
tokens = pd.Series(chain(*tokens))
tokens_count = tokens.value... | code |
32065944/cell_27 | [
"image_output_1.png"
] | from itertools import chain
import pandas as pd
df = pd.read_csv('/kaggle/input/cleaning-cord-19-metadata/cord_metadata_cleaned.csv')
df = df.dropna(subset=['text_simplified']).reset_index(drop=True)
tokens = df['text_simplified'].str.split(' ').tolist()
tokens = pd.Series(chain(*tokens))
tokens_count = tokens.value... | code |
32065944/cell_12 | [
"text_plain_output_1.png"
] | from itertools import chain
import pandas as pd
df = pd.read_csv('/kaggle/input/cleaning-cord-19-metadata/cord_metadata_cleaned.csv')
df = df.dropna(subset=['text_simplified']).reset_index(drop=True)
tokens = df['text_simplified'].str.split(' ').tolist()
tokens = pd.Series(chain(*tokens))
tokens_count = tokens.value... | code |
32065944/cell_36 | [
"text_plain_output_1.png"
] | from itertools import chain
from scipy.cluster.hierarchy import fcluster
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.neighbors import KNeighborsClassifier
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sn... | code |
90111983/cell_13 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/chinas-population-by-gender-and-urbanrural/Chinas Population En.csv')
df.columns = ['year', 'total', 'male', 'female', 'urban', 'rural']
df.sort_values(by='year', ignore_index=True, inplace=True)
print('Cases of nonconformity by gender: {}'.format(sum(df['total'] - df['... | code |
90111983/cell_9 | [
"text_plain_output_1.png",
"image_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/chinas-population-by-gender-and-urbanrural/Chinas Population En.csv')
df.columns = ['year', 'total', 'male', 'female', 'urban', 'rural']
df.sort_values(by='year', ignore_index=True, inplace=True)
df.head() | code |
90111983/cell_23 | [
"text_plain_output_1.png"
] | import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv('../input/chinas-population-by-gender-and-urbanrural/Chinas Population En.csv')
df.columns = ['year', 'total', 'male', 'female', 'urban', 'rural']
df.sort_values(by='year', ignore_index=True, inplace=True)
tmp_mask = df['total'] - df['male'] - df[... | code |
90111983/cell_20 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/chinas-population-by-gender-and-urbanrural/Chinas Population En.csv')
df.columns = ['year', 'total', 'male', 'female', 'urban', 'rural']
df.sort_values(by='year', ignore_index=True, inplace=True)
tmp_mask = df['total'] - df['male'] - df['female'] != 0
df[tmp_mask]
df.l... | code |
90111983/cell_29 | [
"image_output_1.png"
] | import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import pandas as pd
df = pd.read_csv('../input/chinas-population-by-gender-and-urbanrural/Chinas Population En.csv')
df.columns = ['year', 'total', 'male', 'female', 'urban', 'rural']
df.sort_values(by='year', ignore_index=True, inplace=True)
tmp_ma... | code |
90111983/cell_26 | [
"text_html_output_1.png"
] | import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import pandas as pd
df = pd.read_csv('../input/chinas-population-by-gender-and-urbanrural/Chinas Population En.csv')
df.columns = ['year', 'total', 'male', 'female', 'urban', 'rural']
df.sort_values(by='year', ignore_index=True, inplace=True)
tmp_ma... | code |
90111983/cell_11 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/chinas-population-by-gender-and-urbanrural/Chinas Population En.csv')
df.columns = ['year', 'total', 'male', 'female', 'urban', 'rural']
df.sort_values(by='year', ignore_index=True, inplace=True)
df.info() | code |
90111983/cell_7 | [
"image_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/chinas-population-by-gender-and-urbanrural/Chinas Population En.csv')
df.head() | code |
90111983/cell_18 | [
"text_html_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/chinas-population-by-gender-and-urbanrural/Chinas Population En.csv')
df.columns = ['year', 'total', 'male', 'female', 'urban', 'rural']
df.sort_values(by='year', ignore_index=True, inplace=True)
tmp_mask = df['total'] - df['male'] - df['female'] != 0
df[tmp_mask]
df.l... | code |
90111983/cell_15 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/chinas-population-by-gender-and-urbanrural/Chinas Population En.csv')
df.columns = ['year', 'total', 'male', 'female', 'urban', 'rural']
df.sort_values(by='year', ignore_index=True, inplace=True)
tmp_mask = df['total'] - df['male'] - df['female'] != 0
df[tmp_mask] | code |
90111983/cell_16 | [
"text_plain_output_1.png"
] | import pandas as pd
df = pd.read_csv('../input/chinas-population-by-gender-and-urbanrural/Chinas Population En.csv')
df.columns = ['year', 'total', 'male', 'female', 'urban', 'rural']
df.sort_values(by='year', ignore_index=True, inplace=True)
tmp_mask = df['total'] - df['male'] - df['female'] != 0
df[tmp_mask]
df.l... | code |
1006102/cell_4 | [
"image_output_1.png"
] | import matplotlib.pyplot as plt
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
data = pd.read_csv('../input/database.csv', low_memory=False)
f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(13, 15))
crims_by_relationship = data[['Relationship', 'Record ID']].groupby('Relationship').... | code |
1006102/cell_6 | [
"application_vnd.jupyter.stderr_output_1.png"
] | import matplotlib.pyplot as plt
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import seaborn as sns
import sklearn.cluster as cluster
data = pd.read_csv('../input/database.csv', low_memory=False)
f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=... | code |
1006102/cell_2 | [
"text_html_output_1.png"
] | import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
data = pd.read_csv('../input/database.csv', low_memory=False)
data.head() | code |
1006102/cell_1 | [
"text_plain_output_1.png"
] | from subprocess import check_output
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from subprocess import check_output
print(check_output(['ls', '../input']).decode('utf8')) | code |
1006102/cell_3 | [
"text_plain_output_1.png",
"image_output_1.png"
] | import matplotlib.pyplot as plt
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
data = pd.read_csv('../input/database.csv', low_memory=False)
f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(13, 15))
crims_by_relationship = data[['Relationship', 'Record ID']].groupby('Relationship').c... | code |
1006102/cell_5 | [
"text_html_output_1.png"
] | import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
data = pd.read_csv('../input/database.csv', low_memory=False)
victims = data[['Victim Sex', 'Victim Age', 'Victim Ethnicity', 'Victim Race']]
victims.head() | code |
89138671/cell_6 | [
"application_vnd.jupyter.stderr_output_1.png"
] | y = data.pop('target')
X = data.drop(columns=['row_id']) | code |
89138671/cell_3 | [
"text_plain_output_1.png"
] | data = pd.read_pickle('../input/ump-train-picklefile/train.pkl')
data.drop(columns=['row_id'], inplace=True) | code |
89138671/cell_5 | [
"image_output_11.png",
"image_output_17.png",
"image_output_14.png",
"image_output_13.png",
"image_output_5.png",
"image_output_18.png",
"image_output_7.png",
"image_output_20.png",
"image_output_4.png",
"image_output_8.png",
"image_output_16.png",
"image_output_6.png",
"image_output_12.png"... | for investment in np.random.choice(pd.unique(data['investment_id']), 20):
data[data['investment_id'] == investment].plot('time_id', 'target') | code |
34121141/cell_9 | [
"text_plain_output_1.png"
] | from keras.preprocessing.image import ImageDataGenerator
train_datagen = ImageDataGenerator(rescale=1.0 / 255.0)
test_datagen = ImageDataGenerator(rescale=1.0 / 255.0)
train_it = train_datagen.flow_from_directory('/kaggle/input/dataset/train/', class_mode='categorical', batch_size=10, target_size=(224, 224))
test_it =... | code |
34121141/cell_7 | [
"text_plain_output_1.png"
] | from keras.applications.vgg16 import VGG16
from keras.layers import Dense, Conv2D, MaxPooling2D, Dropout, BatchNormalization, Activation
from keras.layers import Flatten
from keras.models import Model, Sequential
from keras.optimizers import SGD
from keras.preprocessing.image import ImageDataGenerator
from matplo... | code |
34121141/cell_8 | [
"text_plain_output_1.png"
] | from keras.applications.vgg16 import VGG16
from keras.layers import Dense, Conv2D, MaxPooling2D, Dropout, BatchNormalization, Activation
from keras.layers import Flatten
from keras.models import Model, Sequential
from keras.optimizers import SGD
from keras.preprocessing.image import ImageDataGenerator
from matplo... | code |
128012372/cell_21 | [
"image_output_1.png"
] | from keras import regularizers
from keras.callbacks import ModelCheckpoint, CSVLogger, TensorBoard, EarlyStopping, ReduceLROnPlateau
from keras.layers import Conv2D, Dense, BatchNormalization, Activation, Dropout, MaxPooling2D, Flatten
from tensorflow.keras.optimizers import Adam, RMSprop, SGD
from tensorflow.keras... | code |
128012372/cell_13 | [
"text_plain_output_1.png"
] | from tensorflow.keras.preprocessing.image import ImageDataGenerator, load_img
import os
import pandas as pd
train_dir = '/kaggle/input/happy-sad-7125/train/'
test_dir = '/kaggle/input/happy-sad-7125/test/'
row, col = (48, 48)
classes = 2
def count_exp(path, set_):
dict_ = {}
for expression in os.listdir(path... | code |
128012372/cell_9 | [
"text_plain_output_1.png"
] | import os
import pandas as pd
train_dir = '/kaggle/input/happy-sad-7125/train/'
test_dir = '/kaggle/input/happy-sad-7125/test/'
row, col = (48, 48)
classes = 2
def count_exp(path, set_):
dict_ = {}
for expression in os.listdir(path):
dir_ = path + expression
dict_[expression] = len(os.listdir(... | code |
128012372/cell_25 | [
"text_plain_output_1.png"
] | from keras import regularizers
from keras.callbacks import ModelCheckpoint, CSVLogger, TensorBoard, EarlyStopping, ReduceLROnPlateau
from keras.layers import Conv2D, Dense, BatchNormalization, Activation, Dropout, MaxPooling2D, Flatten
from tensorflow.keras.optimizers import Adam, RMSprop, SGD
from tensorflow.keras... | code |
128012372/cell_23 | [
"text_plain_output_1.png"
] | from keras import regularizers
from keras.callbacks import ModelCheckpoint, CSVLogger, TensorBoard, EarlyStopping, ReduceLROnPlateau
from keras.layers import Conv2D, Dense, BatchNormalization, Activation, Dropout, MaxPooling2D, Flatten
from tensorflow.keras.optimizers import Adam, RMSprop, SGD
from tensorflow.keras... | code |
128012372/cell_7 | [
"application_vnd.jupyter.stderr_output_2.png",
"text_plain_output_3.png",
"text_plain_output_1.png"
] | import os
import pandas as pd
train_dir = '/kaggle/input/happy-sad-7125/train/'
test_dir = '/kaggle/input/happy-sad-7125/test/'
row, col = (48, 48)
classes = 2
def count_exp(path, set_):
dict_ = {}
for expression in os.listdir(path):
dir_ = path + expression
dict_[expression] = len(os.listdir(... | code |
128012372/cell_18 | [
"text_plain_output_1.png",
"image_output_1.png"
] | from keras import regularizers
from keras.layers import Conv2D, Dense, BatchNormalization, Activation, Dropout, MaxPooling2D, Flatten
from tensorflow.keras.optimizers import Adam, RMSprop, SGD
import os
import pandas as pd
import tensorflow as tf
tf.config.list_physical_devices('GPU')
train_dir = '/kaggle/input/... | code |
128012372/cell_8 | [
"image_output_1.png"
] | import os
import pandas as pd
train_dir = '/kaggle/input/happy-sad-7125/train/'
test_dir = '/kaggle/input/happy-sad-7125/test/'
row, col = (48, 48)
classes = 2
def count_exp(path, set_):
dict_ = {}
for expression in os.listdir(path):
dir_ = path + expression
dict_[expression] = len(os.listdir(... | code |
128012372/cell_3 | [
"text_plain_output_1.png"
] | import numpy as np
import pandas as pd
import os
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.preprocessing.image import ImageDataGenerator, load_img
from keras.layers import Conv2D, Dense, BatchNormalization, Activation, Dropout, MaxPooling2D, Flatten
from tensorflow.keras.optimizers impo... | code |
128012372/cell_17 | [
"text_plain_output_1.png",
"image_output_1.png"
] | import os
import pandas as pd
train_dir = '/kaggle/input/happy-sad-7125/train/'
test_dir = '/kaggle/input/happy-sad-7125/test/'
row, col = (48, 48)
classes = 2
def count_exp(path, set_):
dict_ = {}
for expression in os.listdir(path):
dir_ = path + expression
dict_[expression] = len(os.listdir(... | code |
128012372/cell_10 | [
"application_vnd.jupyter.stderr_output_1.png"
] | from tensorflow.keras.preprocessing.image import ImageDataGenerator, load_img
import matplotlib.pyplot as plt
import os
import pandas as pd
train_dir = '/kaggle/input/happy-sad-7125/train/'
test_dir = '/kaggle/input/happy-sad-7125/test/'
row, col = (48, 48)
classes = 2
def count_exp(path, set_):
dict_ = {}
... | code |
128012372/cell_12 | [
"text_plain_output_1.png"
] | from tensorflow.keras.preprocessing.image import ImageDataGenerator, load_img
import os
import pandas as pd
train_dir = '/kaggle/input/happy-sad-7125/train/'
test_dir = '/kaggle/input/happy-sad-7125/test/'
row, col = (48, 48)
classes = 2
def count_exp(path, set_):
dict_ = {}
for expression in os.listdir(path... | code |
128012372/cell_5 | [
"text_plain_output_1.png"
] | import tensorflow as tf
tf.config.list_physical_devices('GPU') | code |
2017333/cell_21 | [
"text_plain_output_1.png"
] | from subprocess import check_output
print(check_output(['ls', '../working']).decode('utf8')) | code |
2017333/cell_13 | [
"text_html_output_1.png"
] | from sklearn import svm
from sklearn import svm
clf = svm.SVC()
clf.fit(X_train, Y_train)
clf.score(X_train, Y_train) | code |
2017333/cell_4 | [
"text_plain_output_1.png"
] | import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
train = pd.read_csv('../input/train.csv')
test = pd.read_csv('../input/test.csv')
PassengerIds = test['PassengerId']
PassengerIds | code |
2017333/cell_2 | [
"text_plain_output_1.png"
] | import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
train = pd.read_csv('../input/train.csv')
train.head() | code |
2017333/cell_11 | [
"text_html_output_1.png"
] | X_train.head() | code |
2017333/cell_19 | [
"text_plain_output_1.png"
] | from sklearn import svm
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
train = pd.read_csv('../input/train.csv')
test = pd.read_csv('../input/test.csv')
PassengerIds = test['PassengerId']
PassengerIds
train['Sex'] = train['Sex'].apply(lambda x: 1 if x ==... | code |
2017333/cell_1 | [
"text_plain_output_1.png"
] | from subprocess import check_output
import numpy as np
import pandas as pd
from subprocess import check_output
print(check_output(['ls', '../input']).decode('utf8')) | code |
2017333/cell_8 | [
"text_plain_output_1.png"
] | import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
train = pd.read_csv('../input/train.csv')
train['Sex'] = train['Sex'].apply(lambda x: 1 if x == 'male' else 0)
train = train[['Survived', 'Pclass', 'Sex', 'Age', 'SibSp', 'Parch', 'Fare']]
train.head() | code |
2017333/cell_15 | [
"application_vnd.jupyter.stderr_output_1.png"
] | from sklearn import svm
from sklearn import svm
clf = svm.SVC()
clf.fit(X_train, Y_train)
clf.score(X_train, Y_train)
clf.fit(X_test, Y_test)
clf.score(X_test, Y_test) | code |
2017333/cell_3 | [
"text_plain_output_1.png"
] | import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
train = pd.read_csv('../input/train.csv')
test = pd.read_csv('../input/test.csv')
test.head() | code |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.