Last active
August 5, 2019 19:15
-
-
Save BryanCutler/67147fc69151a7f3a55f5d286d8ce458 to your computer and use it in GitHub Desktop.
TensorFlow Arrow Blog Part 1 - Create Sample DataFrame
This file contains hidden or 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 | |
data = {'label': np.random.binomial(1, 0.5, 10)} | |
data['x0'] = np.random.randn(10) + 5 * data['label'] | |
data['x1'] = np.random.randn(10) + 5 * data['label'] | |
df = pd.DataFrame(data) | |
print(df.head()) | |
# label x0 x1 | |
#0 1 5.241089 6.231621 | |
#1 0 0.527365 0.966182 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment