会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
是阿杰呀
study hungry,study foolish.
首页
新随笔
联系
管理
上一页
1
2
3
4
5
6
···
10
下一页
2023年9月20日
【Python】pymysql 连接mysql数据库, 执行数据库语句
摘要: 1. 数据库设置 import pymysql # 数据库连接配置 DB_HOST = '127.0.0.1' # ip DB_PORT = 3306 # 端口 DB_USER = 'root' # 用户名 DB_PASSWD = 'root' # 密码 DB_DATABASE = 'db_1' #
阅读全文
posted @ 2023-09-20 09:56 是阿杰呀
阅读(117)
评论(0)
推荐(0)
2023年9月13日
【Python】pandas 求风向数据中的主导风向
摘要: data = [342.8, 337.96, 336.68, 337.94, 337.35, 340.4, 342.42, 341.86, 339.4, 341.76, 342.9, 343.63, 338.88, 339.43] # 风向角度区分 directions = { "北": [(348
阅读全文
posted @ 2023-09-13 18:28 是阿杰呀
阅读(176)
评论(0)
推荐(0)
2023年9月12日
【Django】orm 对字段进行 中文排序
摘要: 1. orm order_by 对字段进行排序, 按中文 models.EnterpriseInfo.objects.extra(select={'name_pinyin': "CONVERT(name USING GBK)"}).order_by('name_pinyin').values('id
阅读全文
posted @ 2023-09-12 14:37 是阿杰呀
阅读(287)
评论(0)
推荐(0)
2023年9月8日
【Python】坐标系转换wgs84 -> bd09
摘要: #### 坐标系转换 ```python """ 坐标转换工具类 xll >2021-05-19 developer """ import math import pandas as pd import numpy as np from pyproj import Proj, transform,
阅读全文
posted @ 2023-09-08 14:47 是阿杰呀
阅读(494)
评论(0)
推荐(0)
2023年8月30日
【Django】django-simple-captcha 验证码配置
摘要: #### 1. django-simple-captcha 下载 `pip install django-simple-captcha` #### 2. 配置 ##### 2.1 settings.py 配置 ```python # 注册 app INSTALLED_APPS = [ .... 'c
阅读全文
posted @ 2023-08-30 16:44 是阿杰呀
阅读(387)
评论(0)
推荐(0)
【Django】admin.py文件 添加 action操作 (如: 重置密码, 修改密码)
摘要: #### admin.py 后台管理界面修改密码 ```python from django.contrib import admin from django.contrib.auth.hashers import make_password from django.http import Http
阅读全文
posted @ 2023-08-30 15:09 是阿杰呀
阅读(192)
评论(0)
推荐(0)
2023年8月24日
【Python】pandas操作, 取最大值, 最小值, 平均值, 生成 空值, 多个 series合并, 替换 缺失值, 数据保留2位小数
摘要: #### 1. 取最大值, 最小值, 平均值 ```python df.max() df.iloc[:, 1:].max() df.min() df.mean() # 输出 index value ``` #### 2. 生成 空值, 带index的 series ```python pd.Seri
阅读全文
posted @ 2023-08-24 15:29 是阿杰呀
阅读(609)
评论(0)
推荐(0)
2023年8月16日
【Django】paginator分页操作
摘要: ```python from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger def main(object_list, page_index, display_num=10): """ :param objec
阅读全文
posted @ 2023-08-16 15:05 是阿杰呀
阅读(27)
评论(0)
推荐(0)
2023年8月12日
【Django】request请求设置
摘要: #### 1. GET请求 ```python # query请求 def get(self, request): print(request.GET) res = [] # 最终返回的结果集合 search_field = request.GET.get('search_field', '') p
阅读全文
posted @ 2023-08-12 11:39 是阿杰呀
阅读(101)
评论(0)
推荐(0)
2023年7月12日
【Python】对密码文本进行加密, 并判断 hashlib
摘要: ```python import hashlib def encrypt_password(password, salt): # 创建一个sha256的哈希对象 sha256_hash = hashlib.sha256() # 将盐值和密码组合起来并进行哈希 hashed_password = sa
阅读全文
posted @ 2023-07-12 15:16 是阿杰呀
阅读(80)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
···
10
下一页