Questions tagged [normalize]

This tag has no single, established meaning at this time. In practice, it is currently being used for a number of unrelated topics. They include normalizing text, vector normalization and normalize() functions in assorted languages. For database normalization, please use [database-normalization].

normalize
Filter by
Sorted by
Tagged with
473 votes
24 answers
1.0m views

Normalize columns of a dataframe

I have a dataframe in pandas where each column has different value range. For example: df: A B C 1000 10 0.5 765 5 0.35 800 7 0.09 Any idea how I can normalize the columns of this ...
ahajib's user avatar
  • 13.2k
76 votes
9 answers
76k views

How can I normalize a URL in python

I'd like to know do I normalize a URL in python. For example, If I have a url string like : "http://www.example.com/foo goo/bar.html" I need a library in python that will transform the extra space (...
Tom Feiner's user avatar
19 votes
8 answers
9k views

Inverse of Pandas json_normalize

I just discovered the json_normalize function which works great in taking a JSON object and giving me a pandas Dataframe. Now I want the reverse operation which takes that same Dataframe and gives me ...
Parsa Torabian's user avatar
64 votes
2 answers
150k views

Normalize numpy array columns in python

I have a numpy array where each cell of a specific row represents a value for a feature. I store all of them in an 100*4 matrix. A B C 1000 10 0.5 765 5 0.35 800 7 0.09 Any idea how ...
ahajib's user avatar
  • 13.2k
6 votes
2 answers
13k views

Normalize by Group

I'm trying to normalize the StrengthCode by Item E.g. ID Item StrengthCode 7 A 1 7 A 5 7 A 7 8 B 1 8 B 3 9 A 5 9 A 3 ...
Seb's user avatar
  • 1,049
5 votes
2 answers
2k views

Removing diacritics in Silverlight (String.Normalize issue)

I did create a function that transforms diacritic characters into non-diacritic characters (based on this post) Here’s the code: Public Function RemoveDiacritics(ByVal searchInString As String) As ...
The_Black_Smurf's user avatar
3 votes
1 answer
697 views

What is the equivalent of stringByFoldingWithOptions:locale: in Java?

I am looking for the way to normalise the list of titles. The title is normalized to be stored in a database as a sort and look up key. "Normalize" means many things such as converting to lowercase, ...
Basuke's user avatar
  • 148
8 votes
1 answer
11k views

Using Pandas json_normalize on nested Json with arrays

