In [1]:
# import pandas
import pandas as pd
print (pd.__version__)
In [2]:
# Series
s = pd.Series(['a', 'b', 'c'])
print(s)
In [7]:
# DataFrame
score = pd.Series([2,6,2])
df = pd.DataFrame({"s_name": s, "s_score": score})
print (df)
# df.describe()
df.head(2)
Out[7]:
In [10]:
# pandas plot
import matplotlib.pyplot as plt
cc = pd.read_csv("california_housing_train.csv", sep=',')
cc.hist("housing_median_age")
Out[10]:
In [14]:
score/1.5
Out[14]:
In [25]:
import numpy as np
s.index
s.reindex(np.random.permutation(s.index))
Out[25]:
In [24]:
s.reindex(np.random.permutation(4))
Out[24]:
In [ ]: