import pandas as pd
reviews = pd.read_csv("../input/wine-reviews/winemag-data-130k-v2.csv", index_col=0)
pd.set_option('max_rows', 5)
reviews.price.dtype
dtype('float64')
reviews.dtypes
country object
description object
...
variety object
winery object
Length: 13, dtype: object
reviews.points.astype('float64')
0 87.0
1 87.0
...
129969 90.0
129970 90.0
Name: points, Length: 129971, dtype: float64
Der index einer DataFrame oder einer Series hat auch seinen eigenen dtype:
reviews.index.dtype
dtype('int64')
reviews[pd.isnull(reviews.country)]
|
country |
description |
designation |
points |
price |
province |
region_1 |
region_2 |
taster_name |
taster_twitter_handle |
title |
variety |
winery |
|
|
913 |
NaN |
Amber in color, this wine has aromas of peach ... |
Asureti Valley |
87 |
30.0 |
NaN |
NaN |
NaN |
Mike DeSimone |
@worldwineguys |
Gotsa Family Wines 2014 Asureti Valley Chinuri |
Chinuri |
Gotsa Family Wines |
|
3131 |
NaN |
Soft, fruity and juicy, this is a pleasant, si... |
Partager |
83 |
NaN |
NaN |
NaN |
NaN |
Roger Voss |
@vossroger |
Barton & Guestier NV Partager Red |
Red Blend |
Barton & Guestier |
|
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
|
129590 |
NaN |
A blend of 60% Syrah, 30% Cabernet Sauvignon a... |
Shah |
90 |
30.0 |
NaN |
NaN |
NaN |
Mike DeSimone |
@worldwineguys |
Büyülübağ 2012 Shah Red |
Red Blend |
Büyülübağ |
|
129900 |
NaN |
This wine offers ful bouquet of black... |
NaN |
91 |
32.0 |
NaN |
NaN |
NaN |
Mike DeSimone |
@worldwineguys |
Psagot 2014 Merlot |
Merlot |
Psagot |
reviews.region_2.fillna("Unknown")
0 Unknown
1 Unknown
...
129969 Unknown
129970 Unknown
Name: region_2, Length: 129971, dtype: object
reviews.taster_twitter_handle.replace("@kerinokeefe", "@kerino")
0 @kerino
1 @vossroger
...
129969 @vossroger
129970 @vossroger
Name: taster_twitter_handle, Length: 129971, dtype: object
linkcode