卑以自牧w
码龄6年
关注
提问 私信
  • 博客:7,450
    社区:1
    问答:17,943
    25,394
    总访问量
  • 9
    原创
  • 421,086
    排名
  • 2,113
    粉丝
  • 0
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:浙江省
  • 加入CSDN时间: 2019-04-04
博客简介:

wangjunkout的博客

查看详细资料
个人成就
  • 获得21次点赞
  • 内容获得1次评论
  • 获得48次收藏
创作历程
  • 2篇
    2023年
  • 7篇
    2021年
成就勋章
TA的专栏
  • java
    7篇
兴趣领域 设置
  • 大数据
    hadoophivestormsparketl
创作活动更多

超级创作者激励计划

万元现金补贴,高额收益分成,专属VIP内容创作者流量扶持,等你加入!

去参加
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

python爬虫Mac与window上运行有差别

答:

报错贴一下看看

回答问题 2023.11.27

flume安装无法解决,辛苦各位了

答:

Jdk 是什么版本的

回答问题 2023.11.23

为啥python不能识别import语句

答:

最前面少一个中括号

回答问题 2023.11.22

spark-sql启动失败

答:

缺少驱动

回答问题 2023.11.14

Hadoop运行jar包跑wordcount报错,找不到错误在哪,如何解决?

答:

yarn-site.xml文件发出来看看

回答问题 2023.11.09

hadoop 格式化出现错误

答:

你的路径是怎么写的,发出来看一眼

回答问题 2023.11.09

Spark过滤数据输出

答:

有的数据分割之后没有8个,比如他给了一个错误数据在哪,数组最大是5,你写了7在遍历的时候就会导致下标越界

回答问题 2023.11.08

如何做这样的一个python,请给出代码和步骤

答:

import os

# 文件路径
file_path = os.path.join("data", "data22462", "成绩单.txt")

# 读入文件
with open(file_path, "r", encoding="utf-8") as f:
    lines = f.readlines()

# 学生总分字典
total_scores = {}

# 循环处理每个学生
for line in lines:
    line = line.strip()
    if not line:  # 忽略空行
        continue
    student_data = line.split("\t")
    student_name = student_data[0]
    scores = list(map(int, student_data[1:]))  # 将成绩从字符串转换为整数
    total_score = sum(scores)  # 计算总分
    total_scores[student_name] = total_score  # 添加到总分字典中

# 学生总分列表,每个元素是一个元组,包括学生姓名和总分
total_scores_list = list(total_scores.items())

# 按照总分排序
total_scores_list.sort(key=lambda x: x[1], reverse=True)

# 计算排名
rank = 1
last_score = None
for i, (name, score) in enumerate(total_scores_list):
    if last_score is None or last_score != score:
        rank = i + 1
    if last_score is not None and last_score == score:
        total_scores_list[i - 1] = (total_scores_list[i - 1][0], total_scores_list[i - 1][1], "并列排名:" + str(rank))
        rank += 1
    total_scores_list[i] = (name, score, "排名:" + str(rank))
    last_score = score

# 将结果写入文件
output_file_path = os.path.join("work", "总成绩排名.txt")
with open(output_file_path, "w", encoding="utf-8") as f:
    for name, score, rank_str in total_scores_list:
        f.write(name + "\t总分:" + str(score) + "\t" + rank_str + "\n")

# 查询程序
while True:
    name = input("请输入学生姓名(直接回车退出):")
    if not name:
        break
    for nm, sc, rk in total_scores_list:
        if nm == name:
            print("{} 总分:{} {}".format(name, sc, rk))
            break
    else:
        print("找不到名叫 {} 的学生".format(name))
回答问题 2023.11.07

电脑还原出厂设置还是下载不了MySql

答:

安装一个虚拟机 装一个liunx的mysql 工作中用到win的mysql也是比较少的 大多数都是lin的

回答问题 2023.11.07

Python中怎么判断字母在一句话中是单独出现还是存在于单词中

答:

import re

sentence = "I love Python programming, but I hate insects."

# 找到独立出现的 I
result = re.findall(r'\bI\b', sentence)

if result:
    print("独立出现的 I")
else:
    print("I 不是独立出现的")
回答问题 2023.11.07

mongodb模糊查询不返回数据

答:

会不会是你的json串不是标准的json导致的,我反正实际的hive的正则匹配对json串的格式有要求,有可能mongdb也有这种奇葩的问题

回答问题 2023.11.07

openpyxl库为什么会报错呢

答:

代码贴全一点看看

回答问题 2023.11.02

IDEA有可视化设计插件吗

答:

img

官网链接:https://www.formdev.com/jformdesigner/screenshots/

回答问题 2023.11.02

求帮助!skforecast遇到了恼人的问题

答:

你是不是下载失败了 我试了试可以使用呀

img

回答问题 2023.11.02

关于#python#的问题,请各位专家解答!

答:
#19
def find(source,target):
    for i in range(len(source)):
        if source[i:i+len(target)]==target:
            return i
    return -1


#20
str_1 = "abc123"
str_2 = "huak3"

set_1 = set(str_1)
set_2 = set(str_2)

print("".join(set_1&set_2))
回答问题 2023.11.02

这个zkServer.sh start之后jps是有QuorumPeerMain,但是再jps之后就没有了

答:

去zk目录下面找logs文件,看一下启动日志就知道为什么了

回答问题 2023.11.02

这个SQL语句的语法咋错了啊 这个怎么改啊

答:

代码全一点,你正好把sql语句截掉了

回答问题 2023.11.02

pycharm问题,怎么进入编写代码区域

答:

在目录上面右击点击file 输入xxx.py 后缀是py就可以了

img

回答问题 2023.11.02

用Java写大家帮个忙吧

答:

import java.util.Scanner;

public class SalaryCalculator {
    public static void main(String[] args) {
        final int WORK_HOURS = 160;
        final int HOUR_PRICE = 50;
        final int OVERTIME_PRICE = 40;

        Scanner input = new Scanner(System.in);

        System.out.print("请输入本月工作时间:");
        int workHours = input.nextInt();
        input.close();

        int salary = 0;
        if (workHours <= WORK_HOURS) {
            salary = workHours * HOUR_PRICE;
        } else {
            salary = WORK_HOURS * HOUR_PRICE
                     + (workHours - WORK_HOURS) * (HOUR_PRICE + OVERTIME_PRICE);
        }

        System.out.printf("本月工资为:%d 元\n", salary);
    }
}

作业以后还是要自己做,毕竟知识自己学才是自己的!!!!

回答问题 2023.11.02

这个代码应该怎么写,有人可以看看吗?

答:

#include <stdio.h>
#include <math.h>

double sinX_derivative(double x, int n)
{
    double result = 0;
    int i, j;

    for (i = n; i >= 0; i--) {
        double temp = 1;
        for (j = 0; j < i; j++) {
            temp *= (n - j);
        }
        temp *= pow(-1, i);

        if (i % 4 == 0) {
            result += temp * sin(x);
        } else if (i % 4 == 1) {
            result += temp * cos(x);
        } else if (i % 4 == 2) {
            result += temp * (-sin(x));
        } else if (i % 4 == 3) {
            result += temp * (-cos(x));
        }
    }

    return result;
}

int main()
{
    double x = 1.5; // x的值
    int n = 3; // 求n阶导数
    double result = sinX_derivative(x, n);

    printf("sin(%.2f)的%d阶导数为:%.2f", x, n, result);

    return 0;
}
回答问题 2023.11.02
加载更多