How to fix the frame range in the linear register of the list

I have 8 plots, and all these plots are generated using the ListLogLinearPlot function. and then I used the Show command to put the entire diagram in a single figure, but I couldn't fix the range of the diagram.
my final plot

python: iterates over the rows of the data frame in pandas

Iterate over rows in pandas and get the list of row objects

import pandas as pd;
for row in df.iterrows():
    d = ({k1+k2:v2 for k1,v1 in x.items() for k2,v2 in v1.items()} for x in row)
print (data)

getting output like this

(({'M1': 'data', 'M2': 'data2'}), ({'M3': '555', 'M5': '3333'}))

you need the way out

({'M1': 'data', 'M2': 'data2'}, {'M3': '555', 'M5': '3333'})

In the lower time frame. – Discussions and help

There is also an additional fact, important for new Forex traders. There is a greater chance of losing money in a lower time frame than in a higher time frame. It should be a solid argument for new traders to start trading in Forex in higher time frames, such as 1 hour or 4 hours. Here you have many more possibilities to stay in the game and get some benefit. In a lower time frame, you can find such sudden price changes. In addition, trade is also taking a large part in price movements. You must be in front of your screen all the time to follow the action and react on time. It is very difficult.

Increase the length of frame ticks

I know that I can manually adjust the frame mark length using FrameTickStyle. However, is there any way to increase the brand length globally?

plotting – Plot with frame but FrameTicks is not displayed

Sometimes, I draw using the following code, but FrameTicks are not shown in MMA 11.3. Does anyone know how to solve this problem? Thanks in advance.

Plot[f[x], {x, 0, L}, PlotRange -> {{0, L}, All}, ImageSize -> 600, PlotPoints -> 80, Frame -> True, AspectRatio -> 0.4, PlotStyle -> Red, FrameTicks -> Automatic]

plotting – How to draw a graphic with fixed frame width and height while maintaining automatic PlotRange?

