还在原地等你

文章 评论 浏览 29

还在原地等你 2025-01-31 06:02:16

我们可以在filter中使用两个逻辑表达式,然后按'draft_id'和'nfl_team'进行分组之后 - 1)检查是否all输入矢量值在其中in in%'team_pos'列,2)我们在% in%的LHS上创建条件

library(dplyr)
team_vec <- c("QB1", "WR2") 
df1 %>% 
  group_by(draft_id, NFL_team) %>%
  filter(all(team_vec%in% team_pos), team_pos %in% team_vec) %>% 
  ungroup

,第一个逻辑表达式,返回单个true/true/true/false 因为它用全部包装,从而删除了只有一部分匹配项的所有组。将其与第二个表达式组合在一起,请确保我们仅获得与输入VEC匹配的行,以及仅获得这些组

We may use two logical expression in filter after grouping by 'draft_id' and 'NFL_team' - 1) check whether all the input vector values are there %in% the 'team_pos' column, 2) we create the condition with 'team_pos' on the lhs of %in%

library(dplyr)
team_vec <- c("QB1", "WR2") 
df1 %>% 
  group_by(draft_id, NFL_team) %>%
  filter(all(team_vec%in% team_pos), team_pos %in% team_vec) %>% 
  ungroup

The first logical expression, returns a single TRUE/FALSE because it is wrapped with all, thus removing any groups having only a subset of matches. Combining this with the second expression make sure we get only those rows that matches the input vec as well as to get only those groups

r组中的复杂过滤

还在原地等你 2025-01-30 21:59:48

我认为最好使用Plotly-Python连接两个静态矩形文本标签。但是,在绘图中执行任何交互式的操作,以修改任何对象都需要在大多数情况下需要回调,这意味着您需要使用plotly-dash

由于您在Jupyter笔记本电脑中工作,因此可以使用 jupyter-dash 。如果您对这样的解决方案感兴趣,我很乐意更新我的答案并提供示例。

I think the best you can do with plotly-python is connect two static rectangular text labels. However, doing anything interactive in Plotly that modifies any of the objects is going to requires callbacks for the most part, meaning that you will need to use plotly-dash.

Since you're working in a Jupyter Notebook, you could use Jupyter-Dash. If you would be interested in such a solution, I'd be happy to update my answer and provide an example.

如何在Plotly中添加交互式文本标签之间的箭头?

还在原地等你 2025-01-30 20:00:04

iProductrepository - 域层。 “产品存储库”是一个明确表示域实体存储的业务概念。它可以很好地转化为现实世界。

IProductRepository - Domain Layer. "Product Repository" is a business concept that explicitly represents the storage of a domain entity. It translates well to the real world.

在应用程序,域和基础架构层(DDD)中的存储库实现

还在原地等你 2025-01-30 09:11:00

我们可能会使用%喜欢%

tbl(con, "flights") %>%
  dplyr::filter(tailnum %like% "%N%") %>%
  collect()

- 输出

# A tibble: 334,264 × 19
    year month   day dep_time sched_dep_time dep_delay arr_time sched_arr_time arr_delay carrier flight tailnum origin dest  air_time
   <int> <int> <int>    <int>          <int>     <dbl>    <int>          <int>     <dbl> <chr>    <int> <chr>   <chr>  <chr>    <dbl>
 1  2013     1     1      517            515         2      830            819        11 UA        1545 N14228  EWR    IAH        227
 2  2013     1     1      533            529         4      850            830        20 UA        1714 N24211  LGA    IAH        227
 3  2013     1     1      542            540         2      923            850        33 AA        1141 N619AA  JFK    MIA        160
 4  2013     1     1      544            545        -1     1004           1022       -18 B6         725 N804JB  JFK    BQN        183
 5  2013     1     1      554            600        -6      812            837       -25 DL         461 N668DN  LGA    ATL        116
 6  2013     1     1      554            558        -4      740            728        12 UA        1696 N39463  EWR    ORD        150
 7  2013     1     1      555            600        -5      913            854        19 B6         507 N516JB  EWR    FLL        158
 8  2013     1     1      557            600        -3      709            723       -14 EV        5708 N829AS  LGA    IAD         53
 9  2013     1     1      557            600        -3      838            846        -8 B6          79 N593JB  JFK    MCO        140
