![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pandas
weixin_43343144
这个作者很懒,什么都没留下…
展开
-
Android 如何判断网络环境
在 Android 中,您可以使用 ConnectivityManager 类来判断设备的网络状态。这个 isNetworkConnected 函数接收一个 Context 参数,然后检查当前是否有活动的网络连接。如果有 Wi-Fi、蜂窝数据或以太网连接,函数将返回 true;否则返回 false。注意:这只能检查设备是否连接到网络,但不能保证设备实际上能够访问互联网。例如,设备可能连接到了 Wi-Fi,但 Wi-Fi 无法访问互联网。原创 2023-04-06 17:44:56 · 449 阅读 · 0 评论 -
pandas中关于倒序索引【如df[-1]或series[-1]】的用法总结【有一个很大的坑】
遇到的问题:关于df_a_series[-1]为什么要是时间序列索引才能访问,而非时间序列索引,直接报错: File "pandas/_libs/index.pyx", line 80, in pandas._libs.index.IndexEngine.get_value File "pandas/_libs/index.pyx", line 88, in pandas._lib...原创 2019-12-10 22:50:50 · 3652 阅读 · 0 评论 -
pandas 如何修改列名 rename方法【必须增加inplace=True才会生效】
""" perf.columns的结果为: Index(['Unnamed: 0', 'algo_volatility', 'algorithm_period_return', 'alpha', 'benchmark_period_return', 'benchmark_volatility', 'beta', 'capital_used', 'en...原创 2019-11-22 16:35:16 · 4673 阅读 · 0 评论 -
pandas中的时间索引datetimeIndex如何执行时间运算【如:增加8个小时运算】总结
# 当df的index索引为datetimeIndex时间索引时,可以直接时间运算df.index = df.index + pd.Timedelta(hours=8)print(pd.date_range('2014-01-01', periods=10) + pd.Timedelta(days=1))...原创 2019-11-13 00:07:24 · 1873 阅读 · 0 评论 -
pandas如何统计均线、移动平均线的方法rolling总结
参考别人的:https://blog.csdn.net/The_Time_Runner/article/details/84101525import pandas as pdimport numpy as npprint(type(np.random.randint(1, 100, size=50)))df = pd.DataFrame([np.random.randint(1,...原创 2019-11-08 16:15:21 · 6288 阅读 · 0 评论 -
pandas中数据去重复方法df.drop_duplicates()总结
直接使用df.drop_duplicates()就可以获取去重复完毕的DataFrame了df.drop_duplicates(inplace=True)参考别人的经验:https://blog.csdn.net/qq_24499417/article/details/81126807...原创 2019-11-07 17:29:20 · 2361 阅读 · 0 评论 -
pandas不能在pycharm中使用plot()方法显示图像的解决方法
参考解决方案:https://blog.csdn.net/zhaohansk/article/details/50505636import numpy as npimport pandas as pdfrom matplotlib import pyplot as pltdf = pd.DataFrame([[1,2,3],[4,5,6]],index=["a","b"],co...原创 2019-10-31 17:58:55 · 1108 阅读 · 0 评论 -
panda中的apply方法和applymap方法的用法区别总结
apply方法传入的是一个列Series,而applymap传入的是每一个元素值df = pd.DataFrame({"a": "aaa", "b": 18, "c": "man", "d": 1.08}, index=pd.date_range("20190101", freq="D", periods=3))print(df)def fun...原创 2019-10-31 12:11:35 · 299 阅读 · 0 评论 -
【非常重要】pandas的一维序列Series和二维表DataFrame的五种索引访问方式总结大全
说明:位置索引----list索引访问方式标签索引----dict索引访问方式关于DataFrame和Series的关系总结:其中Series又具备了numpy中ndarray数组的特性以及dict的特性!关于DataFrame和Series的关系总结:其中Series又具备了numpy中ndarray数组的特性以及dict的特性!df = pd.DataFrame({...原创 2019-10-31 11:15:57 · 1102 阅读 · 0 评论 -
pandas序列Series或表DataFrame中的画图方法plot参数说明【这里必须查看源代码才有注释,官方文档未说明】
参考源代码中的注释:https://github.com/pandas-dev/pandas/blob/v0.25.2/pandas/plotting/_core.py#L504-L1533原创 2019-10-31 09:54:25 · 746 阅读 · 0 评论 -
Python关于%matplotlib inline【jupyter notebook专用代码】
参考https://www.jianshu.com/p/2dda5bb8ce7d原创 2019-10-31 09:32:12 · 345 阅读 · 0 评论 -
【非常给力】pandas中文文档指南,用户指南和十分钟入门非常棒
参考:https://www.pypandas.cn/docs/getting_started/原创 2019-10-30 21:07:54 · 723 阅读 · 0 评论 -
【经常使用】pandas的时间转换【日期到时间撮或从时间撮到日期的转换总结】
参考:https://blog.csdn.net/ChenVast/article/details/82754398从时间戳到纪元要从上面反转操作,即从a转换Timestamp为'unix'时代:stamps = pd.date_range('2012-10-08 18:15:05', periods=4, freq='D')# 做一个时间减法就会获得时间撮的格式:...原创 2019-10-30 18:52:59 · 359 阅读 · 0 评论 -
【非常重要】pandas时间日期和时间序列的方法及类总结【比较难的点】
经典文章参考:https://blog.csdn.net/ChenVast/article/details/82754398原创 2019-10-30 18:01:54 · 408 阅读 · 0 评论 -
pandas 表格DataFrame 和 行或列Series 访问数据的方法总结【loc、iloc、at、iat及列表访问】
''' 表格DataFrame 和 行或列Series 访问数据的方法总结'''import numpy as npimport pandas as pddate_indexs = pd.date_range("20190801", "20190830", periods=6)data = pd.DataFrame(np.random.random([6, 3]), i...原创 2019-10-29 16:35:47 · 2265 阅读 · 0 评论