如果想学习用python numpy和pandas一些基本的数据处理(R也可以实现)
SQL visulization
建议学一下DATA100!!!
编程和课程很棒!
人家的课怎么这么好!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
好到不行不行的!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
全世界都去学一下DATA100!!!!!!!!!!!!!!!!
主要内容
-
Introduced DataFrame concepts
-
Series: A named column of data with an index
-
Indexes: The mapping from keys to rows
-
DataFrame: collection of series with common index
-
-
Dataframe access methods
-
Filtering on predicts and slicing
-
df.loc: location by index
-
df.iloc: location by integer address
-
groupby & pivot aggregating data
-
Danger Zone! 有点搞笑怎么回事
Exhilarating content!
pandas 包里
df.describe()
value_counts()
这课nb!!!
%matplotlib inline
is a Jupyter magic command that configures the notebook so that Matplotlib displays any plots that you draw directly in the notebook rather than to a file, allowing you to view the plots upon executing your code. (Note: In practice, this is no longer necessary, but we're showing it to you now anyway.)
Another useful magic command is %%time
, which times the execution of that cell. You can use this by writing it as the first line of a cell. (Note that %%
is used for cell magic commands that apply to the entire cell, whereas %
is used for line magic commands that only apply to a single line.)
Keyboard Shortcuts
Numpy
Question 1
The core of NumPy is the array. Like Python lists, arrays store data; however, they store data in a more efficient manner. In many cases, this allows for faster computation and data manipulation.
np.arange()
array attributes: shape, dtype,
Arrays, unlike Python lists, cannot store items of different data types.
numpy.int64 = int
def elementwise_array_sum(list_1, list_2):
"""Compute x^2 + y^3 for each x, y in list_1, list_2.
Assume list_1 and list_2 have the same length.
Return a NumPy array.
"""
assert len(list_1) == len(list_2), "both args must have the same number of elements"
return np.array(list_1)**2 + np.array(list_2)**3
Numpy: elementwise