10  2013     1     1      558            600        -2      753            745         8 AA         301 N3ALAA  LGA    ORD        138
# … with 334,254 more rows, and 4 more variables: distance <dbl>, hour <dbl>, minute <dbl>, time_hour <dbl>

We may use %like%

tbl(con, "flights") %>%
  dplyr::filter(tailnum %like% "%N%") %>%
  collect()

-output

# A tibble: 334,264 × 19
    year month   day dep_time sched_dep_time dep_delay arr_time sched_arr_time arr_delay carrier flight tailnum origin dest  air_time
   <int> <int> <int>    <int>          <int>     <dbl>    <int>          <int>     <dbl> <chr>    <int> <chr>   <chr>  <chr>    <dbl>
 1  2013     1     1      517            515         2      830            819        11 UA        1545 N14228  EWR    IAH        227
 2  2013     1     1      533            529         4      850            830        20 UA        1714 N24211  LGA    IAH        227
 3  2013     1     1      542            540         2      923            850        33 AA        1141 N619AA  JFK    MIA        160
 4  2013     1     1      544            545        -1     1004           1022       -18 B6         725 N804JB  JFK    BQN        183
 5  2013     1     1      554            600        -6      812            837       -25 DL         461 N668DN  LGA    ATL        116
 6  2013     1     1      554            558        -4      740            728        12 UA        1696 N39463  EWR    ORD        150
 7  2013     1     1      555            600        -5      913            854        19 B6         507 N516JB  EWR    FLL        158
 8  2013     1     1      557            600        -3      709            723       -14 EV        5708 N829AS  LGA    IAD         53
 9  2013     1     1      557            600        -3      838            846        -8 B6          79 N593JB  JFK    MCO        140
10  2013     1     1      558            600        -2      753            745         8 AA         301 N3ALAA  LGA    ORD        138
# … with 334,254 more rows, and 4 more variables: distance <dbl>, hour <dbl>, minute <dbl>, time_hour <dbl>

在Dbplyr管道中使用弦匹配像GREPL

还在原地等你 2025-01-30 04:29:18

您可以将动态条件注入原始文本

SELECT "id", "userId", "locationId", "title", "body",
  (
    SELECT row_to_json(sqUser)
    FROM (
      SELECT "id", "firstname", "lastname"
      FROM "users"
          ${condition:raw}
      ) sqUser
  ) as "user"
FROM "todos"

基于条件:

// Generate a condition, based on the business logic:
const condition = pgp.as.format('WHERE col_1 = $1 AND col_2 = $2', [111, 222]);

执行查询文件:

await db.any(myQueryFile, {condition});

Advanced

的预先格式参数是针对您要在代码中生成的简单动态条件时的情况。但是有时您可能需要交替使用复杂的静态条件。在这种情况下,您可以将主查询文件参考从从设备查询文件(嵌套查询文件在框中支持嵌套查询文件)。在这种情况下,您甚至不需要使用:raw过滤器,因为查询文件默认为RAW文本:

Master查询:

SELECT * FROM table ${condition}

使用复杂条件(应用程序启动时)加载从属查询文件:

const conditionQueryFile1 = new QueryFile(...);
const conditionQueryFile2 = new QueryFile(...);

根据业务逻辑选择右手查询:

const condition = conditionQueryFile1; // some business logic here;

以参数执行主查询:

await db.any(myQueryFile, {condition});

You can inject dynamic condition into a query-file as Raw Text:

SELECT "id", "userId", "locationId", "title", "body",
  (
    SELECT row_to_json(sqUser)
    FROM (
      SELECT "id", "firstname", "lastname"
      FROM "users"
          ${condition:raw}
      ) sqUser
  ) as "user"
FROM "todos"

Pre-formatted parameters, based on the condition:

// Generate a condition, based on the business logic:
const condition = pgp.as.format('WHERE col_1 = $1 AND col_2 = $2', [111, 222]);

Executing your query-file:

await db.any(myQueryFile, {condition});

