我的数据集df如下所示:
Date Value
...
2012-07-31 61.9443
2012-07-30 62.1551
2012-07-27 62.3328
... ...
2011-10-04 48.3923
2011-10-03 48.5939
2011-09-30 50.0327
2011-09-29 51.8350
2011-09-28 50.5555
2011-09-27 51.8470
2011-09-26 49.6350
... ...
2011-08-03 61.3948
2011-08-02 61.5476
2011-08-01 64.1407
2011-07-29 65.0364
2011-07-28 65.7065
2011-07-27 66.3463
2011-07-26 67.1508
2011-07-25 67.5577
... ...
2010-10-05 57.3674
2010-10-04 56.3687
2010-10-01 57.6022
2010-09-30 58.0993
2010-09-29 57.9934
Run Code Online (Sandbox Code Playgroud)
以下是两列的数据类型:
Type Column Name Example Value
-----------------------------------------------------------------
datetime64[ns] Date 2020-06-19 00:00:00
float64 Value 108.82
Run Code Online (Sandbox Code Playgroud)
我希望df其中的一个子集仅包含选择10 月第一个条目和7 月最后一个条目的行: …
我的日期为String,但有时它没有有效的日期或月份(值为零,00)。
例子:
String value = "03082017";
Run Code Online (Sandbox Code Playgroud)
然后我这样做:
String day = value.substring(0,2);
String month = value.substring(2,4);
String year = value.substring(4,8);
if(day.equals("00")) {
day = "01";
}
if(month.equals("00")) {
month = "01";
}
value = day + month + year;
Run Code Online (Sandbox Code Playgroud)
这适用于示例String。
现在我有这个字符串:
String value = "00092017" //ddMMyyyy
Run Code Online (Sandbox Code Playgroud)
然后我的代码将00日期转换为01.
这适用于模式ddMMyyyy,但现在是我的问题:我可以有不同的模式:ddMMyyyy或MMddyyyy或yyyy/dd/MM等
我的解决方案是首先检查模式(例如MMddyyyy),然后查看我的值03092017(ddMMyyyy)并将数字放入我的日期字符串中,该字符串位于模式中的 dd 位置。
所以代码有模式ddMMyyyy但值为03092017( MMddyyyy …
我以前能够使用 Joda DateTime 对象执行此操作,但我不确定如何获取应用了时区的 ZonedDateTime 实例的给定月份的最后一天。
例如
在 Jodatime 中,我使用了dayOfMonth()and getMaximumValue(),但是如何ZonedDateTime在Java 11中使用 和 进行等效操作?
我想使用Angular 4 Date-Picker限制未来和过去的日子。我只想仅启用Current Date [today]。如何解决此问题。
谁能想到... ???
这是我的模板:
<input type="text" placeholder="FromDate" class="form-control"
placement="top"
formControlName="fromDate"
[bsConfig]="{ dateInputFormat: 'DD-MM-YYYY' }"
bsDatepicker style="padding: 16px">
Run Code Online (Sandbox Code Playgroud) dayofmonth ×4
java ×2
angular ×1
calendar ×1
date ×1
date-parsing ×1
datepicker ×1
java-time ×1
npm ×1
pandas ×1
python ×1
zero ×1