ICode9

• DataFrame 提取部分再转存为DataFrame2022-07-04 10:03:07

DataFrame 提取一行后 就变成Series，DF的列(columns) 就变成Series的索引(index ),再保存到csv文件，格式就乱了 处理办法：将Series的value提取出来，变成list格式，用append()将所有提起的数据放在一起，再转成DataFrame格式，再添加原来的columns df = pd.read_csv('filename.csv') df1 = [

• python数据分析与挖掘期末复习2022-06-19 19:03:59

一、简答题 1.数据挖掘的基本任务 包括利用分类与预测、聚类分析、关联规则、时序模式、偏差检测、智能推荐等方法，帮助企业提取数据中蕴含的商业价值，提高企业的竞争力。 2.数据挖掘建模的过程 目标定义——》数据采集——》数据整理——》构建模型——》模型评价——》模型发布 3.

• pandas2022-05-23 22:03:25

pandas 数据去重：pd.Series(list(s)).unique() ，或者set() DataFrame取行、列：数字、名称两种索引方式 取行 df[2:6] df[:3] 名字：df.loc[“A”]、df.loc[“A”:"D"]、df.loc[[“A”,"D"]] 数字：df.iloc[1]、df.iloc[1:3]、df.iloc[[1,3]] 取列 df[[2,4,6] df.loc[:,"Y"]、df.loc[:,&quo

• pandas子集选取的三种方法：[]、.loc[]、.iloc[]2022-05-03 20:34:46

pandas读取Excel、csv文件中的数据时，得到的大多是表格型的二维数据，在pandas中对应的即为DataFrame数据结构。在处理这类数据时，往往要根据据需求先获取数据中的子集，如某些列、某些行、行列交叉的部分等。可以说子集选取是一个非常基础、频繁使用的操作，而DataFrame的子集选取看似简

• bp神经网络2022-03-21 20:33:05

import mathimport numpy as npimport pandas as pdfrom pandas import DataFramey =[0.14 ,0.64 ,0.28 ,0.33 ,0.12 ,0.03 ,0.02 ,0.11 ,0.08 ]x1 =[0.29 ,0.50 ,0.00 ,0.21 ,0.10 ,0.06 ,0.13 ,0.24 ,0.28 ]x2 =[0.23 ,0.62 ,0.53 ,0.53 ,0.33 ,0.15 ,0.03 ,0.23 ,0.03 ]the

• bp神经网络2022-03-21 13:03:27

import mathimport numpy as npimport pandas as pdfrom pandas import DataFrame,Series def sigmoid(x): #映射函数return 1/(1+math.exp(-x)) x1=[0.29,0.50,0.00,0.21,0.10,0.06,0.13,0.24,0.28]x2=[0.23,0.62,0.53,0.53,0.33,0.15,0.03,0.23,0.03]y=[0.14,0.64,0.28,0.33,0.1

• BP神经网络。2022-03-19 23:05:49

import mathimport numpy as npimport pandas as pdfrom pandas import DataFrame y =[0.14 ,0.64 ,0.28 ,0.33 ,0.12 ,0.03 ,0.02 ,0.11 ,0.08 ]x1 =[0.29 ,0.50 ,0.00 ,0.21 ,0.10 ,0.06 ,0.13 ,0.24 ,0.28 ]x2 =[0.23 ,0.62 ,0.53 ,0.53 ,0.33 ,0.15 ,0.03 ,0.23 ,0.03 ]th

• 客家话2022-03-19 23:04:04

import mathimport numpy as npimport pandas as pdfrom pandas import DataFrame,Seriesdef sigmoid(x): #映射函数 return 1/(1+math.exp(-x))x1=[0.29,0.50,0.00,0.21,0.10,0.06,0.13,0.24,0.28]x2=[0.23,0.62,0.53,0.53,0.33,0.15,0.03,0.23,0.03]y=[0.14,0.64,0.28,0.33,0.12

• BP神经网络2022-03-19 23:03:29

import mathimport numpy as npimport pandas as pdfrom pandas import DataFramey =[0.14 ,0.64 ,0.28 ,0.33 ,0.12 ,0.03 ,0.02 ,0.11 ,0.08 ]x1 =[0.29 ,0.50 ,0.00 ,0.21 ,0.10 ,0.06 ,0.13 ,0.24 ,0.28 ]x2 =[0.23 ,0.62 ,0.53 ,0.53 ,0.33 ,0.15 ,0.03 ,0.23 ,0.03 ]the

• work2022-03-19 21:34:22

#@author: Mint import mathimport numpy as npimport pandas as pdfrom pandas import DataFramey =[0.14 ,0.64 ,0.28 ,0.33 ,0.12 ,0.03 ,0.02 ,0.11 ,0.08 ]x1 =[0.29 ,0.50 ,0.00 ,0.21 ,0.10 ,0.06 ,0.13 ,0.24 ,0.28 ]x2 =[0.23 ,0.62 ,0.53 ,0.53 ,0.33 ,0.15 ,0.03 ,

• BP人工神经网络2022-03-19 21:06:17

import mathimport numpy as npimport pandas as pdfrom pandas import DataFramey = [0.14, 0.64, 0.28, 0.33, 0.12, 0.03, 0.02, 0.11, 0.08]x1 = [0.29, 0.50, 0.00, 0.21, 0.10, 0.06, 0.13, 0.24, 0.28]x2 = [0.23, 0.62, 0.53, 0.53, 0.33, 0.15, 0.03, 0.23, 0.03]the

• bp神经网络2022-03-19 21:04:31

import mathimport numpy as npimport pandas as pdfrom pandas import DataFrame,Series def sigmoid(x): return 1/(1+math.exp(-x))y =[0.14 ,0.64 ,0.28 ,0.33 ,0.12 ,0.03 ,0.02 ,0.11 ,0.08 ]x1 =[0.29 ,0.50 ,0.00 ,0.21 ,0.10 ,0.06 ,0.13 ,0.24 ,0.28 ]x2 =[0.23 ,0.

• 神经网络2022-03-19 21:03:32

import mathimport numpy as npimport pandas as pdfrom pandas import DataFrame,Seriesdef sigmoid(x): return 1/(1+math.exp(-x))x1=[0.29,0.50,0.00,0.21,0.10,0.06,0.13,0.24,0.28]x2=[0.23,0.62,0.53,0.53,0.33,0.15,0.03,0.23,0.03]y=[0.14,0.64,0.28,0.33,0.12,0

• 人工智能 神经元2022-03-19 21:02:23

import mathimport numpy as npimport pandas as pdfrom pandas import DataFrame y =[0.14 ,0.64 ,0.28 ,0.33 ,0.12 ,0.03 ,0.02 ,0.11 ,0.08 ]x1 =[0.29 ,0.50 ,0.00 ,0.21 ,0.10 ,0.06 ,0.13 ,0.24 ,0.28 ]x2 =[0.23 ,0.62 ,0.53 ,0.53 ,0.33 ,0.15 ,0.03 ,0.23 ,0.03 ]th

• BP神经网络-262022-03-19 20:36:33

@author: Mint """ import math import numpy as np import pandas as pd from pandas import DataFrame y =[0.14 ,0.64 ,0.28 ,0.33 ,0.12 ,0.03 ,0.02 ,0.11 ,0.08 ] x1 =[0.29 ,0.50 ,0.00 ,0.21 ,0.10 ,0.06 ,0.13 ,0.24 ,0.28 ] x2 =[0.23 ,0.62 ,0.53

• bp神经网络2022-03-19 12:35:45

import math from pandas import DataFrame def sigmoid(x):#激活函数 return 1/(1+math.exp(-x)) f = open(r"data.txt") line = f.readline() data_list = [] while line: num = list(map(float,line.split(','))) data_list.append(num)

• Pandas笔记（一）2022-01-25 22:03:59

最近在Kaggle上学习Machine Learning，对于机器学习工程师来说pandas实在太重要，写几篇博客作pandas课程的笔记   1. DataFrame的创建 DataFrame可以看作一个数据表格，创建一个带索引的DataFrame： pd.DataFrame({'Bob': ['I liked it.', 'It was awful.'], 'Sue': ['Pr

• 基于macd、kdj、ma技术指标分析股票多空方向——应用开发4 分析技术指标一系列形态结果2022-01-20 21:33:53

接上一节，我们计算获取了技术指标的结果total_df，结果如下图 我们需要显示股票最近10天的分析结果，对此我们只需要截取total_df前12天数据就可以了。 #获取前12天的数据 total_df=total_df.iloc[-12:,:] total_df 对应列的数字0～9，待会作数据分析时用得上  我们要初始一个储存分析

• python中iloc与loc的区别2021-12-26 19:33:13

loc和iloc都是pandas工具中定位某一行的函数，loc是location的意思，而iloc中的 i 指的是Integer，二者的区别如下： loc：通过行标签名称索引行数据iloc：通过行号索引行数据 示例数据 import numpy as np import pandas as pd data=DataFrame(np.arange(16).reshape(4,4),index=list("A

• 关于KNN算法分析鸢尾花数据集2021-11-13 22:35:00

一、代码实现 # KNN import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.datasets import load_iris # data = load_iris() url = 'https://www.gairuo.com/file/data/dataset/iris.data' data = pd.read_csv(url) data ["speci

• python作业分享：如何运用Tuhare进行opts最优化算法算出上证50的最优投资组合2021-10-29 21:30:21

TushareID：469107 大家好，本期给大家带来的python作业分享是：如何运用Tuhare进行opts最优化算法算出上证50的最优投资组合（当然有两个限制条件：第一个就是特定时段的上证50组合，第二个就是特定历史时段的股票价格数据） 第一步 在tushare上获取相关的信息 这一步在上次的作业里面有明

• Pandas读取Excel文件2021-10-23 01:32:36

读取行数和列数及行列索引 1 row_num = len(df.index.values) 2 3 col_num = len(df.columns.values) row_indexs = df.index.values col_indexs = df.columns.values 读取指定的单行或单列数据 df.loc[0].values df.loc[:, '姓名'].values # 单行获取 df.iloc[0].values

• 机器学习——树回归2021-10-03 23:03:12

CART算法 什么是CART？ CART是英文Classification And Regression Tree的简写，又称为分类回归树。从它的名字我们就可 以看出，它是一个很强大的算法，既可以用于分类还可以用于回归，所以非常值得我们来学习。 CART算法使用的就是二元切分法，这种方法可以通过调整树的构建过程，使其能够

• (pandas)loc和iloc的区别2021-10-01 09:59:16

loc和iloc的意思 首先，loc是location的意思，和iloc中i的意思是指integer，所以它只接受整数作为参数，详情见下面。 loc和iloc的区别及用法展示 1.区别 loc works on labels in the index. iloc works on the positions in the index (so it only takes integers).   2.用法展示 首先