Advanced

Above is for the scenario when your have a simple dynamic condition that you want to generate in the code. But sometimes you may have complex static conditions that you want to alternate. In this case, you can have your master query file refer to the condition from a slave query file (nested query files are supported right out of the box). And in this case you do not even need to use :raw filter, because query files are injected as raw text by default:

Master query:

SELECT * FROM table ${condition}

Load your slave query files with complex conditions (when the app starts):

const conditionQueryFile1 = new QueryFile(...);
const conditionQueryFile2 = new QueryFile(...);

Selecting the right slave query, based on the business logic:

const condition = conditionQueryFile1; // some business logic here;

Executing master query with a slave as parameter:

await db.any(myQueryFile, {condition});

可以在QueryFile的子句中添加动态吗?

还在原地等你 2025-01-30 02:51:05

多亏了Aconcagua的评论,我找到了解决方案。
只需要检查每个组匹配项并添加新行,然后再将行复制到文件中即可。然后检查所有不是组的所有内容,并在添加组后将其添加到文件中:

If(Group)
{ // add a blank line
  // Copy the group to the file
}

if(!Group)
{
  // Copy the line to the file
}

Thanks to Aconcagua's comment I found a solution.
Just had to check for each Group match and add a new line before copying the line to the file. Then check for everything that was not a group and add it to the file after adding the group:

If(Group)
{ // add a blank line
  // Copy the group to the file
}

if(!Group)
{
  // Copy the line to the file
}

基于单词匹配的格式字符串

还在原地等你 2025-01-30 00:05:06

更新:对于西班牙语日期:

Sys.setlocale("LC_TIME", "Spanish_Spain.1252")
format <- "%a@%A@%b@%B@%p@"
enc2utf8(unique(format(lubridate:::.date_template, format = format)))
str(lubridate:::.get_locale_regs("Spanish_Spain.1252"))

library(lubridate)

dates2 = c("13 marzo, 2017", "22 junio, 2018", "24 octubre, 2017", "19 julio, 2018", "14 septiembre, 2017", "3 diciembre, 2015", "23 enero, 2018", "26 septiembre, 2016", "2 agosto, 2017", "3 enero, 2018")

parse_date_time(dates2, orders= "dmy")

输出:西班牙日期:

 [1] "2017-03-13 UTC" "2018-06-22 UTC" "2017-10-24 UTC"
 [4] "2018-07-19 UTC" "2017-09-14 UTC" "2015-12-03 UTC"
 [7] "2018-01-23 UTC" "2016-09-26 UTC" "2017-08-02 UTC"
[10] "2018-01-03 UTC"

第一个答案:

除了Akrun在评论中的答案lubridate :: dmy(日期)>
我们可以使用lubridate s parse_date_time函数。至关重要的是在此处应用订单:

library(lubridate)

parse_date_time(dates, orders= "dmy")
[1] "2014-12-26 UTC" "2018-11-23 UTC" "2007-10-01 UTC"
[4] "2013-08-31 UTC"

Update: for spanish dates:

Sys.setlocale("LC_TIME", "Spanish_Spain.1252")
format <- "%a@%A@%b@%B@%p@"
enc2utf8(unique(format(lubridate:::.date_template, format = format)))
str(lubridate:::.get_locale_regs("Spanish_Spain.1252"))

library(lubridate)

dates2 = c("13 marzo, 2017", "22 junio, 2018", "24 octubre, 2017", "19 julio, 2018", "14 septiembre, 2017", "3 diciembre, 2015", "23 enero, 2018", "26 septiembre, 2016", "2 agosto, 2017", "3 enero, 2018")

parse_date_time(dates2, orders= "dmy")

output: spanish dates:

 [1] "2017-03-13 UTC" "2018-06-22 UTC" "2017-10-24 UTC"
 [4] "2018-07-19 UTC" "2017-09-14 UTC" "2015-12-03 UTC"
 [7] "2018-01-23 UTC" "2016-09-26 UTC" "2017-08-02 UTC"
[10] "2018-01-03 UTC"

First answer:

In addition to akrun's answer in comments lubridate::dmy(dates)
We could use lubridates parse_date_time function. Essential is to apply the orders, here day month year:

