Questions tagged [blaze]

Blaze is a NumPy/Pandas like interface to data analytics developed by Continuum Analytics.

Blaze is intended to provide an expressive, compact set of foundational abstractions for composing computations over large amounts of semi-structured data.

81 questions
2
votes
2 answers

Insert into MongoDB retuns cannot encode object

I'm doing a rather simple insert into a local MongoDB sourced from of a Python pandas DataFrame. Essentially I'm calling datframe.loc[n].to_dict() and getting my dictionary directly from the df. All is well so far until I attempt the insert, where…
Thatch
  • 157
  • 1
  • 2
  • 11
1
vote
1 answer

Masked gemm: How to write a matrix-matrix product A=B*c so that only some elements in A are calculated?

I am trying to calculate the product of two matrices, say A=B×C. But I only care about some elements in A, not all. For example, A_ij needs to be calculated, if E_ij > 0. Is there any relevant c/c++ or python library to accomplish this task. I can't…
1
vote
0 answers

Exporting MySQL table to CSV using Blaze ODO library?

I am trying to export tables from My SQL to CSV using odo library the code is: src =f'mysql+pymysql://{MYSQL_READER_USERNAME}:%s@{MYSQL_READER_HOST}/{MYSQL_DB_NAME}' % urllib.parse.quote(f'{MYSQL_READER_PASSWORD}') csv =…
Asad Khalil
  • 45
  • 1
  • 10
1
vote
0 answers

TypeError: Cannot interpret 'CategoricalDtype(categories=['no', 'yes'], ordered=False)' as a data type

I just upgraded all my python libraries, and now my previous code is started to fail. I'm using blaze with pandas. Here is my method code blaze.data(res) res contains below data col1 age ... …
suresh goud
  • 367
  • 1
  • 3
  • 19
1
vote
2 answers

RDF SPARQL Query - Find tuples that are not part of both conditions (LEFT JOIN in SQL)

Below is the data set I have: :project#1 :hasRevision :revision#1 :revision#1 :hasRevisionNumber 1 :project#1 :hasRevision :revision#2 :revision#2 :hasRevisionNumber 2 :project#1 :hasRevision :revision#3 :revision#3…
Linz
  • 354
  • 2
  • 14
1
vote
0 answers

Blaze does not understand a SQLAlchemy type

I am getting errors trying to use blaze import pandas as pd import numpy as np from sqlalchemy import create_engine from blaze import * database_con = create_engine("mssql+pyodbc://server/database?driver=SQL Server Native Client 11.0",…
JOHN
  • 871
  • 1
  • 12
  • 24
1
vote
2 answers

How to load data into blaze from hive2

All, I am attempting to load data into blaze from a hive2 thrift server. I would like to do some analysis similar to what is posted here. Here is my current process. import blaze as bz import sqlalchemy import impala conn =…
1
vote
0 answers

Force python blaze to use index

I need to write something like this using blaze: SELECT k2.field1 , COUNT(1) FROM dbo.kp AS k1 WITH(INDEX(INDEX_kp_index1)) INNER JOIN dbo.kp AS k2 WITH(INDEX(INDEX_kp_index1)) ON k1.field2 = k2.field2 WHERE k1.field1 =…
P.K
  • 11
  • 2
1
vote
1 answer

Getting 'integer out of range' error sqlalchemy

So, I am using odo for data migration but came across this error: sqlalchemy.exc.DataError: (psycopg2.DataError) integer out of range Both the source and the destination tables have the same schema but in the sql statement being executed in the…
delalli
  • 67
  • 2
  • 11
1
vote
2 answers

Select some columns based on WHERE in a dataframe

So, I am working with Blaze and wanted to perform this query on a dataframe: SELECT col1,col2 FROM table WHERE col1 > 0 For SELECT *, this works: d[d.col1 > 0]. But I want col1 and col2 only rather than all columns. How should I go about…
delalli
  • 67
  • 2
  • 11
1
vote
0 answers

Is it possible to query records from a nested json structure using blaze python

I am trying to use blaze for querying data from json. It is possible to query data if json is single level. When I am trying to give query for nested json the following error occurs : ValueError: Not understood
nessy hamsa
  • 185
  • 1
  • 12
1
vote
3 answers

How to convert blaze data objects to json?

While trying to use json.dumps in blaze error occurs saying TypeError: object is not JSON serializable. data = Data("employee.json") json.dumps(data)
nessy hamsa
  • 185
  • 1
  • 12
1
vote
1 answer

data size blows out when storing in bcolz

I have a dataset with ~7M rows and 3 columns, 2 numeric and 1 consisting of ~20M distinct string uuids. The data takes around 3G as a csv file and castra can store it in about 2G. I would like to test out bcolz with this data. I…
Daniel Mahler
  • 7,653
  • 5
  • 51
  • 90
1
vote
2 answers

How to resolve utf-8 error when using odo function ? OperationalError: (sqlite3.OperationalError) Could not decode to UTF-8 column

I am new to odo. I have a simple function for migrating databases: from blaze import Data, odo, like def migrate(source, target, table_names=None): src_db = Data(source) tbl_names = (src_db.fields, table_names)[table_names is not None] …
Rahuketu86
  • 475
  • 2
  • 6
  • 17
1
vote
2 answers

python blaze calculate mean of multiple columns

I have a python blaze data like this import blaze as bz bdata = bz.Data([(1, 'Alice', 100.9, 100), (2, 'Bob', 200.6, 200), (3, 'Charlie', 300.45, 300), (5, 'Edith', 400, 400)], fields=['id', 'name',…
Kathirmani Sukumar
  • 10,445
  • 5
  • 33
  • 34