Datasets:
Unnamed: 0 int64 0 16k | text_prompt stringlengths 110 62.1k | code_prompt stringlengths 37 152k |
|---|---|---|
0 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
Homework 1
Step1: If you've set up your environment properly, this cell should run without problems
Step2: Now, run this cell to log into OkPy.
This is the submission system for the class;... | Python Code:
!pip install -U okpy
Explanation: Homework 1: Setup and (Re-)Introduction to Python
Course Policies
Here are some important course policies. These are also located at
http://www.ds100.org/sp17/.
Tentative Grading
There will be 7 challenging homework assignments. Homeworks must be completed
individually and... |
1 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
Step1: Accessing C Struct Data
This notebook illustrates the use of @cfunc to connect to data defined in C.
Via CFFI
Numba can map simple C structure types (i.e. with scalar members only) in... | Python Code:
from cffi import FFI
src =
/* Define the C struct */
typedef struct my_struct {
int i1;
float f2;
double d3;
float af4[7];
} my_struct;
/* Define a callback function */
typedef double (*my_func)(my_struct*, size_t);
ffi = FFI()
ffi.cdef(src)
Explanation: Accessing C Struct Data
This n... |
2 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
Pandas and Friends
Austin Godber
Mail
Step1: Background - NumPy - Arrays
Step2: Background - NumPy - Arrays
Arrays have NumPy specific types, dtypes, and can be operated on.
Step3: Now, o... | Python Code:
import numpy as np
# np.zeros, np.ones
data0 = np.zeros((2, 4))
data0
# Make an array with 20 entries 0..19
data1 = np.arange(20)
# print the first 8
data1[0:8]
Explanation: Pandas and Friends
Austin Godber
Mail: godber@uberhip.com
Twitter: @godber
Presented at DesertPy, Jan 2015.
What does it do?
Pandas i... |
3 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
k-Nearest Neighbor (kNN) exercise
Complete and hand in this completed worksheet (including its outputs and any supporting code outside of the worksheet) with your assignment submission. For ... | Python Code:
# Run some setup code for this notebook.
import random
import numpy as np
from cs231n.data_utils import load_CIFAR10
import matplotlib.pyplot as plt
# This is a bit of magic to make matplotlib figures appear inline in the notebook
# rather than in a new window.
%matplotlib inline
plt.rcParams['figure.figsi... |
4 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
正向传播和反向传播实现
反向传播算法
之前我们在计算神经网络预测结果的时候我们采用了一种正向传播方法,我们从第一层开始正向一层一层进行计算,直到最后一层的$h_{\theta}\left(x\right)$。
现在,为了计算代价函数的偏导数$\frac{\partial}{\partial\Theta^{(l)}_{ij}}J\left(\Theta\right)$,我们需要采... | Python Code:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
from scipy.io import loadmat
from sklearn.preprocessing import OneHotEncoder
data = loadmat('../data/andrew_ml_ex33507/ex3data1.mat')
data
X = data['X']
y = data['y']
X.shape, y.shape#看下维度
# 目前考虑输入是图片的像素值,20*20像素的图片有40... |
5 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about emb... | Python Code:
import time
import numpy as np
import tensorflow as tf
import utils
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural lang... |
6 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
The goal of this post is to investigate if it is possible to query the NGDC CSW Catalog to extract records matching an IOOS RA acronym, like SECOORA for example.
In the cell above we do the ... | Python Code:
from owslib.csw import CatalogueServiceWeb
endpoint = 'http://www.ngdc.noaa.gov/geoportal/csw'
csw = CatalogueServiceWeb(endpoint, timeout=30)
Explanation: The goal of this post is to investigate if it is possible to query the NGDC CSW Catalog to extract records matching an IOOS RA acronym, like SECOORA fo... |
7 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
One Dimensional Visualisation
Data from https
Step1: Assign column headers to the dataframe
Step2: Refine the Data
Step3: Clean Rows & Columns
Lets start by dropping redundant columns - i... | Python Code:
import pandas as pd
# Read in the airports data.
airports = pd.read_csv("../data/airports.dat.txt", header=None, na_values=['\\N'], dtype=str)
# Read in the airlines data.
airlines = pd.read_csv("../data/airlines.dat.txt", header=None, na_values=['\\N'], dtype=str)
# Read in the routes data.
routes = pd.re... |
8 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
<img src="images/JHI_STRAP_Web.png" style="width
Step1: Microarray data <a id="microarray_data"></a>
<div class="alert alert-warning">
Raw array data was previously converted to plain text ... | Python Code:
%pylab inline
import os
import random
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import scipy
import seaborn as sns
from Bio import SeqIO
import tools
Explanation: <img src="images/JHI_STRAP_Web.png" style="width: 150px; float: right;">
Supplementary Informatio... |
9 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
<a id="navigation"></a>
Hi-C data analysis
Welcome to the Jupyter notebook dedicated to Hi-C data analysis. Here we will be working in interactive Python environment with some mixture of bas... | Python Code:
# This is regular Python comment inside Jupyter "Code" cell.
# You can easily run "Hello world" in the "Code" cell (focus on the cell and press Shift+Enter):
print("Hello world!")
Explanation: <a id="navigation"></a>
Hi-C data analysis
Welcome to the Jupyter notebook dedicated to Hi-C data analysis. Here w... |
10 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
<a href="https
Step1: Download and Explore the Data
Step2: <h6> Plot the Data Points </h6>
Step3: Looking at the scatter plot we can analyse that there is a linear relationship between th... | Python Code:
import tensorflow as tf
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
pd.__version__
Explanation: <a href="https://www.bigdatauniversity.com"><img src = "https://ibm.box.com/shared/static/jvcqp2iy2jlx2b32rmzdt0tx8lvxgzkp.png" width = 300, align = "center"></a>
<h1 align=center> <fo... |
11 | Given the following text description, write Python code to implement the functionality described below step by step
Description:
xpath always returns a list of results, but there's only one, so we'll use that
Step2: Why is there only one element? I don't know and don't have the time to care, so I'll write
a helper fu... | Python Code:
xpath_result = tree.xpath('/html/body/div[3]/div[3]/div[4]/div/table[2]')
table = xpath_result[0]
for elem in table:
print(elem)
Explanation: xpath always returns a list of results, but there's only one, so we'll use that:
End of explanation
def print_outline(tree, indent=0):
print the outline of t... |
YAML Metadata Warning:The task_categories "conversational" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
Dataset description:
The Python Code Chatbot dataset is a collection of Python code snippets extracted from various publicly available datasets and platforms. It is designed to facilitate training conversational AI models that can understand and generate Python code. The dataset consists of a total of 1,37,183 prompts, each representing a dialogue between a human and an AI Scientist.
Prompt Card:
Each prompt in the dataset follows a specific format known as the "Prompt Card." The format is as follows:
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
Problem:
Problem described in human language
Python Code:
Human written Code
The length of the prompts varies within a range of 201 to 2590 tokens. The dataset offers a diverse set of conversational scenarios related to Python programming, covering topics such as code execution, debugging, best practices, code optimization, and more.
How to use:
To access the Python Code Chatbot dataset seamlessly, you can leverage the powerful "datasets" library. The following code snippet illustrates how to load the dataset:
from datasets import load_dataset
dataset = load_dataset("anujsahani01/TextCodeDepot")
Potential Use Cases:
This dataset can be utilized for various natural language processing tasks such as question-answering, conversational AI, and text generation. Some potential use cases for this dataset include:
- Training chatbots or virtual assistants that can understand and respond to Python-related queries from users.
- Developing AI models capable of generating Python code snippets based on user input or conversational context.
- Improving code completion systems by incorporating conversational context and user intent.
- Assisting programmers in debugging their Python code by providing relevant suggestions or explanations.
Feedback:
If you have any feedback, please reach out to me at: LinkedIn | GitHub
Your feedback is valuable in improving the quality and usefulness of this dataset.
Author: @anujsahani01
Happy Fine-tuning 🤗
- Downloads last month
- 140