○愚か者の日

文章 评论 浏览 31

○愚か者の日 2025-02-21 01:44:04

startswith()很简单。 x = txt.startswith(“ forsale _”)将返回一个bool,其中txt是您要测试的字符串。

有关更多涉及的模式匹配,您想查看正则表达式。类似的内容等效于startswith()上面的行:

import re

txt = "forsale_arbitrarychars"
x = re.search("^forsale_", txt)

如果您要用^forsale_ [0-9]*替换forsale _在哪里替换。 $,它只会在下划线后接受INT

startswith() is straightforward. x = txt.startswith("forsale_") will return a bool, where txt is the string you want to test.

For more involved pattern matching, you want to look at regular expressions. Something like this is the equivalent of the startswith() line above:

import re

txt = "forsale_arbitrarychars"
x = re.search("^forsale_", txt)

where if you were to replace ^forsale_ with something like ^forsale_[0-9]*$, it would only accept ints after the underscore

动态匹配一个以子字符串开头的字符串

○愚か者の日 2025-02-21 01:17:53

我使用此命令来生成迁移文件,

yarn run typeorm migration:generate -d ./ormconfig src/db/migrations/file-name-without-extension

生成具有自定义名称的迁移文件,使用 .sh file

”输入图像描述这里“

软件包脚本

"migration:generate": "bash ./migrate.sh",

使用此命令使用自定义名称

yarn migration:generate file-name-without-extension

希望对您有帮助的迁移文件

i use this command to generate migration file

yarn run typeorm migration:generate -d ./ormconfig src/db/migrations/file-name-without-extension

generate migration file with custom name, using .sh file

enter image description here

package script

"migration:generate": "bash ./migrate.sh",

use this command to generate migration file with a custom name

yarn migration:generate file-name-without-extension

hope helpful for you

使用Nestjs错误创建 /生成迁移

○愚か者の日 2025-02-20 16:17:30

是的,H2O.Explain使用提供的test_set。在您的情况下,混淆矩阵本身由h2o.confusionmatrix(object = mode@trade,newdata = test_set)生成。

混乱矩阵汇总来自h2o.predict的数据关于模型的表现的级别视图。 H2O.Predict为您提供个人预测,而无需任何聚合。

Yes, the h2o.explain uses the provided test_set. The confusion matrix itself in your case is generated by h2o.confusionMatrix(object = model@leader, newdata = test_set).

Confusion matrix aggregates the data from h2o.predict thus providing some high level view on how does the model perform. h2o.predict gives you individual predictions without any aggregation.

H2O。解释混乱矩阵

○愚か者の日 2025-02-20 11:21:08

然后使用set_index然后转台:

创建数据

colNames = ['Desc', 'Round1', 'Round2', 'Round3', 'Round4', 'Round5', 'Round6', 'Round7', 'Round8', 'Round9', 'Round10']
df = pd.DataFrame(columns = colNames)
df.loc[len(df)] = ['Ben', '22.3', '33.3', '21.5', '27.7', '31.3', '43', '33.5', '20', '29.7', '22.7']
df.loc[len(df)] = ['Tom', '', '28.2', '29.2', '23.1', '25', '21.4', '22.3', '26.2', '25.3', '19.6']
df.loc[len(df)] = ['Jack', '21.3', '30.4', '20.8', '18', '24.5', '28.3', '32.6', '17', '25.1', '23.7']

预处理

df.set_index("Desc", inplace = True)
df = df.apply(pd.to_numeric, errors='coerce')

绘制该数据

df.T.plot()
plt.show()

提供的数据:

”在此处输入图像描述”

Use set_index then transpose:

Creating data

colNames = ['Desc', 'Round1', 'Round2', 'Round3', 'Round4', 'Round5', 'Round6', 'Round7', 'Round8', 'Round9', 'Round10']
df = pd.DataFrame(columns = colNames)
df.loc[len(df)] = ['Ben', '22.3', '33.3', '21.5', '27.7', '31.3', '43', '33.5', '20', '29.7', '22.7']
df.loc[len(df)] = ['Tom', '', '28.2', '29.2', '23.1', '25', '21.4', '22.3', '26.2', '25.3', '19.6']
df.loc[len(df)] = ['Jack', '21.3', '30.4', '20.8', '18', '24.5', '28.3', '32.6', '17', '25.1', '23.7']

Pre-processing

df.set_index("Desc", inplace = True)
df = df.apply(pd.to_numeric, errors='coerce')

