polars-df 0.2.5 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/Cargo.lock +290 -137
  4. data/Cargo.toml +1 -1
  5. data/README.md +40 -2
  6. data/ext/polars/Cargo.toml +5 -4
  7. data/ext/polars/src/apply/dataframe.rs +6 -6
  8. data/ext/polars/src/apply/series.rs +10 -10
  9. data/ext/polars/src/batched_csv.rs +6 -4
  10. data/ext/polars/src/conversion.rs +56 -17
  11. data/ext/polars/src/dataframe.rs +65 -43
  12. data/ext/polars/src/error.rs +16 -8
  13. data/ext/polars/src/file.rs +5 -4
  14. data/ext/polars/src/lazy/apply.rs +1 -1
  15. data/ext/polars/src/lazy/dataframe.rs +12 -6
  16. data/ext/polars/src/lazy/dsl.rs +99 -45
  17. data/ext/polars/src/lazy/meta.rs +10 -9
  18. data/ext/polars/src/lib.rs +33 -29
  19. data/ext/polars/src/numo.rs +57 -0
  20. data/ext/polars/src/object.rs +2 -1
  21. data/ext/polars/src/series.rs +67 -53
  22. data/lib/polars/cat_expr.rb +0 -4
  23. data/lib/polars/cat_name_space.rb +0 -4
  24. data/lib/polars/convert.rb +0 -7
  25. data/lib/polars/data_frame.rb +165 -209
  26. data/lib/polars/data_types.rb +4 -0
  27. data/lib/polars/date_time_expr.rb +19 -151
  28. data/lib/polars/date_time_name_space.rb +17 -17
  29. data/lib/polars/expr.rb +68 -315
  30. data/lib/polars/group_by.rb +79 -51
  31. data/lib/polars/io.rb +1 -1
  32. data/lib/polars/lazy_frame.rb +1 -103
  33. data/lib/polars/lazy_functions.rb +0 -26
  34. data/lib/polars/lazy_group_by.rb +0 -8
  35. data/lib/polars/list_expr.rb +5 -27
  36. data/lib/polars/list_name_space.rb +5 -8
  37. data/lib/polars/plot.rb +109 -0
  38. data/lib/polars/series.rb +61 -19
  39. data/lib/polars/string_expr.rb +20 -76
  40. data/lib/polars/string_name_space.rb +5 -15
  41. data/lib/polars/struct_expr.rb +0 -2
  42. data/lib/polars/version.rb +1 -1
  43. data/lib/polars.rb +1 -0
  44. metadata +5 -3
@@ -887,18 +887,18 @@ module Polars
887
887
  # @example
888
888
  # start = DateTime.new(2020, 3, 1)
889
889
  # stop = DateTime.new(2020, 5, 1)
890
- # date = Polars.date_range(start, stop, "1mo")
890
+ # date = Polars.date_range(start, stop, "1mo", time_zone: "UTC")
891
891
  # # =>
892
892
  # # shape: (3,)
893
- # # Series: '' [datetime[μs]]
893
+ # # Series: '' [datetime[μs, UTC]]
894
894
  # # [
895
- # # 2020-03-01 00:00:00
896
- # # 2020-04-01 00:00:00
897
- # # 2020-05-01 00:00:00
895
+ # # 2020-03-01 00:00:00 UTC
896
+ # # 2020-04-01 00:00:00 UTC
897
+ # # 2020-05-01 00:00:00 UTC
898
898
  # # ]
899
899
  #
900
900
  # @example
901
- # date.dt.with_time_zone("Europe/London").alias("London")
901
+ # date.dt.convert_time_zone("Europe/London").alias("London")
902
902
  # # =>
903
903
  # # shape: (3,)
904
904
  # # Series: 'London' [datetime[μs, Europe/London]]
@@ -907,7 +907,7 @@ module Polars
907
907
  # # 2020-04-01 01:00:00 BST
908
908
  # # 2020-05-01 01:00:00 BST
909
909
  # # ]
910
- def with_time_zone(tz)
910
+ def convert_time_zone(tz)
911
911
  super
912
912
  end
913
913
 
@@ -924,14 +924,14 @@ module Polars
924
924
  # @example
925
925
  # start = DateTime.new(2020, 3, 1)
926
926
  # stop = DateTime.new(2020, 5, 1)
927
- # date = Polars.date_range(start, stop, "1mo")
927
+ # date = Polars.date_range(start, stop, "1mo", time_zone: "UTC")
928
928
  # # =>
929
929
  # # shape: (3,)
930
- # # Series: '' [datetime[μs]]
930
+ # # Series: '' [datetime[μs, UTC]]
931
931
  # # [
932
- # # 2020-03-01 00:00:00
933
- # # 2020-04-01 00:00:00
934
- # # 2020-05-01 00:00:00
932
+ # # 2020-03-01 00:00:00 UTC
933
+ # # 2020-04-01 00:00:00 UTC
934
+ # # 2020-05-01 00:00:00 UTC
935
935
  # # ]
936
936
  #
937
937
  # @example
@@ -946,7 +946,7 @@ module Polars
946
946
  # # ]
947
947
  #
948
948
  # @example
949
- # date = date.dt.with_time_zone("Europe/London").alias("London")
949
+ # date = date.dt.convert_time_zone("Europe/London").alias("London")
950
950
  # # =>
951
951
  # # shape: (3,)
952
952
  # # Series: 'London' [datetime[μs, Europe/London]]
@@ -956,7 +956,7 @@ module Polars
956
956
  # # 2020-05-01 01:00:00 BST
957
957
  # # ]
958
958
  #
959
- # @example Timestamps have not changed after with_time_zone
959
+ # @example Timestamps have not changed after convert_time_zone
960
960
  # date.dt.epoch("s")
961
961
  # # =>
962
962
  # # shape: (3,)
@@ -968,7 +968,7 @@ module Polars
968
968
  # # ]
969
969
  #
970
970
  # @example
971
- # date = date.dt.cast_time_zone("America/New_York").alias("NYC")
971
+ # date = date.dt.replace_time_zone("America/New_York").alias("NYC")
972
972
  # # =>
973
973
  # # shape: (3,)
974
974
  # # Series: 'NYC' [datetime[μs, America/New_York]]
@@ -978,7 +978,7 @@ module Polars
978
978
  # # 2020-05-01 01:00:00 EDT
979
979
  # # ]
980
980
  #
981
- # @example Timestamps have changed after cast_time_zone
981
+ # @example Timestamps have changed after replace_time_zone
982
982
  # date.dt.epoch("s")
983
983
  # # =>
984
984
  # # shape: (3,)
@@ -988,7 +988,7 @@ module Polars
988
988
  # # 1585717200
989
989
  # # 1588309200
990
990
  # # ]
991
- def cast_time_zone(tz)
991
+ def replace_time_zone(tz)
992
992
  super
993
993
  end
994
994