Python数学建模算法与应用第2章入门题目解答

2.1画出双曲函数和指数函数图形 在同一个图形界面上画出如下三个函数的图形并进行标注。 $$y=chx,y=shx,y=\frac{1}{2} e^{x}$$ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import pylab as plt import numpy as np plt.rc('font',family='SimHei')#用来正常显示中文标签 plt.rc('axes',unicode_minus=False)#用来正常显示负号 x = np.linspace(-3,3,50)#通过定义均匀间隔创建数值序列 y1 = np.cosh(x) y2 = np.sinh(x) y3 = np.exp(x)/2 plt.plot(x,y1,'r-*',label="双曲余弦函数") plt.plot(x,y2,'--.b',label="双曲正弦函数") plt.plot(x,y3,'-.dk',label="指数函数") plt.legend() plt.show() ...

创建: 2023-06-18 | 更新: 2023-06-18 | 字数: 6559字 | 时长: 14分钟 | RM

银行用户数据分析

数据预处理 获取数据 !wget https://raw.githubusercontent.com/Rosefinch-Midsummer/Rosefinch-Midsummer.github.io/main/content/posts/file/bankpep.csv 读入数据并以id为索引,展示前五个数据 1 2 3 4 import pandas as pd import matplotlib.pyplot as plt df = pd.read_csv('bankpep.csv',index_col='id') print(df.head(5)) 把字符型数据替换成数值型数据 1 2 3 4 5 6 7 8 9 10 11 12 13 seq = ['married' ,'car','save_act','current_act', 'mortgage' ,'pep'] for feature in seq: df.loc[df[feature]=='YES',feature] = 1 df.loc[df[feature]=='NO',feature] = 0 #替换性别 df.loc[df['sex']=='MALE','sex'] = 1 df.loc[df['sex']=='FEMALE','sex'] = 0 print(df[0:5]) 利用dummmies矩阵处理多个离散值的特征项如把children分成children1,children2,children3 ...

创建: 2023-05-21 | 更新: 2023-05-21 | 字数: 1857字 | 时长: 4分钟 | RM

制作一个Flask应用的Docker镜像教程

使用Docker部署应用以及容器数据卷Volume Docker是一个广泛使用的容器化平台,可用于部署和运行各种应用程序。使用Docker,我们可以轻松地将应用程序打包成容器并在任何环境中运行,从而实现更高效的开发和部署。 ...

创建: 2023-05-17 | 更新: 2023-05-17 | 字数: 5108字 | 时长: 11分钟 | RM

WSL2入门教程

日常开发常用到Ubuntu等Linux操作系统,通常的选择如下: 双系统 用VMware、VirtualBox等安装相应的虚拟机 使用微软开发的适用于 Linux 的 Windows 子系统 (WSL) 前两种方式以前都进行过好几次,轻车熟路,最近开始使用wsl2开发,下面wsl2入门教程。 ...

创建: 2023-05-14 | 更新: 2023-05-14 | 字数: 2938字 | 时长: 6分钟 | RM

用mdbook+GitHub Pages创建在线电子书

GitHub Actions for mdBook (rust-lang/mdBook) ⚡️ Setup mdBook quickly and build your site fast. Linux (Ubuntu), macOS, and Windows are supported. 准备工作 新建public仓库然后打开读写权限,具体步骤如下: Settings——>Actions——>general——>最下面read and write permissions ...

创建: 2023-05-12 | 更新: 2023-05-12 | 字数: 2305字 | 时长: 5分钟 | RM

用Google colab 玩 Stable Diffusion

注册谷歌账号 实测用Firefox浏览器挂VPN能成功注册谷歌账号了,+86号码可用,如果不可用,可以用在线号码接收网站# 便宜的虚拟电话号码辅助注册,YouTube上有教程。 ...

创建: 2023-05-08 | 更新: 2023-05-08 | 字数: 459字 | 时长: 1分钟 | RM

Matplotlib-pyplot绘图基础

官网 中文官网 Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. Matplotlib makes easy things easy and hard things possible. Create publication quality plots. Make interactive figures that can zoom, pan, update. Customize visual style and layout. Export to many file formats. Embed in JupyterLab and Graphical User Interfaces. Use a rich array of third-party packages built on Matplotlib. 展示离散数据 散点图 柱状图 饼图 展示连续数据 直方图 箱须图 折线图 1 2 3 import matplotlib.pyplot as plt plt.figure()#创建绘图对象 半对数图 展示数据的区域或空间分布 统计地图 曲面图 动态图 bar-chart-race dashboard

创建: 2023-05-06 | 更新: 2023-05-06 | 字数: 151字 | 时长: 1分钟 | RM

个人博客搭建大致流程

基本技术栈:GithubPages+Github Action+Hugo+PaperMod主题 首先安装Hugo、git和创建xxx.github.io仓库,这里不做赘述。 ...

创建: 2023-04-30 | 更新: 2023-04-30 | 字数: 5028字 | 时长: 11分钟 | RM

Python-elasticsearch基本用法

Python-elasticsearch基本用法 官方文档:https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/connecting.html#_getting_a_document ...

创建: 2021-08-16 | 更新: 2021-08-24 | 字数: 1328字 | 时长: 3分钟 | RM

ElasticSearch教程

ElasticSearch教程 ES是高扩展的实时分布式全文检索引擎,基于Lucence,Restful API ELK技术:ES+logstash+kibana kikana官网 kikana-localhost 狂神说Elasticsearch7.X学习笔记整理 一、什么是Elasticsearch? Lucene简介 Lucene是一套用于全文检索和搜寻的开源程序库,由Apache软件基金会支持和提供 ...

创建: 2021-08-16 | 更新: 2021-08-24 | 字数: 13128字 | 时长: 27分钟 | RM