library(lubridate)

parse_date_time(dates, orders= "dmy")
[1] "2014-12-26 UTC" "2018-11-23 UTC" "2007-10-01 UTC"
[4] "2013-08-31 UTC"

将文本字符串(西班牙月字符串)转换为迄今

还在原地等你 2025-01-29 22:56:41

嗯,这有点奇怪。

您有一个正确的想法,想让事情分开。
只是做一点不同,
使用功能定义来实现您的目标:

def main1():
    ...

def main2():
    ...

def main3():
    ...

main1()
main2()
main3()

背景:为什么我们完全使用__ MAIM __ IDIOM?

好吧,它起源于Jupyter Notebook出现在现场之前。

def foo()上工作的开发人员:
会在测试期间运行它,
并且通常会使foo.py的最后一行看起来像:

if __name__ == '__main__':
    print('result was', foo())

现在,我们可以创建foo_test.py.py file,
但是通常以上是最方便的。

为什么不只是foo()的单行调用?
我们通过其他模块保护呼吁导入
考虑附近的baz.py源文件:

from foo import foo

def baz():
    return 2 * foo()

我们不希望该初始导入行
吵闹或有其他副作用
就像更改文件或服务器下降时失败一样。
如果保护使其他模块可靠地导入,
只有“无聊”的事物的知识安全
像班级和功能定义一样。

在笔记本中,我们很少遇到此类考虑。
因此,简单地调用main1(),没有,如果,则是有道理的。

Ummm, that's a little weird.

You have the right idea, wanting to keep things separate.
Just do it a bit differently,
use function definitions to accomplish your goal:

def main1():
    ...

def main2():
    ...

def main3():
    ...

main1()
main2()
main3()

Background: why do we use that __main__ idiom at all?

Well, it originated long before Jupyter notebooks appeared on the scene.

A developer working on def foo():
will want to run it during testing,
and will commonly make the last lines of foo.py look like:

if __name__ == '__main__':
    print('result was', foo())

Now, we could create a foo_test.py file,
but often the above will be most convenient.

Why not just a single-line call of foo()?
We protect the call for safe import by other modules.
Consider the nearby baz.py source file:

from foo import foo

def baz():
    return 2 * foo()

We wouldn't want that initial import line
to be noisy, or have other side effects
like changing a file or failing when a server's down.
The if protection lets other modules reliably import,
safe in the knowledge that only "boring" things
like class and function definitions will be happening.

In a notebook, we seldom encounter such considerations.
So a simple call to main1(), without an if, makes sense.

我可以创建多个__NAME __ =='__ Main __;在同一Jupyter笔记本中?

还在原地等你 2025-01-29 20:17:09

如何将数组数据发送到React Native中的API?
您发送这样的数据

假设键参数是后端recievs是arr []

url将像arr [0] = al&amp; arr [1] = val&amp; arr [2] = val

let arrayData= [3,4,5,6,2]
let i = 0;
let stringArrayData = ''
for (i = 0; i < arrayData.length; i++) {
     stringArrayData += `&arr[${i}]=${arrayData[i]}`
}

/ / stringArrayData-&gt;您将这些数据发送到后端

How to send array data to API in react native?
you sends data like this

assume key parameter that backend recievs is arr[]

url wil be like that arr[0]=val&arr[1]=val&arr[2]=val

let arrayData= [3,4,5,6,2]
let i = 0;
let stringArrayData = ''
for (i = 0; i < arrayData.length; i++) {
     stringArrayData += `&arr[${i}]=${arrayData[i]}`
}

// stringArrayData -> you send this data to backend

如何将数组数据发送到React Native中的API

还在原地等你 2025-01-29 16:31:44

我要做的就是使用Next()读取每个单词,然后将其存储到数组列表

首先将其存储到数组列表中,创建student某种对象,该对象可以容纳您正在加载的基本信息,例如...

public class Student {
    private String firstName;
    private String lastName;
    private List<Integer> grades;

    public Student(String firstName, String lastName, List<Integer> grades) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.grades = grades;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public List<Integer> getGrades() {
        return grades;
    }
}