The problem is normalizing a json with nested array of json objects. I have looked at similar questions and tried to use their solution to no avail. This is what my json object looks like. { "...
Chris Johnson's user avatar
6 votes
2 answers
9k views

How to Normalize Names

I am using pandas dataframes and I have data where I have customers per company. However, the company titles vary slightly but ultimately affect the data. Example: Company Customers AAAB 1,...
Alexis_Kiwis's user avatar
5 votes
2 answers
4k views

How to keep the index of my pandas dataframe after normalazation. json

I get a json object from json loads. then I make a pd df Now I need to normalize a lot of nested information that hide's in the only column ['open'] but I want to keep the original index, the index ...
duhh's user avatar
  • 53
5 votes
1 answer
2k views

Combining accent and character into one character in java 7

I am trying to write a java code that returns a single character combining both a character and an accent. The actual result of combining is a string and not one single character. The following is a ...
Bionix1441's user avatar
  • 2,279
5 votes
1 answer
13k views

json_normalize JSON file with list containing dictionary (sample included)

This is a sample json file I'm working with with 2 records: [{"Time":"2016-01-10", "ID" :13567, "Content":{ "Event":"UPDATE", "Id":{"EventID":"ABCDEFG"}, "Story":[{ "@ContentCat":"...
nwly's user avatar
  • 1,432
89 votes
1 answer
44k views

Should I use normalize.css in my Bootstrap project?

I can't figure out if I need to add the normalize.css stylesheet in my bootstrap project. I'm using the latest version of bootstrap, v2.3.2.
Omer Raja's user avatar
  • 1,077
52 votes
2 answers
102k views

How can I draw a log-normalized imshow plot with a colorbar representing raw the raw data

I'm using matplotlib to plot log-normalized images but I would like the original raw image data to be represented in the colorbar rather than the [0-1] interval. I get the feeling there's a more ...
Adam Fraser's user avatar
  • 6,525
9 votes
7 answers
30k views

How to normalize a list of positive numbers in JavaScript?

I have an array filled with positive int values, how could I normalize this list so the max value is always 100? Thank you in advance!
Saatana's user avatar
  • 1,177
8 votes
5 answers
20k views

How to normalize a list of positive and negative decimal number to a specific range

I have a list of decimal numbers as follows: [-23.5, -12.7, -20.6, -11.3, -9.2, -4.5, 2, 8, 11, 15, 17, 21] I need to normalize this list to fit into the range [-5,5]. How can I do it in python?
Surjya Narayana Padhi's user avatar
8 votes
1 answer
2k views

How can I combine a character followed by a "combining accent" into a single character?

How can I combine a character followed by a "combining accent" into a single character? I'm taking a phrase that the user enters into a web page and submitting it to a French-English dictionary. ...
Mike M. Lin's user avatar
8 votes
1 answer
11k views

json_normalize with multiple record paths

I'm using the example given in the json_normalize documentation given here pandas.json_normalize — pandas 1.0.3 documentation, I can't unfortunately paste my actual JSON but this example works. Pasted ...
NYC Coder's user avatar
  • 7,554
5 votes
3 answers
7k views

How can I normalize/collapse paths or URLs in Python in OS independent way?

I tried to use os.normpath in order to convert http://example.com/a/b/c/../ to http://example.com/a/b/ but it doesn't work on Windows because it does convert the slash to backslash.
bogdan's user avatar
  • 9,236
5 votes
1 answer
10k views

How to plot log normalized image using imshow () (matplotlib)? [closed]

I understand the concept. But I think I am making a silly mistake. This is what I want (psuedo-ish code). This is for an exercise. I am unable to understand lower origin part and the syntax of the ...
madratman's user avatar
  • 125
3 votes
2 answers
6k views

how to get original data from normalized array

I have a simple piece of code given below which normalize array in terms of row. import numpy as np from sklearn import preprocessing X = np.asarray([[-1,2,1], [4,1,2]], dtype=np....
user3104352's user avatar
  • 1,120
-3 votes
3 answers
19k views

matlab rescale matrix data to -1 to 1 [duplicate]

Possible Duplicate: MATLAB: how to normalize/denormalize a vector to range [-1;1] Hi, just started using Matlab and I would like to know how to rescale the data in a matrix. I have a matrix of N ...
EdChum's user avatar
  • 387k
76 votes
4 answers
79k views

Why Pytorch officially use mean=[0.485, 0.456, 0.406] and std=[0.229, 0.224, 0.225] to normalize images?

In this page (https://pytorch.org/vision/stable/models.html), it says that "All pre-trained models expect input images normalized in the same way, i.e. mini-batches of 3-channel RGB images of ...
laridzhang's user avatar
  • 1,641
27 votes
6 answers
32k views

Normalizing from [0.5 - 1] to [0 - 1]

I'm kind of stuck here, I guess it's a bit of a brain teaser. If I have numbers in the range between 0.5 to 1 how can I normalize it to be between 0 to 1? Thanks for any help, maybe I'm just a bit ...
meds's user avatar
  • 22.5k
11 votes
1 answer
12k views

Replace Multiple Spaces and Newlines with only one space in PHP

I have a string with multiple newlines. The String: This is a dummy text. I need to format this. Desired Output: This is ...
Sukanta Paul's user avatar
9 votes
4 answers
28k views

Normalizing data to certain range of values

I am a new in Python, is there any function that can do normalizing a data? For example, I have set of list in range 0 - 1 example : [0.92323, 0.7232322, 0,93832, 0.4344433] I want to normalize ...
user46543's user avatar
  • 1,043
9 votes
1 answer
4k views

How To Normalize Reviews Based On Score

What is the best way to normalize reviews? I.E. lets assume we have products that users can vote from 1-5 stars. Simply taking the average is not a good way, because it does not account for the ...
Justin's user avatar
  • 44.1k
8 votes
2 answers
15k views

I want to flatten JSON column in a Pandas DataFrame

I have an input dataframe df which is as follows: id e 1 {"k1":"v1","k2":"v2"} 2 {"k1":"v3","k2":"v4"} 3 {"k1":"v5","k2":"v6"} I want to "flatten" the column 'e' so that my resultant ...
Symphony's user avatar
  • 1,713
8 votes
1 answer
3k views

Multiple Text Nodes in a Single Element?

Could someone look at the following screenshot for me and explain the following: What is going on? How can I programmatically detect it? How can I programmatically fix / get rid of it? I believe ...
ArtOfWarfare's user avatar
8 votes
7 answers
706 views

Denormalizing for sanity or performance?

I've started a new project and they have a very normalized database. everything that can be a lookup is stored as the foreign key to the lookup table. this is normalized and fine, but I end up doing ...
MarkDav.is's user avatar
7 votes
5 answers
20k views

Normalizing histogram bins in gnuplot

I'm trying to plot a histogram whose bins are normalized by the number of elements in the bin. I'm using the following binwidth=5 bin(x,width)=width*floor(x/width) + binwidth/2.0 plot 'file' using ...
shivknight's user avatar
7 votes
2 answers
9k views

Normalize/Standardize a numpy recarray

I wonder what the best way of normalizing/standardizing a numpy recarray is. To make it clear, I'm not talking about a mathematical matrix, but a record array that also has e.g. textual columns (such ...
Has QUIT--Anony-Mousse's user avatar
7 votes
1 answer
1k views

How to scale (normalise) values of ggplot2 stat_bin2d within each column (by X axis)

I have a ggplot stat_bin2d "heatmap". library(ggplot2) value<-rep(1:5, 1000) df<-as.data.frame(value) df$group<-rep(1:7, len=5000) df<-df[sample(nrow(df), 3000), ] ggplot(df, aes(...
MartinT's user avatar
  • 1,711
6 votes
1 answer
2k views

Quiver matplotlib : arrow with the same sizes

I'm trying to do a plot with quiver but I would like the arrows to all have the same size. I use the following input : q = ax0.quiver(x, y, dx, dy, units='xy' ,scale=1) But even if add options ...
Rhecsu's user avatar
  • 109
6 votes
1 answer
2k views

Solr Filter Query - String vs. Int

Say I'm trying to query a bunch of documents that have categories and I want to limit the queries to a specified category (as I understand it this would just be using the fq parameter (filter query). ...
jstats's user avatar
  • 596
5 votes
3 answers
7k views

Normalize any value in range (-inf...+inf) to (0...1). Is it possible?

If we have concrete range of max..min value it is quite easy to normalize it to 0..1 float values, but if we don't have concrete limits? Is it possible to build universal function to have output ...
P1ratRuleZZZ's user avatar
5 votes
1 answer
781 views

How to remove accent from string in WP7

I want to remove accent (diacritic) from string in Windows Phone 7. The solution here works for .NET (desktop version). However, WP7 string has no Normalize method. Someone suggest change from string ...
onmyway133's user avatar
5 votes
1 answer
2k views

how can I revert webkit-appearance for input[type="search"] of normalize.css

I'm using normalize.css and it does remove the icon for search inputs input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: ...
timaschew's user avatar
  • 16.4k
4 votes
1 answer
18k views

Plot two histograms on the same graph and have their columns sum to 100

I have two sets of different sizes that I'd like to plot on the same histogram. However, since one set has ~330,000 values and the other has about ~16,000 values, their frequency histograms are hard ...
wubbalubba's user avatar
4 votes
1 answer
4k views

Normalize a string except ñ

I have the following example code: String n = "Péña"; n = Normalizer.normalize(n, Normalizer.Form.NFC); How do I normalize the string n excepting the ñ? And not only that string, I'm making a form ...
Gerardo's user avatar
  • 979
4 votes
2 answers
3k views

AVAudioRecorder normalize volume

I've got an app that records audio. I'm wondering how I can increase the gain. is there a way to normalize the audio or amplify it somehow? thanks, howie
Ward's user avatar
  • 3,318
3 votes
1 answer
17k views

Python: json_normalize a pandas series gives TypeError

I have tens of thousands rows of json snippets like this in a pandas series df["json"] [{ 'IDs': [{ 'lotId': '1', 'Id': '123456' }], 'date': '2009-04-17', 'bidsCount': ...
zufanka's user avatar
  • 47
3 votes
2 answers
3k views

json_normalize JSON file with multiple levels of lists containing dictionary (sample included)

(Originally from previous question but re-framed for the more general question) This is a sample json file I'm working with with 2 records: [{"Time":"2016-01-10", "ID" :13567, "Content":{ "Event"...
nwly's user avatar
  • 1,432
3 votes
2 answers
2k views

Matlab, How to get the result generated by imagesc?

I read some similar article, but they are not what I want. Get the matrix after imagesc? imagesc plot to matrix in matlab My Problem I have a matrix A with all elements are double. I do imagesc(A) ...
sflee's user avatar
  • 1,679
3 votes
4 answers
2k views

Properly normalizing a dual quaternion

I'm having trouble with dual quaternions, and I believe it's because they're not properly normalized. A, B and A' are dual quaternions where the latter is conjugated. When doing this: Q = A * B * A' I ...
Sindre's user avatar
  • 337
2 votes
2 answers
6k views

Issues replacing special characters in PHP string

I'm trying to replace the special characters in a PHP string with normal characters (as in replace ó with o and á with a). I tried using the PHP Normalizer::normalize function as in the following code:...
jeff's user avatar
  • 8,338
2 votes
2 answers
6k views

python pandas standardize column for regression

I have the following df: Date Event_Counts Category_A Category_B 20170401 982457 0 1 20170402 982754 1 0 20170402 875786 0 ...
jeangelj's user avatar
  • 4,428
2 votes
2 answers
3k views

Is it good to normalization/standardization data having large number of features with zeros

I'm having data with around 60 features and most will be zeros most of the time in my training data only 2-3 cols may have values( to be precise its perf log data). however, my test data will have ...
gB08's user avatar
  • 182
2 votes
1 answer
19k views

How can I cleanly normalize data and then "unnormalize" it later?

I am using Anaconda with a Tensorflow neural network. Most of my data is stored with pandas. I am attempting to predict cryptocurrency markets. I am aware that this lots of people are probably doing ...
maxbfuer's user avatar
  • 849
2 votes
1 answer
747 views

How do I normalize a string using ICU4C?

I find the ICU docs somewhat challenging. My question is: How do I normalize a string using ICU4C? I'm looking at unorm2_normalize, but what if the buffer isn't large enough? How would I know this ...
Usl Addet's user avatar