AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / coding / 问题

问题[import](coding)

Martin Hope
Roger V.
Asked: 2025-02-12 17:16:33 +0800 CST

重新导入 Julia 中包含的文件中已导入的模块

  • 6

在我的 Julia 代码中,我使用来自其他文件的函数,这些函数是通过 include 添加的。例如,我可能有类似

using DataFrames, CSV
import Random: shuffle, seed
using Base.Filesystem: mkpath

include("existing_code.jl")

seed!(2025)

但是,代码中existing_code.jl可能已经包含类似

using DataFrames, CSV, Random
using Base.Filesystem: mkpath

Random.seed!(1984)

但是,我的印象是,由于模块(例如DataFrames, CSV, Random已经在其他文件中导入,因此无需重新导入它们。我想知道,这里的好做法是什么?不遵循良好做法可能存在哪些危险?

import
  • 1 个回答
  • 21 Views
Martin Hope
Bruno René Santos
Asked: 2024-08-04 05:43:54 +0800 CST

如何从 pickle 中的外部属性导入模块

  • 5

我想通过属性将文件名注入到 pkl 模块中,这样我就可以做类似的事情

base = import(read("prop:config-file"))

但我收到错误... 有什么方法可以实现吗?我正在考虑在导入参数上添加占位符,并将 .pkl 文件变成某种模板,但这似乎是一种黑客行为。我更愿意遵循最佳建议来做到这一点。谢谢

import
  • 1 个回答
  • 17 Views
Martin Hope
CJ Dupras
Asked: 2024-01-25 03:27:36 +0800 CST

需要删除行数发生变化的 IMPORTHTL 函数的最后一行吗?

  • 5

刚接触 Sheets/Excel 小队,遇到了 stackoverflow/reddit/其他论坛似乎没有回答的问题!

简短的故事: **IMPORTHTML 将根据不断变化的条件拉取表格,这意味着表格有时可能有更多或更少的列。我需要一种方法让导入的数据始终删除最后一行数据,因为该行中的数据与其他公式混淆。**

长话短说:我有一个表格,它会自动更新我的球队所面对的任何 NHL 球队的得分最高的领先者。我让它根据工作表的标题文本提取 IMPORTHTML。然后,标题单元格中的文本将导致单元格 P5 生成该团队滑冰者统计数据的相关 URL,因此它会更改每场比赛。

我有另一个函数,可以从该表的给定列中提取数字,并从另一个函数(P5,“table”,1)中提取相邻玩家姓名列中的名称。

问题是每个表都有一个“TOTAL”行,它始终是任何给定列中的最大数字。

我不想在每个游戏中更改 Max 函数的范围,而是想问是否有一些东西可以将我的 IMPORTHTML 函数包装起来,从而消除任何表格的最后一行。

我尝试过不同的 QUERY 函数,但我找不到可以让该函数按照我需要的方式工作的论坛或表达式。有一个公式可以从 IMPORTHTL 表中删除单词“Total”,但不会删除整行数据。

import
  • 1 个回答
  • 13 Views
Martin Hope
NatIndustrial
Asked: 2023-10-30 23:31:27 +0800 CST

资产导入未正确解决,我需要做额外的事情吗?

  • 5

因此,当我尝试使用导航栏时,我遇到了一个问题,因为我需要导入一个 NavLinks 数组,其中包含 navLinks 的文本,我在名为“constants”的文件夹内的 index.js 中将其创建为数组在 src 里面。

这就是我将其导入 Navbar.jsx 的方式

import { useState } from "react";
import { navLinks } from "../constants";

const Navbar = () => {
  return (
  <div>home</div>  )
}

export default Navbar

这就是我的文件index.js 的样子。

import { agile, behanceLogo, design_minded_icon, discordLogo, envelopeIcon, girlDesk3D, githubLogo, sassLogo, cssLogo, htmlLogo, javascriptLogo, linkedInLogo, messageIcon, mongodbLogo, moonIcon, multiculturalIcon, nodejsLogo, paperplaneIcon, personIcon, profile_bewerbung_foto, reactLogo,typescript_logo, paperplaneIcon, backtoTop } from "../assets";

export const navLinks = [
    {
        id: "home",
        title: "Home",
    },
    {
        id: "work",
        title: "Work"
    },
    {
        id: "about",
        title: "About"
    },
    {
        id: "contact",
        title: "Contact"
    }
];

export const features = [
    {
        id: "feature-1",
        icon: agile,
        title: "Agile",
        content: "Experience with a methodology that emphasizes collaboration and continuous improvement.", 
    },
    {
        id: "feature-2",
        icon: design_minded_icon,
        title: "Design-minded",
        content: "The driving aspect for any of my designs has a start in the consideration of human interaction and focus on the design principles.", 
    },
    {
        id: "feature-3",
        icon: multiculturalIcon,
        title: "Multicultural",
        content: "I am an adaptable individual who has had experience working in a multicultural team.", 
    },
]

export const about = 
    {
        title: "about",
        parragraf1: "Hi there! 👋🏻 , My name is Nathalia Padron. I am originally from Caracas, Venezuela and I am currently based in Stuttgart, since 2016.",
        parragraf2: "Before making the leap into Front-end Design I studied Product Design in IDC ( Instituto de Diseno de Caracas ) and worked several years as a Grafic Designer in Germany and Venezuela.",
        parragraf3: "I feel comfortable working with CSS and JavaScript and I continue to learn React, I would love to extend my skillset to perform tasks related to UX/UI. Also, I have recently received a certification in MERN Stack and continue to learn and develop my understanding towards the backend.",
        recently: "Recently I have been working with the following technology Stack",
        logos: [
            htmlLogo,
            cssLogo,
            javascriptLogo,
            sassLogo,
            typescript_logo,
            reactLogo,
            nodejslogo,
            mongodbLogo,
        ],
    }

    export const technologieStack = [
        {
            title1: "Libraries & Frameworks",
            technologies: 
            [
                "Tailwind CSS",
                "Bootstrap",
                "Sass",
                "React",
            ]
        }, 
        {
            title2: "Design Tools",
            technologies: 
            [
                "GoogleFonts",
                "Figma",
                "Canva",
            ]
        },
        {
            title3: "Other Tools",
            technologies: 
            [
                "VS Code",
                "Git + Hub",
                "Azure DevOps",
                "Chrome Dev Tools",
            ]
        },
    ]
        
export const cards = [
    {
        name: "MLAY TOURS",
        content: "A MERN Stack project developed as a last project for a bootcamp I finished at DCI. Worked with a customer and developed brand identity.",
        link: "",
    }
]

export const contactForm = {
    parragraf1: "I'm interested in a position within a team environment in a Web Agency working on large and creative projects.",
    parragraf2: "However, if you have a request or question, don't hesitate to use this form.",
    inputs: [
        {
            name: "Full name",
            icon: personIcon,
        },
        {
            name: "E.g [email protected]",
            icon: envelopeIcon,
        },
        {
            name: "leave me a Message",
            icon: messageIcon,
        },
    ],
    sendbutton: "send",
    icon: paperplaneIcon,
}

export const footer = [
    {
        id: "social-media-1",
        icon: linkedInLogo,
        link: "",
    },
    {
        id: "social-media-2",
        icon: behanceLogo,
        link: "",
    },
    {
        id: "social-media-3",
        icon: githubLogo,
        link: "",
    },
    {
        id: "social-media-4",
        icon: discordLogo,
        link: "",
    },
    {
        id: "goTotop",
        icon: backtoTop,
        link: "",
    },
  ];

该应用程序崩溃并显示“无法解析来自“src/constants/index.js”的导入“../assets”。

它抱怨是因为在index.js(我在其中创建了包含网站文本和徽标的所有对象)内部有一个无法解析的导入,“assets”文件夹的路径显然是错误的。我检查了文件夹结构,它似乎是正确的。资产文件夹与源代码中的组件和常量文件夹位于同一级别。我需要做一些额外的事情来确保图像被导入吗?

我所做的是将所有 png 放入此资产文件夹中,我只是以这种方式编写导入:

import { agile, behanceLogo, design_minded_icon, discordLogo, envelopeIcon, girlDesk3D, githubLogo, sassLogo, cssLogo, htmlLogo, javascriptLogo, linkedInLogo, messageIcon, mongodbLogo, moonIcon, multiculturalIcon, nodejsLogo, paperplaneIcon, personIcon, profile_bewerbung_foto, reactLogo,typescript_logo, paperplaneIcon, backtoTop } from "../assets"; 

大括号内提供的名称是每个 png 的名称

import
  • 1 个回答
  • 22 Views
Martin Hope
Kallal Ghosh
Asked: 2023-08-29 06:46:17 +0800 CST

pandas_profiling 包出现错误

  • 5

当我尝试 from pandas_profiling import ProfileReport 时出现以下错误“PydanticImportError:BaseSettings已移至pydantic-settings包中。有关更多信息,请参阅https://docs.pydantic.dev/2.3/migration/#basesettings-has-moved-to-pydantic-settings细节”。请帮助我解决这个问题。我还附上了错误消息的屏幕截图。如果您需要更多详细信息,请告诉我。谢谢。

我看到的错误消息

在此之前,我做了!pip install pandas-profiling,它有效 - 在此之后出现错误我正在尝试此代码: from pandas_profiling import ProfileReport

import
  • 1 个回答
  • 6 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    重新格式化数字,在固定位置插入分隔符

    • 6 个回答
  • Marko Smith

    为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会?

    • 2 个回答
  • Marko Smith

    VScode 自动卸载扩展的问题(Material 主题)

    • 2 个回答
  • Marko Smith

    Vue 3:创建时出错“预期标识符但发现‘导入’”[重复]

    • 1 个回答
  • Marko Smith

    具有指定基础类型但没有枚举器的“枚举类”的用途是什么?

    • 1 个回答
  • Marko Smith

    如何修复未手动导入的模块的 MODULE_NOT_FOUND 错误?

    • 6 个回答
  • Marko Smith

    `(表达式,左值) = 右值` 在 C 或 C++ 中是有效的赋值吗?为什么有些编译器会接受/拒绝它?

    • 3 个回答
  • Marko Smith

    在 C++ 中,一个不执行任何操作的空程序需要 204KB 的堆,但在 C 中则不需要

    • 1 个回答
  • Marko Smith

    PowerBI 目前与 BigQuery 不兼容:Simba 驱动程序与 Windows 更新有关

    • 2 个回答
  • Marko Smith

    AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String”

    • 1 个回答
  • Martin Hope
    Fantastic Mr Fox msvc std::vector 实现中仅不接受可复制类型 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant 使用 chrono 查找下一个工作日 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor 构造函数的成员初始化程序可以包含另一个成员的初始化吗? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský 为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul C++20 是否进行了更改,允许从已知绑定数组“type(&)[N]”转换为未知绑定数组“type(&)[]”? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann 为什么 {2,3,10} 和 {x,3,10} (x=2) 的顺序不同? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller 在 5.2 版中,bash 条件语句中的 [[ .. ]] 中的分号现在是可选的吗? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench 为什么双破折号 (--) 会导致此 MariaDB 子句评估为 true? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng 为什么 `dict(id=1, **{'id': 2})` 有时会引发 `KeyError: 'id'` 而不是 TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String” 2024-03-20 03:12:31 +0800 CST

热门标签

python javascript c++ c# java typescript sql reactjs html

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve