promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_

The ML package map — numpy, pandas, sklearn, torch — step 7 of 7

Checkpoint

One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.

Checkpoint. Your team keeps a cheat sheet mapping each ML package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
train a small classifier: from sklearn.linear_model import LogisticRegression
build a neural network: import torch
unknown package: scipy

Checkpoint. Your team keeps a cheat sheet mapping each ML package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
train a small classifier: from sklearn.linear_model import LogisticRegression
build a neural network: import torch
unknown package: scipy

Checkpoint. Your team keeps a cheat sheet mapping each ML package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
train a small classifier: from sklearn.linear_model import LogisticRegression
build a neural network: import torch
unknown package: scipy

Checkpoint. Your team keeps a cheat sheet mapping each ML package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
train a small classifier: from sklearn.linear_model import LogisticRegression
build a neural network: import torch
unknown package: scipy

Checkpoint. Your team keeps a cheat sheet mapping each ML package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
train a small classifier: from sklearn.linear_model import LogisticRegression
build a neural network: import torch
unknown package: scipy

Checkpoint. Your team keeps a cheat sheet mapping each ML package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
train a small classifier: from sklearn.linear_model import LogisticRegression
build a neural network: import torch
unknown package: scipy

Checkpoint. Your team keeps a cheat sheet mapping each table package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
read a text table: import csv
parse an API payload: import json
unknown package: scipy

Checkpoint. Your team keeps a cheat sheet mapping each ML package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
train a small classifier: from sklearn.linear_model import LogisticRegression
build a neural network: import torch
unknown package: scipy

Checkpoint. Your team keeps a cheat sheet mapping each ML package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
train a small classifier: from sklearn.linear_model import LogisticRegression
build a neural network: import torch
unknown package: scipy

Checkpoint. Your team keeps a cheat sheet mapping each ML package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
train a small classifier: from sklearn.linear_model import LogisticRegression
build a neural network: import torch
unknown package: scipy

Checkpoint. Your team keeps a cheat sheet mapping each ML package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
train a small classifier: from sklearn.linear_model import LogisticRegression
build a neural network: import torch
unknown package: scipy

full-screen editor opens — close anytime to keep reading.