I am trying to draw a graph and set the width and height of the frame by given numbers. However, I discovered that I could only fix the height of the frame, the width of the frame varies with the plotted data. For example, compare

 img1 = ListPlot[{0.5*#, 5 #} & /@ Range@100, Joined ->True,
PlotRange -> {Automatic, {100, 300}}, PlotStyle -> Black,  
LabelStyle -> 18, ImageSize -> 1 -> {5, 1.6}, Frame -> True, 
Joined -> True, FrameLabel -> {"X", "Y"}, AspectRatio -> 3]


img2 = ListPlot[{0.1*# + 1, 5 #} & /@ Range@100, Joined -> True, 
PlotRange -> {Automatic, {100, 300}}, PlotStyle -> Black, 
LabelStyle -> 18, ImageSize -> 1 -> {5, 1.6}, Frame -> True, 
Joined -> True, FrameLabel -> {"X", "Y"}, AspectRatio -> 3]

The frames of img1 Y img2 They have the same height but different width. How to make its width the same?

I am using Mathematica 12 on Windows 10.

autofocus: can Nikon D200 / Dxx AF-C be reacted aggressively to foreground objects that enter the frame?

There is an option to achieve the opposite ("AF with tracking"), but turning it off does not mean that there will be an almost instantaneous reaction to anything that enters the frame (push one hand in front of the lens and it seems to take 1 or 2 seconds before to react). Is there any way to make that camera (or similar models) slip the AF motor into a trigger when something suddenly enters the frame? "Group dynamics" with "I prefer closer" does not seem to achieve that either.

python: use one data frame to "filter" another and get the necessary indexes to build the final DF

I have two data frames that have the following structure.


.... |                    Time                    | Site | AA | BB | CC |    
  58  | 20-04-2019 08:00:00 - 21-04-2019 08:00:00 | AR25 |  1 | NS | 93 |  
  59  | 21-04-1019 08:00:00 - 22-04-2019 08:00:00 | DP88 | NS |    | 3  |  
  60  | 21-04-1019 08:00:00 - 22-04-2019 08:00:00 | DP88 |    |  1 | 15 |  


.... |     Time            | Error | Site |     
  10 | 20-04-2019 09:25:15 | 401   | AR25 |  
  11 | 20-04-2019 11:00:10 | 401   | AR25 |    
  15 | 21-04-2019 23:25:16 | 404   | DP88 |  

Columns AA, BB, CC store measured information about each site and may contain numerical values ​​or be empty. Records in AA, BB, CC may depend on the date and site. So basically my steps are:
1. Obtain rows in DF1 that have records in AA (then BB, then CC);
2. Use the time slot and site name as keys to find rows in DF2
3. Place the index (indexes) of the DF1 row in the corresponding AA / BB / CC column in DF3 with the time, error and site records that match the time interval provided and the site name.

Resulting DF3 that is expected to achieve

.... |  Time               | Error |Site |    AA   |   BB   |   CC  |    
  1  | 20-04-2019 09:25:15 |  401  |AR25 |  58     |        |    58 |  
  2  | 20-04-2019 11:00:10 |  401  |AR25 |  58     | 58     |       |  
  2  | 21-04-2019 23:25:16 |  404  |DP88 |  59,60  |  59,60 | 59,60 |  

For ease of use, I divided the Time column in DF1 into two columns: Start and End

df1('Start') = df1('Time').str.split(' - ').str(0)
df1('End') = df1('Time').str.split(' - ').str(1)
df1('Start') = pd.to_datetime(df1('Start'))
df1('End') = pd.to_datetime(df1('End'))

# trying to the list of indices
cols = ('AA','BB', 'CC')
for column in df1(cols):
    df1 = df1((df1(column)!= 'NS') & (df1(column) != '0'))
    for name in df1('Site').unique():
        if df2('Site').str.contains(name) & df2('Time').between(df1('Start').values(0),df2('End').values(0)):
            values = df1.index.values.tolist()
            df3(column) = (values)

It goes well with steps 1 and 2, but I can't do anything with step 3. The problem is that I can't understand how to get indexes to build the df3 with the structure I want, since there can be repetitive and multiple indexes for each . AA, BB, column CC.

Is it possible to achieve the expected result? If so, I need some clues about what I have to do.

Thanks in advance

python: use of applymap in pandas throughout the data frame with if conditions

I have a panda data frame and I am cleaning the data using applymap on all elements using a custom function and storing the cleaned values ​​in a separate column.

tag0           tag1                         tag2            tag3
1.Kharif       3.Pest and Disease Management    4.Grasshopper   2.Paddy
1.Kharif       2.Brinjal                    3.Crop Growth Management    
1.Kharif       3.Pest and Disease Management    4.Caterpillar   2.Black Gram
1.Kharif       3.Pest and Disease Management    4.Caterpillar   2.Cotton    

The above is part of the entire data framework.

I wrote the function written below.

def tag_cleaner(tag):
this function takes an argument called tag and checks if it starts with 1 then
 it puts it in a new column called season and so on. It is performed row-wise 
and at the end the dataframe will have columnar values
    if tag.startswith('1'):
        df_tags('season') = tag
    elif tag.startswith('2'):
        df_tags('crop') = tag
    elif tag.startswith('3'):
        df_tags('maintopic') = tag
    elif tag.startswith('4'):
        df_tags('subtopic') = tag
    elif tag.startswith('5'):
        df_tags('issue') = tag
        return tag

and then applied the applymap function


I hope the output is like this

season          crop            maintopic                      subtopic
1. Kharif       2.Paddy         3. Pest and Disease Management     4. Grasshopper
1. Kharif       2. Brinjal      3. Crop Growth Management        NA
1. Kharif       2. Black Gram   3. Pest and Disease Management     4. Catterpillar
1. Kharif       2. Cotton       3. Pest and Disease Management     4. Catterpillar

The command can make the new columns as I wanted, but in all columns there is the same value. Does it look like this. This is the same value copied throughout the data frame.

season    crop    maintopic                 subtopic
1.Kharif  2.Paddy 3.Crop Growth Management  4. Caterpillar 

But I receive this error

AttributeError: ("'float' object has no attribute 'startswith'", 'occurred at index tag2')

I am a beginner and I don't know where I am wrong. I believe that I am making a logical error in the function that I have defined, which is why the last execution of the function copies the value in the whole series of the data frame. Please help.

python: loop to extract json from the data frame and store it in a new data frame

I have a data frame (obtained from a saved mysql csv) with several columns, and one of them consists of a string that is the representation of a json. The data looks like this:

id   email_id     provider  raw_data       ts
1    A      {'a':'A',   2019-23-08 00:00:00

And what is my desired output:

email_id      a   b   c  A   B   C  

What I have coded so far is the following:

import pandas as pd
import ast

df = pd.read_csv('data.csv')
df1 = pd.DataFrame()

for i in range(len(df)):
    dict_1 = ast.literal_eval(df('raw_content')(i))
    df1 = df1.append(pd.Series(dict_1),ignore_index=True)


This works but has a big problem: it is extremely low (it takes hours for 100k rows). How could I make this operation faster?