自己的做网站,自建网站平台有哪些功能,linux wordpress 升级,企业网站首页布局尺寸文章目录 安装pandas写views写urls安装openpyxl重新调试 安装pandas
Pandas是一个基于NumPy的Python数据分析库#xff0c;可以从各种文件格式如CSV、JSON、SQL、Excel等导入数据#xff0c;并支持多种数据运算操作#xff0c;如归并、再成形、选择等。
更换pip源
pip co… 文章目录 安装pandas写views写urls安装openpyxl重新调试 安装pandas
Pandas是一个基于NumPy的Python数据分析库可以从各种文件格式如CSV、JSON、SQL、Excel等导入数据并支持多种数据运算操作如归并、再成形、选择等。
更换pip源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple安装Pandas
pip install pandas写views
视图
from django.shortcuts import render
from django.http import HttpResponse
from antproject.settings import BASE_DIR
import pandas as pd# Create your views here.
def hello(request):return HttpResponse(this is hello/)def show_excel(request):dfpd.read_excel(BASE_DIR / data/score.xlsx)conttabletrth学号/thth姓名/thth语文/thth数学/thth英语/th/tr for idx, row in df.iterrows():cont ftrtd{row.学号}/tdtd{row.姓名}/tdtd{row.语文}/tdtd{row.数学}/tdtd{row.英语}/td/trcont /tablereturn HttpResponse(this is score cont)写urls
from django.contrib import admin
from django.urls import path
from antapp import viewsurlpatterns [path(hello/, views.hello),path(show_excel/,views.show_excel),
]安装openpyxl pip install openpyxl重新调试 以下是excel原文件