Plotting the data

df.T.plot()
plt.show()

This gives us expected graph :

enter image description here

使用pandas / matplotlib中的Groupby函数绘制多行

○愚か者の日 2025-02-20 05:01:53

您可以使用多个连接器和请求过滤器进行操作。 (所有连接器均操作相同的方法)

   public FilterRegistrationBean javaMelodyRestrictingFilter(FilterRegistrationBean javaMelodyFilter) {...
  1. spring boot 2.0在多个端口上聆听

这里的原始答案。 配置带有两个端口的Spring引导

You can do it with multiple connectors and request filter. (All connectors are handle same way)

  1. https://tech.asimio.net/2016/12/15/Configuring-Tomcat-to-Listen-on-Multiple-ports-using-Spring-Boot.html

pay attention to the lines from

   public FilterRegistrationBean javaMelodyRestrictingFilter(FilterRegistrationBean javaMelodyFilter) {...
  1. spring boot 2.0 listening on multiple ports

Original answer here. Configure Spring Boot with two ports

如何在Spring Boot的另一个端口上注册Servlet?

○愚か者の日 2025-02-20 03:53:16

您可以根据实体或枚举建模等级,这取决于等级的灵活性(始终为1-5,始终是AF,可按客户端配置?)。

恕我直言,学生与成绩的关系应该是像Aldissivegrade这样的实体,其中包含他/她的成绩和相关的科学界,并且对学生来说是一个很多人。

ScienceFair和等级本身是配置数据,而实现的磨损是“运行数据”。

我强烈建议至少在ScienceFair开始之后,不要允许可配置的成绩,因为这打开了有关历史化条目的一罐蠕虫。

You could model Grade as an entity or an enum, depending on how flexible the grades must be (always 1-5, always A-F, configurable by client?).

The relation of Student to Grade should imho be an entity like AchievedGrade, which contains his/her achieved Grade and the related ScienceFair and is a ManyToOne to Student.

ScienceFair and Grade itself are configuration data, and AchievedGrade is "running data".

I'd strongly recommend not to allow configurable grades, at least after the start of the ScienceFair, because this opens a can of worms regarding historizing entries.

用冬眠/JPA映射实体

○愚か者の日 2025-02-20 02:26:52

您可以通过将它们放入数组中,然后做您已经在做的事情来删除一个有意的角色:

var str_result = input
var unwanted_chars = [".",",",":","?" ] #and so on

for c in unwanted_chars:
   str_result = str_result.replace(c,"")

我不确定您从长远来看要实现的目标,但是使用正则表达式可以更容易地解析字符串。因此,如果您想搜索字符串以获取Apecific模式,则应该研究一下:
regex

You could remove an unwantes character by putting them in an array and then do what you already are doing:

var str_result = input
var unwanted_chars = [".",",",":","?" ] #and so on

for c in unwanted_chars:
   str_result = str_result.replace(c,"")

I am not sure what you want to achieve in the long run, but parsing strings can be easier with the use of regular expressions. So if you want to search strings for apecific patterns you should look into this:
regex

如何从Godot的弦中删除所有标点符号?

○愚か者の日 2025-02-20 01:52:40

抱歉,如果这有点是基本或愚蠢的问题/建议,但是该文件当前在Windows中是否打开? Python通常不喜欢访问您当前已打开的文件,并且会解释为什么它对他人有效,而不是您。

Sorry if this is a bit of a rudimentary or dumb question/suggestion but, Is the file currently open in windows? Python does not generally like to access a file that you currently have open and would explain why it works for others but not you.

许可:[WinError 32]在OS.Remove()

○愚か者の日 2025-02-20 00:41:32

如果有恒定数量的键,则最容易为它们声明单独的变量:

key1, key2 = 'user', '_value'
print(data['waninfo']['1'][key1][key2])

如果您有一个变量(或非常大的)键,请使用值估算然后迭代其上的嵌套查找:

keys = 'user', '_value'
val = data['waninfo']['1']
for key in keys:
    val = val[key]
print(val)

If there's a constant number of keys, it might be easiest to just declare separate variables for them:

key1, key2 = 'user', '_value'
print(data['waninfo']['1'][key1][key2])

If you have a variable (or very large) number of keys, use an iterable and then iterate over it to do the nested lookups:

keys = 'user', '_value'
val = data['waninfo']['1']
for key in keys:
    val = val[key]
print(val)

如何动态打印键值?

○愚か者の日 2025-02-20 00:00:40

我建议您通过Terraform部署云功能,但是云功能的CI由云构建(也由Terraform创建)维护,我认为这是最合乎逻辑的解决方案,因为Terraform管理基础结构而不是实现云功能。

I recommend that you deploy the cloud function by terraform but that the CI of the cloud function is maintained by a cloud build (also created by terraform) I think this is the most logical solution since terraform manages the infrastructure not the implementation of the cloud function.

Terraform GCP云功能无需通过CI中的Terraform部署或在本地运行时破坏过去的部署?

○愚か者の日 2025-02-19 15:04:33

不确定这是否会完全解决

if (depSpace < depSize){ //If the number of students currently assigned to the department is less than its capacity...
  ss.getRange("I2").offset(depSpace,k).setValue(studentName); //Copy the current student's name to that department column...
  i++;//Move on to next Student || THIS IS CAUSING ISSUES - why does this series not loop by itself without me iterating it?
  j=0;//And reset Choice counter j back to choice 1
}

问题

if (depSpace < depSize){ //If the number of students currently assigned to the department is less than its capacity...
  ss.getRange("I2").offset(depSpace,k).setValue(studentName); //Copy the current student's name to that department column...
  j = choices+1;  // will terminate j loop and continue i loop
  break;  // break out of k loop
}

if (responses[i] == undefined){ //Before declaring the next few variables, check and see if the counter is within the range of the array
  break; //Break the script if i=respCount before declaring the next variables, and terminate the script
  //This is only needed because I have to manually iterate the script following the nested ifs towards the end of the file
  //If this wasn't here, studentName[i] would look outside of array bounds and throw "TypeError: Cannot read property '0' of undefined"
}

的 OP不安全。它不能保证从另一个范围获得适当的行数。它需要2个getValues()呼叫,并且最多可以长1000或更多的空行。

假设我们有以下电子表格。

function test() {
  try {
    let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet2");
    const respCount = sheet.getRange("A1:A").getValues().filter(String).length //Number of responses to parse
    const responses = sheet.getRange("A1:D"+(respCount+1)).getValues() //All students & responses as an array. (+1) gets accurate range size due to header row
    console.log(respCount);
    console.log(responses);
  }
  catch(err) {
    console.log(err);
  }
}

2:10:50 PM  Notice  Execution started
2:10:51 PM  Info    5
2:10:51 PM  Info    [ [ 'A', 1, '', '' ],
  [ 'B', 2, '', '' ],
  [ 'C', 3, '', '' ],
  [ '', 4, '', '' ],
  [ '', 5, '', '' ],
  [ 'D', 6, '', '' ] ]
2:10:51 PM  Notice  Execution completed

最喜欢的方法IMHO。它打电话给所有值并从空白开始,以获取所有值并过滤行。我不需要2个阵列可以使用。它还只能获得包含数据的行。

function test() {
  try {
    let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet2");
    let responses = sheet.getDataRange().getValues();
    responses = responses.filter( row => row[0] !== "" );
    console.log(responses);
  }
  catch(err) {
    console.log(err);
  }
}

2:12:23 PM  Notice  Execution started
2:12:24 PM  Info    [ [ 'A', 1 ],
 [ 'B', 2 ],
 [ 'C', 3 ],
 [ 'D', 6 ],
 [ 'E', 7 ] ]
2:12:24 PM  Notice  Execution completed

I'm not sure if this will entirely solve your problem because your code is hard to follow but replace this:

if (depSpace < depSize){ //If the number of students currently assigned to the department is less than its capacity...
  ss.getRange("I2").offset(depSpace,k).setValue(studentName); //Copy the current student's name to that department column...
  i++;//Move on to next Student || THIS IS CAUSING ISSUES - why does this series not loop by itself without me iterating it?
  j=0;//And reset Choice counter j back to choice 1
}

with this:

if (depSpace < depSize){ //If the number of students currently assigned to the department is less than its capacity...
  ss.getRange("I2").offset(depSpace,k).setValue(studentName); //Copy the current student's name to that department column...
  j = choices+1;  // will terminate j loop and continue i loop
  break;  // break out of k loop
}

And eliminate this altogther:

if (responses[i] == undefined){ //Before declaring the next few variables, check and see if the counter is within the range of the array
  break; //Break the script if i=respCount before declaring the next variables, and terminate the script
  //This is only needed because I have to manually iterate the script following the nested ifs towards the end of the file
  //If this wasn't here, studentName[i] would look outside of array bounds and throw "TypeError: Cannot read property '0' of undefined"
}

Regarding discussion of getting the last row.

The method shown in the OP is not safe. It does not guarantee getting the proper number of rows from another range. And it takes 2 getValues() calls, and can be up to 1000 or more empty rows long.

Assuming we have the following spreadsheet.

enter image description here

function test() {
  try {
    let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet2");
    const respCount = sheet.getRange("A1:A").getValues().filter(String).length //Number of responses to parse
    const responses = sheet.getRange("A1:D"+(respCount+1)).getValues() //All students & responses as an array. (+1) gets accurate range size due to header row
    console.log(respCount);
    console.log(responses);
  }
  catch(err) {
    console.log(err);
  }
}

2:10:50 PM  Notice  Execution started
2:10:51 PM  Info    5
2:10:51 PM  Info    [ [ 'A', 1, '', '' ],
  [ 'B', 2, '', '' ],
  [ 'C', 3, '', '' ],
  [ '', 4, '', '' ],
  [ '', 5, '', '' ],
  [ 'D', 6, '', '' ] ]
2:10:51 PM  Notice  Execution completed

Prefered method IMHO. It makes one call to get all values and filters out rows starting with blank. I don't need 2 arrays to work with. It also get only rows that contain data.

function test() {
  try {
    let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet2");
    let responses = sheet.getDataRange().getValues();
    responses = responses.filter( row => row[0] !== "" );
    console.log(responses);
  }
  catch(err) {
    console.log(err);
  }
}

2:12:23 PM  Notice  Execution started
2:12:24 PM  Info    [ [ 'A', 1 ],
 [ 'B', 2 ],
 [ 'C', 3 ],
 [ 'D', 6 ],
 [ 'E', 7 ] ]
2:12:24 PM  Notice  Execution completed

Google Apps脚本,用于循环无法自动迭代使用嵌套if语句

○愚か者の日 2025-02-19 14:29:29

在PageView Builder返回listView带有缩水:True将解决您的问题。在下面查看代码:

sliderDetailSpage

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class SliderDetailsPage extends StatefulWidget {
  const SliderDetailsPage({Key? key}) : super(key: key);

  @override
  _SliderDetailsPageState createState() => _SliderDetailsPageState();
}

class _SliderDetailsPageState extends State<SliderDetailsPage> {
  final _controller = PageController();
  int _currentPage = 0;
  var staticData = [];

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    staticData = [
      {
        "title": "Idea 1",
        "description":
        "Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST! Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST!, Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST!",
      },
      {
        "title": "Idea 2",
        "description":
        "Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST! ,Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST!",
      },
      {
        "title": "Idea 3",
        "description":
        "Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST!",
      },
    ];
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.white,
        appBar: AppBar(
          title: Text(
            "Blooming Business",
            style: TextStyle(fontSize: 16),
          ),
          leading: Builder(
            builder: (BuildContext context) {
              return IconButton(
                icon: Icon(Icons.arrow_back_ios_rounded),
                onPressed: () {
                  Navigator.pop(context);
                },
                tooltip: '',
              );
            },
          ),
          elevation: 0,
          backgroundColor: Colors.blue,
        ),
        body: Stack(children: [
          Container(
            color: Colors.blue,
            height: 55,
            padding: EdgeInsets.only(left: 20, right: 20),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                InkWell(
                  onTap: () {
                    if (staticData.length != 0) {
                      _controller.previousPage(
                        duration: const Duration(milliseconds: 200),
                        curve: Curves.easeIn,
                      );
                    }
                  },
                  child: Container(
                    width: 24,
                    height: 24,
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(3),
                      color: Colors.blue,
                    ),
                    child: Icon(
                      Icons.arrow_back_ios_outlined,
                      color: Colors.white,
                      size: 17,
                    ),
                  ),
                ),
                Text(
                  "${staticData[_currentPage]["title"]}",
                  style: TextStyle(fontSize: 16),
                ),
                InkWell(
                  onTap: () {
                    if (staticData.length != 0) {
                      _controller.nextPage(
                        duration: const Duration(milliseconds: 200),
                        curve: Curves.easeIn,
                      );
                    }
                  },
                  child: Container(
                    width: 24,
                    height: 24,
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(3),
                      color: Colors.blue,
                    ),
                    child: Icon(
                      Icons.arrow_forward_ios_rounded,
                      color: Colors.white,
                      size: 17,
                    ),
                  ),
                ),
              ],
            ),
          ),
          Padding(
            padding: const EdgeInsets.only(top: 55.0),
            child: PageView.builder(
                physics: NeverScrollableScrollPhysics(),
                controller: _controller,
                itemCount: staticData.length,
                onPageChanged: (value) =>
                    setState(() => _currentPage = value),
                itemBuilder: (BuildContext context, int index) {
                  return ListView(
                    shrinkWrap: true,
                      children: [
                    Text(
                      "${staticData[_currentPage]["description"]}",
                      style:
                      TextStyle(fontSize: 16, color: Colors.grey),
                    ),
                    SizedBox(
                      height: 10,
                    ),
                    Text(
                      "${staticData[_currentPage]["description"]}",
                      style:
                      TextStyle(fontSize: 16, color: Colors.grey),
                    ),
                  ]);
                }),
          ),
        ]));
  }
}