然后,使用scanner#Hasnextlinescanner#nextline从文件中读取整个文本行。您可以使用字符串#split,但是您必须手动将String等级转换为int。在这种情况下,您可以使用另一个扫描仪简单地解析文本行,例如,

Scanner reader = new Scanner(new File("grades.txt"));
while (reader.hasNextLine()) {
    String line = reader.nextLine();
    Scanner parser = new Scanner(line);
    String firstName = parser.next();
    String lastName = parser.next();
    List<Integer> grades = new ArrayList<>(4);
    while (parser.hasNextInt()) {
        grades.add(parser.nextInt());
    }
    Student student = new Student(firstName, lastName, grades);
}

应将其包装到一种方法中,将每个学生存储在某种列表中,例如...

public List<Student> loadStudents() throws FileNotFoundException {
    List<Student> students = new ArrayList<>(16);
    Scanner reader = new Scanner(new File("grades.txt"));
    while (reader.hasNextLine()) {
        String line = reader.nextLine();
        Scanner parser = new Scanner(line);
        String firstName = parser.next();
        String lastName = parser.next();
        List<Integer> grades = new ArrayList<>(4);
        while (parser.hasNextInt()) {
            grades.add(parser.nextInt());
        }
        Student student = new Student(firstName, lastName, grades);
        students.add(student);
    }
    return students;
}

我需要识别单个名称及其各自的标记

,这是单独的工作流程,因此您将加载学生的详细信息,然后使用单独的循环在list list上循环并生成输出。

由于这是一些重复功能,因此我们可以简单地将一些助手方法添加到student类中,为我们做!

public class Student {
    //...
    public String getName() {
        return (getFirstName() + " " + getLastName()).trim();
    }

    public int sumGrades() {
        int total = 0;
        for (int grade : getGrades()) {
            total += grade;
        }
        return total;
    }

    public double gradeAverage() {
        return sumGrades() / (double) getGrades().size();
    }
}

现在,我们只是循环浏览list,例如...

for (Student student : loadStudents()) {
    System.out.println(student.getName() + " grade average " + student.gradeAverage());
}

现在,这不是您可以做到这一点的唯一方法,但是每当您处理结构化的情况下,数据,尝试将其封装成某种类是一个好主意,然后更容易处理数组索引

What I am trying to do is read each word using next() and then store that into an array list

First, create a Student object of some kind, which can hold the basic information you're loading, for example...

public class Student {
    private String firstName;
    private String lastName;
    private List<Integer> grades;

    public Student(String firstName, String lastName, List<Integer> grades) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.grades = grades;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public List<Integer> getGrades() {
        return grades;
    }
}

Then, use Scanner#hasNextLine and Scanner#nextLine to read the entire line of text from the file. You could use String#split, but then you'd have to manually convert the String grades to int. In this case, you can use another Scanner to simply parse the line of text, for example...

Scanner reader = new Scanner(new File("grades.txt"));
while (reader.hasNextLine()) {
    String line = reader.nextLine();
    Scanner parser = new Scanner(line);
    String firstName = parser.next();
    String lastName = parser.next();
    List<Integer> grades = new ArrayList<>(4);
    while (parser.hasNextInt()) {
        grades.add(parser.nextInt());
    }
    Student student = new Student(firstName, lastName, grades);
}

This should be wrapped up into a method which stores each student in a list of some kind, for example...

public List<Student> loadStudents() throws FileNotFoundException {
    List<Student> students = new ArrayList<>(16);
    Scanner reader = new Scanner(new File("grades.txt"));
    while (reader.hasNextLine()) {
        String line = reader.nextLine();
        Scanner parser = new Scanner(line);
        String firstName = parser.next();
        String lastName = parser.next();
        List<Integer> grades = new ArrayList<>(4);
        while (parser.hasNextInt()) {
            grades.add(parser.nextInt());
        }
        Student student = new Student(firstName, lastName, grades);
        students.add(student);
    }
    return students;
}

I need to identity the individual names and their respective marks

Okay, this is seperate work flow, so you would load the student details, then use a seperate loop to loop over the List and generate the output.

