随笔分类 -  python 基础

jupyter简单易懂,
摘要:迪杰斯特拉算法用于查找图中某个顶点到其它所有顶点的最短路径,该算法既适用于无向加权图,也适用于有向加权图。注意,使用迪杰斯特拉算法查找最短路径时,必须保证图中所有边的权值为非负数,否则查找过程很容易出错。 一、迪杰斯特拉算法的实现思路 图 1 是一个无向加权图,我们就以此图为例,给大家讲解迪杰斯特拉 阅读全文
posted @ 2022-10-26 14:16 算法浪客 阅读(593) 评论(0) 推荐(0) 编辑
摘要:一、算法思想 了解了什么是最小生成树后,本节为您讲解如何用普里姆(prim)算法查找连通网(带权的连通图)中的最小生成树。 普里姆算法查找最小生成树的过程,采用了贪心算法的思想。对于包含 N 个顶点的连通网,普里姆算法每次从连通网中找出一个权值最小的边,这样的操作重复 N-1 次,由 N-1 条权值 阅读全文
posted @ 2022-10-26 13:55 算法浪客 阅读(1432) 评论(0) 推荐(0) 编辑
摘要:1、连接Oracle # -*- coding: utf-8 -*- import pandas as pd import cx_Oracle as cx import datetime import os from sqlalchemy import create_engine os.enviro 阅读全文
posted @ 2022-06-21 09:14 算法浪客 阅读(1046) 评论(0) 推荐(0) 编辑
摘要:1、分布式版本安装步骤 1.conda安装:conda install dask distributed-cconda-forge 2.pip 安装:pip install dask distributed --upgrade 3.source安装: git clone https://github 阅读全文
posted @ 2020-10-15 15:08 算法浪客 阅读(1661) 评论(0) 推荐(0) 编辑
摘要:1、Excel格式截图 2、配置文件脚本 # coding:utf-8 # 表英文名 table_name = '表英文名' # 表中文名 table_comments = '表中文名' # Excel路径 input_data_path = './data' # 导出sql路径 output_sq 阅读全文
posted @ 2020-09-23 16:51 算法浪客 阅读(3263) 评论(0) 推荐(0) 编辑
摘要:import datetime import time import asyncio import numba as nb import numpy as np @nb.jit() def f(n): if n<2: return 1 else: return f(n-1)+f(n-2) async 阅读全文
posted @ 2020-04-17 22:36 算法浪客 阅读(304) 评论(0) 推荐(0) 编辑
摘要:1、降低pillow版本小于7.0以下 conda install --yes pillow=6.2.1 或者 pip install pillow=6.2.1 阅读全文
posted @ 2020-04-07 12:28 算法浪客 阅读(516) 评论(0) 推荐(0) 编辑
摘要:来源公式推导连接 https://blog.csdn.net/qq_36387683/article/details/88554434 关键词:灰色预测 python 实现 灰色预测 GM(1,1)模型 灰色系统 预测 灰色预测公式推导 一、前言 本文的目的是用Python和类对灰色预测进行封装 二 阅读全文
posted @ 2019-11-25 00:05 算法浪客 阅读(13209) 评论(0) 推荐(2) 编辑
摘要:# coding:utf-8 import pandas as pd import numpy as np # path = r'C:\Users\wuzaipei\Desktop\签到.xlsx' # # data = pd.read_excel(path,header=0) df=pd.Data 阅读全文
posted @ 2019-10-12 22:57 算法浪客 阅读(1010) 评论(0) 推荐(0) 编辑
摘要:1、代码:主要写入时表要为小写,否则报错 Could not reflect: requested table(s) not available in Engine from sqlalchemy import create_engine conn_string='oracle+cx_oracle: 阅读全文
posted @ 2019-09-28 15:46 算法浪客 阅读(4420) 评论(0) 推荐(0) 编辑
摘要:1、没什么难的操作 安装 pip install pymssql import pymssql #引入pymssql模块 import pandas as pd def conn(): connect = pymssql.connect('172.16.1.79','admin','admin',' 阅读全文
posted @ 2019-09-26 21:46 算法浪客 阅读(7126) 评论(0) 推荐(0) 编辑
摘要:1、 安装 cx_Oracle pip install cx_Oracle 2、配置 oci.dll 与 oraociei11.dll 添加到环境变量path中 下载地址:百度搜索下载,Oracle PLSQL 进行下载 3、连接步骤 # coding:utf-8 import pandas as 阅读全文
posted @ 2019-09-26 20:34 算法浪客 阅读(976) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/lpwmm/article/details/79701881 阅读全文
posted @ 2019-09-26 11:25 算法浪客 阅读(697) 评论(0) 推荐(0) 编辑
摘要:1、测试两个算法 #coding:utf-8 import time import numba import numpy as np ''' 使用numba加速总结, (1)、在数值计算比如int float double等类型计算时 使用numba进行加速,速度可加快,string类型数据不能使用 阅读全文
posted @ 2019-08-29 23:03 算法浪客 阅读(321) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/2ff8e6f98257 阅读全文
posted @ 2019-08-12 22:29 算法浪客 阅读(2202) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/7f1b9a203045 torch gpu 安装linux sudo conda install --yes pytorch torchvision cudatoolkit=10.2 -c pytorch https://pytorch.org/ 阅读全文
posted @ 2019-07-01 12:01 算法浪客 阅读(590) 评论(0) 推荐(0) 编辑
摘要:1、参考代码如下 # coding:utf-8 class student: # 成员变量 ok = None like = '八戒你瘦了' # 实例方法 def __init__(self): # 实例变量 self.name = "admin" self.ok = "good" # 静态方法 @ 阅读全文
posted @ 2019-06-17 08:49 算法浪客 阅读(2006) 评论(0) 推荐(0) 编辑
摘要:1、c的代码 dfunc.c #include<stdio.h> int dgfunc(int n) { if(n < 2){ return 1; }else{ return dgfunc(n-1)+dgfunc(n-2); } } 2、动态编译 cmd gcc dfunc.c -fPIC -sha 阅读全文
posted @ 2019-06-11 09:39 算法浪客 阅读(948) 评论(0) 推荐(0) 编辑
摘要:1、安装步骤和下载地址 一、MinGW简介 MinGW是是将GCC编译器和GNU Binutils移植到Win32平台下的产物,包括一系列头文件(Win32API)、库和可执行文件。MinGW是从Cygwin(1.3.3版)基础上发展而来。GCC支持的语言大多在MinGW也受支持,其中涵盖C、C++ 阅读全文
posted @ 2019-06-11 09:00 算法浪客 阅读(2041) 评论(0) 推荐(1) 编辑
摘要:1、不同版本的下载链接 建议使用此链接:https://bitbucket.org/pypy/pypy/downloads/ 官网的:http://doc.pypy.org/en/latest/release-pypy2.7-v5.6.0.html?tdsourcetag=s_pcqq_aiomsg 阅读全文
posted @ 2019-05-30 11:33 算法浪客 阅读(1442) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示