Questions tagged [datashape]

DataShape is a language for describing data. It's an extension of the NumPy dtype with an emphasis on cross language support

Datashape was originally developed in the Blaze project. It's now an independent project.

Datashape is a generalization of dtype and shape into a micro type system which let us overlay high level structure on existing data in Table and Array object.}

Github: https://github.com/ContinuumIO/datashape

Documentation: http://blaze.pydata.org/docs/datashape.html

13 questions
7
votes
2 answers

Where is the pydata BLAZE project heading?

I find the blaze ecosystem* amazing because it covers most of the data engineering use cases. There was definitely a lot of interest on these projects during the period 2015-2016, but of late it has been ignored. I say this looking at the commits on…
human
  • 2,250
  • 20
  • 24
5
votes
3 answers

python odo sql AssertionError: datashape must be Record type, got 0 * {...}

I'm trying to import a CSV into MySQL using odo but am getting a datashape error. My understanding is that datashape takes the format: var * { column: type ... } where var means a variable number of rows. I'm getting the following…
jeff
  • 51
  • 2
3
votes
1 answer

Loading CSV to MySQL with odo and SQLAlchemy

I'm using odo to write a CSV file to a MySQL table. uri = 'mysql+pymysql://username:password@database/schema::table' odo('data.csv', uri) When I do not specify a datashape, the MySQL table gets created with all string columns as TEXT and all…
Raddfood
  • 169
  • 2
  • 4
  • 17
1
vote
1 answer

convert wide to long dataset in R

set.seed(123) dataset <- data.frame(ID = 1:10, height_1 = rnorm(10,0,1), height_2 = rnorm(10,0,1), common_fam = rnorm(10,0,1), weight_1 = rnorm(10,0,1), …
Tube
  • 177
  • 5
1
vote
2 answers

How can i reshape an array from (280, 280, 3) to (28, 28, 3)

Hi i tried to write a code, where i write a number on the screen with pygame and then a neural Network predicts the number i wrote. My problem is that i trained my neural network with image arrays in a (28, 28, 3). So i tried to reshape my (280,…
1
vote
1 answer

Keras LSTM training. How to shape my input data?

I have a dataset of 3000 observations. Each observation consists of 3 timeseries of length 200 samples. As the output I have 5 class labels. So I build train as test sets as follows: test_split = round(num_samples * 3 / 4) X_train =…
QuestionMark
  • 412
  • 1
  • 4
  • 16
1
vote
0 answers

How to create an xarray from a sparse, denormalized table?

Say I have the following structured array: import numpy as np l, h, w = 6, 5, 5 dtype = [('a', int), ('b', '
capitalistcuttle
  • 1,709
  • 2
  • 20
  • 28
1
vote
1 answer

How do I patch a method registered by a decorator in Python's datashape?

I'm using the datashape Python package and registering a new type with the @datashape.discover.register decorator. I'd like to test that when I call datashape.discover on an object of the type I'm registering, it calls the function being decorated.…
0
votes
2 answers

reshaping data from wide to long, but with some complexity

I made minimal reproducible example, but my real data is huge and complicated This is the example fact_1_p_model1 <- c(1,3,4,2,5) ra_2_p_model1<- c(5,6,4,2,3) da_1_p_model2 <- c(3,5,3,1,5) dd_2_p_model2 <- c( 4,2,5,2,1) fact_1_p_nonlinearmodel1<-c(…
yoo
  • 491
  • 3
  • 10
0
votes
0 answers

Incompatible input shape

I have a CNN-LSTM model where the CNN model takes as input data with shape (None, 301,4,1) and outputs data with shape (None, 606). To adapt the cnn output to the input of the LSTM, I added a TimeDistributed Layer where it call the CNN model each…
el abed houssem
  • 350
  • 1
  • 7
  • 16
0
votes
1 answer

Error when checking target: expected dense_2 to have shape (1,) but got array with shape (11627,)

I'm trying to build a 1D CNN model and can't seem to crack the data shape problem after trying a lot of ways to go about it. Here is my code: scaler = StandardScaler() x_scaled = scaler.fit_transform(data) # data.shape = (16611, 6001) trainX,…
0
votes
2 answers

Python 1D CNN model - Error in model.fit()

I'm trying to build a 1D CNN model by processing ECG signals to diagnose sleep apnea. I am using the sklearn library and encountered an error in train_test_split. Here is my code: # loading the file with open("ApneaData.csv") as csvDataFile: …
0
votes
2 answers

Minimal Blaze example in Anaconda Python

I am trying to get a simple Blaze example, working on Ubuntu, inside an Anaconda installation (Python 3.3). import blaze from blaze import array from datashape import dshape # array creation arr1 = array(3.142) arr2 = array([[1, 2], [3,…
tchakravarty
  • 10,736
  • 12
  • 72
  • 116