Since this is some repeating functionality, we could simply add some helper methods to the Student class to do it for us!

public class Student {
    //...
    public String getName() {
        return (getFirstName() + " " + getLastName()).trim();
    }

    public int sumGrades() {
        int total = 0;
        for (int grade : getGrades()) {
            total += grade;
        }
        return total;
    }

    public double gradeAverage() {
        return sumGrades() / (double) getGrades().size();
    }
}

Now, we just just loop over the List of students and print the averages, for example...

for (Student student : loadStudents()) {
    System.out.println(student.getName() + " grade average " + student.gradeAverage());
}

Now, this is not the only way you could do this, but when ever you're dealing with structured data, it's a good idea to try and encapsulate it into some kind of class, it's easier then dealing with array indices ????

Runnable example...

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        new Main();
    }

    public Main() throws FileNotFoundException {
        for (Student student : loadStudents()) {
            System.out.println(student.getName() + " grade average " + student.gradeAverage());
        }
    }

    public List<Student> loadStudents() throws FileNotFoundException {
        List<Student> students = new ArrayList<>(16);
        Scanner reader = new Scanner(new File("grades.txt"));
        while (reader.hasNextLine()) {
            String line = reader.nextLine();
            Scanner parser = new Scanner(line);
            String firstName = parser.next();
            String lastName = parser.next();
            List<Integer> grades = new ArrayList<>(4);
            while (parser.hasNextInt()) {
                grades.add(parser.nextInt());
            }
            Student student = new Student(firstName, lastName, grades);
            students.add(student);
        }
        return students;
    }

    public class Student {
        private String firstName;
        private String lastName;
        private List<Integer> grades;

        public Student(String firstName, String lastName, List<Integer> grades) {
            this.firstName = firstName;
            this.lastName = lastName;
            this.grades = grades;
        }

        public String getFirstName() {
            return firstName;
        }

        public String getLastName() {
            return lastName;
        }

        public List<Integer> getGrades() {
            return grades;
        }

        public String getName() {
            return (getFirstName() + " " + getLastName()).trim();
        }

        public int sumGrades() {
            int total = 0;
            for (int grade : getGrades()) {
                total += grade;
            }
            return total;
        }

        public double gradeAverage() {
            return sumGrades() / (double) getGrades().size();
        }
    }
}

读取具有名称和成绩到阵列列表的文本文件以后平均使用

还在原地等你 2025-01-29 15:51:24

要返回新创建的表单,我们实际上需要该表单的VAR参数,但是仅这并不是很优雅,因为一个人不能将派生的表单类别传递给Type tform的VAR参数,并且必须做一个硬铸件以取悦编译器。即使使用返回tform的函数也不好得多,因为结果很可能被分配给了派生表单类的变量,并且还将被编译器拒绝。

多亏了仿制药,我们可以编写一些克服这些限制的代码。由于Delphi不支持独立的通用过程或功能,因此我们将其包装在记录声明中:

type
  TFormUtils = record
  public
    class procedure ResetForm<T: TForm>(var form: T; const filename: string); static;
  end;

我们还需要保存有关以后使用的表单的一些信息:

  • 表格的所有者
  • 表单

是当前显示的 。

class procedure TFormUtils.ResetForm<T>(var form: T; const filename: string);
begin
  var formOwner := form.Owner;
  var formShowing := form.Showing;
  form.free;
  if fileexists(filename) then
    deletefile(filename);
  form := T.Create(formOwner);
  if formShowing then
    form.Show;
end;

To return the newly created form we actually need a var parameter for the form, but that alone is not very elegant, because one cannot pass a derived form class to a var parameter of type TForm and has to do a hard cast to please the compiler. Even using a function that returns a TForm is not much better as the result is most likely assigned to a variable of a derived form class and that would also be rejected by the compiler.

Thanks to generics we can write some code that overcomes these restrictions. As standalone generic procedures or functions are not supported in Delphi, we wrap it inside a record declaration:

type
  TFormUtils = record
  public
    class procedure ResetForm<T: TForm>(var form: T; const filename: string); static;
  end;

We also need to save some information about the form for later use:

  • the owner of the form
  • is the form currently showing

This allows to recreate the form.

class procedure TFormUtils.ResetForm<T>(var form: T; const filename: string);
begin
  var formOwner := form.Owner;
  var formShowing := form.Showing;
  form.free;
  if fileexists(filename) then
    deletefile(filename);
  form := T.Create(formOwner);
  if formShowing then
    form.Show;
end;

在Delphi中重新创建TFORM的功能

还在原地等你 2025-01-29 15:06:05

尝试以下操作:

headers = ['Espectro del plasma de Ag con energía de 30mJ', "tiempo (microsegundos) vs Voltaje (v)"]

df = pd.read_csv('TEK0000.csv', names=headers, usecols=[0,1])

或:

ax = df.set_index('Espectro del plasma de Ag con energía de 30mJ')['tiempo (microsegundos) vs Voltaje (v)'].plot()

Try this:

headers = ['Espectro del plasma de Ag con energía de 30mJ', "tiempo (microsegundos) vs Voltaje (v)"]

df = pd.read_csv('TEK0000.csv', names=headers, usecols=[0,1])

Or:

ax = df.set_index('Espectro del plasma de Ag con energía de 30mJ')['tiempo (microsegundos) vs Voltaje (v)'].plot()

如何消除图形(使用Python和Pandas来绘制CSV文件)中的标题?

还在原地等你 2025-01-29 13:35:18

如果您在2022年挣扎并使用Swiftui似乎没有信息。将文件归档到您的项目中,不要忘记检查添加到目标,最后将您的InsertFontFilename.ttf添加到 “应用程序提供的字体”中,该字体现在已在您的Infoy选项卡中>如下图所示。另外,称我为疯狂,但在您将字体拖动之前,请删除任何特殊字符。此外,不要被自动生成的信息所迷惑。也许我的某些步骤是迷信的,但是我花了足够的时间在考虑我已经考虑的字体上,我只会遵循我的公式...如果字体不起作用,那并不意味着成为,我将进入下一张字体!

之后

.font(Font.custom("InsertFontFileName", size: 32, relativeTo: .title))

​在Xcode中,代码位于“> ”

If you are struggling with this in 2022 and using SwiftUI where there seems to be no info.plist in sight, then in addition to adding the Fonts capability in Target Signing and Capabilities, then dragging the file into your project and don't forget to check Add to Targets, and finally add your InsertFontFileName.ttf to "Fonts provided by application" which is now in your Info tab on the Target as seen in the image below. Also, call me crazy but before you drag the font in remove any special characters. In addition, don't be fooled by the auto-generated info.plist, add your new fonts via the image below, it'll auto-populate to that other plist. Maybe some of my steps are superstitious, but I spent enough time futzing around with fonts that I'm done thinking about it and I'll just follow my formula... and if that font doesn't work, it wasn't meant to be and I'll move onto the next font!

After that

.font(Font.custom("InsertFontFileName", size: 32, relativeTo: .title))

place in xcode where the code is located

将代码转移到另一个项目后,自定义字体不加载SwiftUI项目?

还在原地等你 2025-01-29 10:13:56

尝试使用属性$ file_size。如果超过0,则处理数据负载。如果您可以如何访问查询,那就更好了。

Try to use the property $file_size. If it is more than 0 then process the data load. It would be better if you can provide the query as how you are trying to access.

使用Hive阅读时如何忽略空的镶木木材文件

还在原地等你 2025-01-29 07:57:06

std::string s("ASecret");
const char* const ptr = s.data();
SecureZeroMemory((void*)ptr, s.size());

这将从堆栈或堆取决于stl内部的情况。

无论小还是大,弦的所有尺寸都可以使用。

注意!

请勿使用ptr来更改字符串的数据,这可能会导致长度增加或减小长度。

For Windows:

std::string s("ASecret");
const char* const ptr = s.data();
SecureZeroMemory((void*)ptr, s.size());

This shall securely clear the data from the stack or the heap depending on the STL internals.

Works on all sizes of the string no matter small or large.

Caution !

DO NOT USE ptr for altering the data of the string which might result in increasing or decreasing the length.

一个人如何安全地清除std ::字符串?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文