In pageview builder return Listview with shrinkWrap : true will solve your problem. Check out below code :

SliderDetailsPage

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class SliderDetailsPage extends StatefulWidget {
  const SliderDetailsPage({Key? key}) : super(key: key);

  @override
  _SliderDetailsPageState createState() => _SliderDetailsPageState();
}

class _SliderDetailsPageState extends State<SliderDetailsPage> {
  final _controller = PageController();
  int _currentPage = 0;
  var staticData = [];

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    staticData = [
      {
        "title": "Idea 1",
        "description":
        "Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST! Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST!, Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST!",
      },
      {
        "title": "Idea 2",
        "description":
        "Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST! ,Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST!",
      },
      {
        "title": "Idea 3",
        "description":
        "Growing with & according to the market trends & achieving the best possible outcome is what we believe at BONANZA. We have also got various titles and achievements under our belt, Bonanza looks forward to tougher challenges and newer milestones to conquer, so that our customer gets nothing less than the BEST!",
      },
    ];
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.white,
        appBar: AppBar(
          title: Text(
            "Blooming Business",
            style: TextStyle(fontSize: 16),
          ),
          leading: Builder(
            builder: (BuildContext context) {
              return IconButton(
                icon: Icon(Icons.arrow_back_ios_rounded),
                onPressed: () {
                  Navigator.pop(context);
                },
                tooltip: '',
              );
            },
          ),
          elevation: 0,
          backgroundColor: Colors.blue,
        ),
        body: Stack(children: [
          Container(
            color: Colors.blue,
            height: 55,
            padding: EdgeInsets.only(left: 20, right: 20),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                InkWell(
                  onTap: () {
                    if (staticData.length != 0) {
                      _controller.previousPage(
                        duration: const Duration(milliseconds: 200),
                        curve: Curves.easeIn,
                      );
                    }
                  },
                  child: Container(
                    width: 24,
                    height: 24,
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(3),
                      color: Colors.blue,
                    ),
                    child: Icon(
                      Icons.arrow_back_ios_outlined,
                      color: Colors.white,
                      size: 17,
                    ),
                  ),
                ),
                Text(
                  "${staticData[_currentPage]["title"]}",
                  style: TextStyle(fontSize: 16),
                ),
                InkWell(
                  onTap: () {
                    if (staticData.length != 0) {
                      _controller.nextPage(
                        duration: const Duration(milliseconds: 200),
                        curve: Curves.easeIn,
                      );
                    }
                  },
                  child: Container(
                    width: 24,
                    height: 24,
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(3),
                      color: Colors.blue,
                    ),
                    child: Icon(
                      Icons.arrow_forward_ios_rounded,
                      color: Colors.white,
                      size: 17,
                    ),
                  ),
                ),
              ],
            ),
          ),
          Padding(
            padding: const EdgeInsets.only(top: 55.0),
            child: PageView.builder(
                physics: NeverScrollableScrollPhysics(),
                controller: _controller,
                itemCount: staticData.length,
                onPageChanged: (value) =>
                    setState(() => _currentPage = value),
                itemBuilder: (BuildContext context, int index) {
                  return ListView(
                    shrinkWrap: true,
                      children: [
                    Text(
                      "${staticData[_currentPage]["description"]}",
                      style:
                      TextStyle(fontSize: 16, color: Colors.grey),
                    ),
                    SizedBox(
                      height: 10,
                    ),
                    Text(
                      "${staticData[_currentPage]["description"]}",
                      style:
                      TextStyle(fontSize: 16, color: Colors.grey),
                    ),
                  ]);
                }),
          ),
        ]));
  }
}

扑朔迷离问题:如何进行浏览量的动态高度?

○愚か者の日 2025-02-19 13:15:47

我的用户名对我说了很多XD
我已经在使用拼写错误的sastined_apps中键入“ grappelli”。

My username says a lot about me xd
I've typed "grappelli" in INSTALLED_APPS with a misspell.

ModulenotFoundError:No模块名为&#x27; grappellidjango&#x27;

○愚か者の日 2025-02-19 05:20:17

关闭所有其他,然后打开电流。

const toggleElements = document.querySelectorAll('.accordion__item');

toggleElements.forEach(el => {
  el.addEventListener('click', function() {
    toggleElements.forEach(el => el.classList.remove('is-active'));
    this.classList.add('is-active');
  });
});

Close all others, then open current.

const toggleElements = document.querySelectorAll('.accordion__item');

toggleElements.forEach(el => {
  el.addEventListener('click', function() {
    toggleElements.forEach(el => el.classList.remove('is-active'));
    this.classList.add('is-active');
  });
});

香草JS手风琴

○愚か者の日 2025-02-19 04:11:38

由于 s widths建议中,您可以传递宽度列表:

pd.read_fwf(io.StringIO(txt), widths=[8,20,3,3,7,2,8,1,99], header=None)

输出:

          0                     1    2    3     4   5         6    7      8
0  59967Y98              Doe John  621  110  4545  SO  20140314    -  24278
1  N0546664         SCHMIDT-PETER  744  110  8300  AW  20140314    -  23643
2  G4894jmh     TAKLONSKY-JUERGEN  421  110  5000  TB  20140315  NaN  23882
3  34875738  PODESBERG-SCHUMPERTS  621  110  3671  SO  20140315  NaN  24622

如果您想要名称和dtypes:输出:

df = (pd.read_fwf(io.StringIO(txt), widths=[8,20,3,3,7,2,8,1,99], header=None,
                  names=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
                  dtypes=[str, str, int, int, int, str, str, str, int])
        .assign(**{'G': lambda d: pd.to_datetime(d['G'], format='%Y%m%d')})
     )

输出:

          A                     B    C    D     E   F          G    H      I
0  59967Y98              Doe John  621  110  4545  SO 2014-03-14    -  24278
1  N0546664         SCHMIDT-PETER  744  110  8300  AW 2014-03-14    -  23643
2  G4894jmh     TAKLONSKY-JUERGEN  421  110  5000  TB 2014-03-15  NaN  23882
3  34875738  PODESBERG-SCHUMPERTS  621  110  3671  SO 2014-03-15  NaN  24622

df.dtypes
A            object
B            object
C             int64
D             int64
E             int64
F            object
G    datetime64[ns]
H            object
I             int64
dtype: object

