This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df = pd.read_csv("https://github.com/selva86/datasets/raw/master/economics.csv") | |
df.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
df = pd.read_csv('Datasets\Titanic.csv').sample(50, random_state=100) | |
n_missing = np.random.randint(4, 15, 1) | |
for i in range(n_missing): | |
row = np.random.randint(1, df.shape[0]) | |
df.at[row, "Age"] = pd.NA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Solution | |
import pandas as pd | |
import numpy as np | |
df1 = pd.read_csv("Datasets/table1.csv") | |
df2 = pd.read_csv("Datasets/table2.csv") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Input | |
import numpy as np | |
np.random.seed(100) | |
arr = pd.Series(np.random.normal(10, 3, (100))) | |
arr.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
df = pd.read_csv('Datasets/Tips100.csv') | |
df.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
df = pd.read_csv('Datasets/Tips100.csv') | |
df.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
dfc = pd.DataFrame(np.zeros((1000, 1000), dtype='int')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1 | |
index = [1,2,3,4,5] | |
col1 = list('abcde') | |
col2 = list('pqrst') | |
# 2 | |
# column names: 'name' and 'age' | |
lst = [['Bunny', 25], ['Sunny', 30], | |
['Funny', 26], ['Hunny', 22]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TRAIN_DATA = [("Pizza is a common fast food.", {"entities": [(0, 5, "FOOD")]}), | |
("We ate dosa yesterday.", {"entities": [(7, 11, "FOOD")]}), | |
("Pasta is an italian recipe", {"entities": [(0, 5, "FOOD")]}), | |
("China's noodles are very famous", {"entities": [(8,15, "FOOD")]}), | |
("Shrimps are famous in China too", {"entities": [(0,7, "FOOD")]}), | |
("Lasagna is another classic of Italy", {"entities": [(0,7, "FOOD")]}), | |
("Unagi is a famous seafood of Japan", {"entities": [(0,5, "FOOD")]}), | |
("Tempura , Soba are other famous dishes of Japan", {"entities": [(0,7, "FOOD")]}), | |
("Udon is a healthy type of noodles", {"entities": [(0,4, "ORG")]}), | |
("Chocolate soufflé is extremely famous french cuisine", {"entities": [(0,17, "FOOD")]}), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TRAIN_DATA =[ ("Pizza is a common fast food.", {"entities": [(0, 5, "FOOD")]}), | |
("Pasta is an italian recipe", {"entities": [(0, 5, "FOOD")]}), | |
("China's noodles are very famous", {"entities": [(8,14, "FOOD")]}), | |
("Shrimps are famous in China too", {"entities": [(0,7, "FOOD")]}), | |
("Lasagna is another classic of Italy", {"entities": [(0,7, "FOOD")]}), | |
("Sushi is extemely famous and expensive Japanese dish", {"entities": [(0,5, "FOOD")]}), | |
("Unagi is a famous seafood of Japan", {"entities": [(0,5, "FOOD")]}), | |
("Tempura , Soba are other famous dishes of Japan", {"entities": [(0,7, "FOOD")]}), | |
("Udon is a healthy type of noodles", {"entities": [(0,4, "ORG")]}), | |
("Chocolate soufflé is extremely famous french cuisine", {"entities": [(0,17, "FOOD")]}), |