SAS*_*OVA 5 python pandas tensorflow
我正在关注Google的机器学习速成课程,以便我可以继续使用TensorFlow.但是,当我尝试使用TensorFlow执行第一步中的代码时,我从以下行得不到输出:
california_housing_dataframe.describe()
Run Code Online (Sandbox Code Playgroud)
这是我的完整代码,以防它有帮助:
import math
from IPython import display
from matplotlib import cm
from matplotlib import gridspec
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
from sklearn import metrics
import tensorflow as tf
from tensorflow.python.data import Dataset
tf.logging.set_verbosity(tf.logging.ERROR)
pd.options.display.max_rows = 10
pd.options.display.float_format = '{:.1f}'.format
california_housing_dataframe = pd.read_csv("https://storage.googleapis.com/mledu-datasets/california_housing_train.csv", sep=",")
california_housing_dataframe = california_housing_dataframe.reindex(np.random.permutation(california_housing_dataframe.index))
california_housing_dataframe["median_house_value"] /= 1000.0
california_housing_dataframe.describe()
Run Code Online (Sandbox Code Playgroud)
到目前为止,我尝试过以下方法:
使用python命令执行.py文件.
使用ipython命令执行.py文件.我还尝试使用参数-i -c(即ipython -i -c"%run filename.py").
打开ipython.exe并使用run命令执行我的脚本.
打开ipython.exe并逐行复制代码.
除此之外,只将每行单独复制到IPython中给出了正确的输出.有没有办法执行我的脚本而不必复制IPython中的每一行?
在程序中,只describe()执行创建摘要的函数; 在控制台环境中静默地自动打印结果,因为这是您通常希望在那里看到的.
在你的程序中,你必须打电话
print(california_housing_dataframe.describe())
Run Code Online (Sandbox Code Playgroud)
明确.
| 归档时间: |
|
| 查看次数: |
1804 次 |
| 最近记录: |