ucb DATA100 Note 1

这篇博客介绍了UCB DATA100课程中关于Python数据处理的基础知识,包括Numpy的数组操作、Pandas的DataFrame概念,如添加、删除列,以及数据过滤和切片。还讨论了Pandas的groupby聚合操作和字符串处理,强调了高效使用NumPy和Pandas在数据处理中的重要性。
摘要由CSDN通过智能技术生成

 如果想学习用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 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值