As the s in widths suggest, you can pass a list of widths:

pd.read_fwf(io.StringIO(txt), widths=[8,20,3,3,7,2,8,1,99], header=None)

output:

          0                     1    2    3     4   5         6    7      8
0  59967Y98              Doe John  621  110  4545  SO  20140314    -  24278
1  N0546664         SCHMIDT-PETER  744  110  8300  AW  20140314    -  23643
2  G4894jmh     TAKLONSKY-JUERGEN  421  110  5000  TB  20140315  NaN  23882
3  34875738  PODESBERG-SCHUMPERTS  621  110  3671  SO  20140315  NaN  24622

If you want names and dtypes:

df = (pd.read_fwf(io.StringIO(txt), widths=[8,20,3,3,7,2,8,1,99], header=None,
                  names=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
                  dtypes=[str, str, int, int, int, str, str, str, int])
        .assign(**{'G': lambda d: pd.to_datetime(d['G'], format='%Y%m%d')})
     )

output:

          A                     B    C    D     E   F          G    H      I
0  59967Y98              Doe John  621  110  4545  SO 2014-03-14    -  24278
1  N0546664         SCHMIDT-PETER  744  110  8300  AW 2014-03-14    -  23643
2  G4894jmh     TAKLONSKY-JUERGEN  421  110  5000  TB 2014-03-15  NaN  23882
3  34875738  PODESBERG-SCHUMPERTS  621  110  3671  SO 2014-03-15  NaN  24622

df.dtypes
A            object
B            object
C             int64
D             int64
E             int64
F            object
G    datetime64[ns]
H            object
I             int64
dtype: object

熊猫读取文件没有定界符,并且具有不同的列宽度

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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