Python ile TensorFlow’a Giriş
Isaiah Hull
Visiting Associate Professor of Finance, BI Norwegian Business School

tensorflow ile içe aktarılabilirpandas ile içe aktarınnumpy dizisine dönüştürüntensorflow içinde doğrudan kullanın# 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()| Parametre | Açıklama | Varsayılan |
|---|---|---|
filepath_or_buffer |
Dosya yolu veya URL alır. | None |
sep |
Sütun ayırıcı. | , |
delim_whitespace |
Boşlukla ayırma için Boole değeri. | False |
encoding |
Gerekirse kullanılacak kodlamayı belirtir. | 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)
Python ile TensorFlow’a Giriş