def load_data_to_tx_tables(): # TODO : add an API endpoint # Table.from_csv('file.csv') tb_train: Table = csv_reader.read(train_file_path, delimiter) tb_test: Table = csv_reader.read(test_file_path, delimiter) return tb_train, tb_test
def load_data_to_tx_tables(): tb_train: Table = csv_reader.read(train_file_path, delimiter) tb_test: Table = csv_reader.read(test_file_path, delimiter) return tb_train, tb_test
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ## from pycylon.data.table import csv_reader from pycylon.data.table import Table from pyarrow import Table as PyArrowTable import time from pycylon.ctx.context import CylonContext ctx: CylonContext = CylonContext("mpi") tb1: Table = csv_reader.read(ctx, '/tmp/csv.csv', ',') tb2: Table = csv_reader.read(ctx, '/tmp/csv.csv', ',') tb1.show() print("First Hello World From Rank {}, Size {}".format(ctx.get_rank(), ctx.get_world_size())) tb3: Table = tb1.distributed_join(ctx, table=tb2, join_type='left', algorithm='hash', left_col=0, right_col=0) tb3.show()
from pycylon.data.table import csv_reader from pycylon.data.table import Table from pycylon.ctx.context import CylonContext import argparse ctx: CylonContext = CylonContext("mpi") parser = argparse.ArgumentParser(description='PyCylon Table Conversion') parser.add_argument('--table1_path', type=str, help='Path to table 1 csv') parser.add_argument('--table2_path', type=str, help='Path to table 2 csv') args = parser.parse_args() tb1: Table = csv_reader.read(ctx, args.table1_path, ',') tb2: Table = csv_reader.read(ctx, args.table2_path, ',') configs = { 'join_type': 'left', 'algorithm': 'hash', 'left_col': 0, 'right_col': 0 } tb3: Table = tb1.distributed_join(ctx, table=tb2, join_type=configs['join_type'], algorithm=configs['algorithm'], left_col=configs['left_col'], right_col=configs['right_col'])
# See the License for the specific language governing permissions and # limitations under the License. ## from pycylon.data.table import csv_reader from pycylon.data.table import Table from pyarrow import Table as PyArrowTable import time from pycylon.ctx.context import CylonContext ctx: CylonContext = CylonContext("mpi") print('Loading Simple CSV File with Twisterx APIs') print("----------------------------------------------------") tb: Table = csv_reader.read(ctx, '/tmp/csv.csv', ',') print("----------------------------------------------------") print("From Python User, Table Id : {}".format(tb.id)) print("Table Columns : ", tb.columns) print("Table Rows : ", tb.rows) print("Table Show") print("----------------------------------------------------") tb.show() print('Table By Range') print("----------------------------------------------------") tb.show_by_range(0,2,0,2) print("Write an already Loaded Table") print("----------------------------------------------------") new_path: str = '/tmp/csv1.csv'