Skip to content

Commit d559ad3

Browse files
committed
Open source release 1.1.3
1 parent 70b14ad commit d559ad3

31 files changed

+115
-48
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#### 1.1.3
2+
* Fixed erroneous setting of row items with \[\]-operator when the specified row index is out of bounds but within column capacity.
3+
* Fixed error resulting from inclusion of capacity buffer range in unique() method.
4+
* Improved performance of absolute() method.
5+
* Improved performance of ceil() method.
6+
* Improved performance of floor() method.
7+
18
#### 1.1.2
29
* Changed loop in remove\_column\_names() method.
310
* Fixed incorrect reading of CSV files with blank (empty) lines.

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,20 @@ Alternatively, you can import all concrete Column types directly, for example:
2727
```python
2828
from raven.struct.dataframe import (DefaultDataFrame,
2929
IntColumn,
30-
FloatColumn,
30+
DoubleColumn,
3131
StringColumn)
3232

3333
# create a DataFrame with 3 columns and 3 rows
3434
df = DefaultDataFrame(
3535
IntColumn("A", [1, 2, 3]),
36-
FloatColumn("B", [4.4, 5.5, 6.6]),
36+
DoubleColumn("B", [4.4, 5.5, 6.6]),
3737
StringColumn("C", ["cat", "dog", "horse"]))
3838

3939
print(df)
40+
# _| A B C
41+
# 0| 1 4.4 cat
42+
# 1| 2 5.5 dog
43+
# 2| 3 6.6 horse
4044
```
4145

4246
## Compatibility

pypi.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,20 @@ Alternatively, you can import all concrete Column types directly, for example:
2121
```python
2222
from raven.struct.dataframe import (DefaultDataFrame,
2323
IntColumn,
24-
FloatColumn,
24+
DoubleColumn,
2525
StringColumn)
2626

2727
# create a DataFrame with 3 columns and 3 rows
2828
df = DefaultDataFrame(
2929
IntColumn("A", [1, 2, 3]),
30-
FloatColumn("B", [4.4, 5.5, 6.6]),
30+
DoubleColumn("B", [4.4, 5.5, 6.6]),
3131
StringColumn("C", ["cat", "dog", "horse"]))
3232

3333
print(df)
34+
# _| A B C
35+
# 0| 1 4.4 cat
36+
# 1| 2 5.5 dog
37+
# 2| 3 6.6 horse
3438
```
3539

3640
## Compatibility

raven/io/dataframe/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Raven Computing
1+
# Copyright (C) 2022 Raven Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

raven/io/dataframe/csvfiles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2021 Raven Computing
1+
# Copyright (C) 2022 Raven Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@ def read(filepath, separator=",", header=True, encoding="utf-8", types=None):
6666
For example:
6767
6868
>>> import raven.io.csvfiles as csv
69-
>>> df = csv.read("myfile.csv", types=("string", int", "float", "boolean"))
69+
>>> df = csv.read("myfile.csv", types=("string", "int", "float", "boolean"))
7070
7171
The above code will read a CSV-file named 'myfile.csv' and return a DataFrame
7272
with the first Column as a StringColumn, the second Column as an IntColumn,

raven/io/dataframe/dataframes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2021 Raven Computing
1+
# Copyright (C) 2022 Raven Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

raven/struct/dataframe/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Raven Computing
1+
# Copyright (C) 2022 Raven Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

raven/struct/dataframe/_columnutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2021 Raven Computing
1+
# Copyright (C) 2022 Raven Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

raven/struct/dataframe/_dataframeutils.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2021 Raven Computing
1+
# Copyright (C) 2022 Raven Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -947,6 +947,10 @@ def setitem_impl(arg, position, value):
947947

948948
rows = rows % arg.rows()
949949

950+
if rows >= arg.rows():
951+
raise dataframe.DataFrameException(
952+
"Invalid row index: {}".format(rows))
953+
950954
if isinstance(value, (tuple, list)):
951955
# implements df[(x0, x1, ..., xn), y] = [v0, v1, ..., vn]
952956
# and df[x0:x1:x2, y] = [v0, v1, ..., vn]
@@ -965,6 +969,7 @@ def setitem_impl(arg, position, value):
965969
("Invalid value argument. The specified list/tuple "
966970
"of row values is empty"))
967971

972+
nrows = arg.rows() # cache the number of rows
968973
if isinstance(value[0], (list, tuple)):
969974
if len(rows) != len(value):
970975
raise dataframe.DataFrameException(
@@ -973,9 +978,21 @@ def setitem_impl(arg, position, value):
973978
"has a size of {}").format(len(value), len(rows)))
974979

975980
for i, index in enumerate(rows):
981+
# safety bounds check
982+
if index >= nrows:
983+
raise dataframe.DataFrameException(
984+
"Invalid row index within "
985+
"specified sequence: {}".format(index))
986+
976987
cols_selected.set_row(index, value[i])
977988
else:
978989
for index in rows:
990+
# safety bounds check
991+
if index >= nrows:
992+
raise dataframe.DataFrameException(
993+
"Invalid row index within "
994+
"specified sequence: {}".format(index))
995+
979996
cols_selected.set_row(index, value)
980997

981998
elif isinstance(value, dataframe.DataFrame):

raven/struct/dataframe/binarycolumn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2021 Raven Computing
1+
# Copyright (C) 2022 Raven Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)