Introductie tot TensorFlow in Python
Isaiah Hull
Visiting Associate Professor of Finance, BI Norwegian Business School

tensorflowpandasnumpy-arraytensorflow zonder aanpassing# Import numpy and pandas
import numpy as np
import pandas as pd
# Load data from csv
housing = pd.read_csv('kc_housing.csv')
# Convert to numpy array
housing = np.array(housing)
read_json(), read_html(), read_excel()| Parameter | Beschrijving | Standaard |
|---|---|---|
filepath_or_buffer |
Accepteert een bestandspad of URL. | None |
sep |
Scheidingsteken tussen kolommen. | , |
delim_whitespace |
Boolean om op witruimte te scheiden. | False |
encoding |
Te gebruiken codering, indien van toepassing. | None |


# Load KC dataset
housing = pd.read_csv('kc_housing.csv')
# Convert price column to float32
price = np.array(housing['price'], np.float32)
# Convert waterfront column to Boolean
waterfront = np.array(housing['waterfront'], np.bool)
# Load KC dataset
housing = pd.read_csv('kc_housing.csv')
# Convert price column to float32
price = tf.cast(housing['price'], tf.float32)
# Convert waterfront column to Boolean
waterfront = tf.cast(housing['waterfront'], tf.bool)
Introductie tot TensorFlow in Python