Deck 1 Flashcards
Adoption of home broadband has stalled in the United States
stopped moving or developing
Beautifulsoup how to print clearly the content of ‘soup’
soup.preffity()
Dimensions du DataFrame boston ?
boston.shape
How to create a cross validation set with sklearn ?
X_train, X_test, Y_train, Y_test = cross_validation.train_test_split(X,Y,test_size=0.3,random_state=0)
How to get boston sklearn data to pandas
bos = pd.DataFrame(boston.data) bos.columns = boston.features_names
How to have infos on columns in pandas
df.info()
How to know the types of columns in pandas
df.dtype
plot boston crime vs boston housing price
plt. scatter(bos.CRIM, bos.PRICE)
plt. xlabel(“Per capita crime rate by town (CRIM)”)
plt. ylabel(“Housing Price”)
plt. title(“Relationship between CRIM and Price”)
quelles options sont dispo dans pandas ?
pd. set_option(‘display.width’, 500)
pd. set_option(‘display.max_columns’, 100)
pd. set_option(‘display.notebook_repr_html’, True)
Relational Database principle ?
Don’t say seek 20 bytes onto disk and pick up from there. Say : selecta data from a set. I dont care where it is, just get the row to me
Replace missing values in Age of Titanic passengers with mean value of Ages
df1[‘Age’][np.isnan(df1[‘Age’])] = np.median(df1[‘Age’])
or
test.Age = test.Age.fillna(np.median(test[‘Age’]))
Rester au courant de l’actualité en anglais?
Keeping up with news
The decline “could represent a blip or might be a more prolonged reality,”
Something that does not last
Import module for regular expressions
Import re
How to import float division
From __future__ import division