Skip to content
Snippets Groups Projects
Commit 6b7ddc7a authored by dmt's avatar dmt
Browse files

Get the correct length and not the # columns.

parent 4e7b7620
No related branches found
No related tags found
No related merge requests found
...@@ -99,7 +99,13 @@ class PandasBlock: ...@@ -99,7 +99,13 @@ class PandasBlock:
@property @property
def length(self): def length(self):
return len(self.__data_block) return self.__data_block.shape[0]
def drop_row(self, index):
self.__data_block.drop(index, inplace=True)
def get_column_values(self, column_name):
return self.__data_block[column_name]
class PandasAdapter: class PandasAdapter:
...@@ -113,7 +119,10 @@ class PandasAdapter: ...@@ -113,7 +119,10 @@ class PandasAdapter:
@property @property
def length(self): def length(self):
return len(self.__data_frame) return self.__data_frame.shape[0]
def get_block_via_index(self, indexes):
return PandasBlock(self.__data_frame.iloc[indexes])
def get_block(self, start, end=None, step=None): def get_block(self, start, end=None, step=None):
return PandasBlock(self.__data_frame[start:end:step]) return PandasBlock(self.__data_frame[start:end:step])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment