Skip to content

Instantly share code, notes, and snippets.

@BryanCutler
Last active August 5, 2019 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BryanCutler/67147fc69151a7f3a55f5d286d8ce458 to your computer and use it in GitHub Desktop.
Save BryanCutler/67147fc69151a7f3a55f5d286d8ce458 to your computer and use it in GitHub Desktop.
TensorFlow Arrow Blog Part 1 - Create Sample DataFrame
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