pandas
weixin_45070839
这个作者很懒,什么都没留下…
展开
-
python-csv文件输入和输出-小白篇
python-csv文件基础编辑原创 2022-06-05 13:27:46 · 485 阅读 · 0 评论 -
python 使用 pandas报错 list index out of range
问题:import csvimport matplotlib.pyplot as pltimport pandas as pddf = pd.read_csv("D:/data/0403/output2.csv", index_col=0,encoding='GBK')df[:3]代码正确,出现错误:IndexError: list index out of range参考答案:https://blog.csdn.net/weixin_37746009/article/de.原创 2022-04-14 11:07:12 · 1711 阅读 · 0 评论 -
python 使用sk_learn :ValueError: Expected 2D array, got 1D array instead
源代码"""date:0328K均值KMeans模型"""import pandas as pddf = pd.read_csv("D:/mechine learning/transfer-time-location.csv", index_col=0,encoding='GBK')df[:3]from sklearn.cluster import KMeansmodel = KMeans(n_clusters=7)X = df['transfer_time']model.原创 2022-03-28 09:51:35 · 1687 阅读 · 0 评论 -
Pycharm-pandas库打不开文件:Invalid argument:
pandas库打不开文件,源代码如下"""created by mattiedate:0328用pd打开csv文件"""import pandas as pddef getContent(path): df = pd.read_csv(open(path), index_col=0) print(len(df)) print(df.head(2)) return dfdf=getContent("D:\mechine learning\transfe原创 2022-03-28 08:37:06 · 511 阅读 · 0 评论