下面这句话中“using”替换为“by using”后有语法错误吗?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了下面这句话中“using”替换为“by using”后有语法错误吗?相关的知识,希望对你有一定的参考价值。

It is impossible to look for life on another planet using earth-based telescopes.(使用放置在地球上的望远镜是无法观察到其他行星上的生命的。)——《新概念英语》
两个小疑问:
1,这里用“using”和“by using”有什么区别?
2,“using”是伴随状语还是方式状语?结合原意来看应该做方式状语?但现在分词怎么还可以做方式状语?

“using”替换为“by using”后没有语法错误,都是状语。追问

您好,
1,这里用“using”和“by using”有什么区别?
2,“using”是伴随状语还是方式状语?结合原意来看应该做方式状语?但现在分词怎么还可以做方式状语?

参考技术A by doing作方式状语时,by常省略,本句中即使如此。追问

谢谢,补充说明:加上by意思没有区别,只是by更加强调用什么方式。现在分词本身也可以表达方式状语。

本回答被提问者采纳

Create Power BI visuals by using Python

Create Python visuals in Power BI Desktop

  1. Select the Python visual icon in the Visualizations pane.

    技术图片

  2. In the Enable script visuals dialog box that appears, select Enable.

    When you add a Python visual to a report, Power BI Desktop takes the following actions:

    • A placeholder Python visual image appears on the report canvas.

    • The Python script editor appears along the bottom of the center pane.

    技术图片

  3. Next, drag the Age, Children, Fname, Gender, Pets, State, and Weight fields to the Values section where it says Add data fields here.

    技术图片

    Your Python script can only use fields added to the Values section. You can add or remove fields from the Values section while working on your Python script. Power BI Desktop automatically detects field changes.

     Note

    The default aggregation type for Python visuals is do not summarize.

  4. Now you can use the data you selected to create a plot.

    As you select or remove fields, supporting code in the Python script editor is automatically generated or removed.

    Based on your selections, the Python script editor generates the following binding code.

    • The editor created a dataset dataframe, with the fields you added.
    • The default aggregation is: do not summarize.
    • Similar to table visuals, fields are grouped and duplicate rows appear only once.

    技术图片

     Tip

    In certain cases, you might not want automatic grouping to occur, or you‘ll want all rows to appear, including duplicates. If so, you can add an index field to your dataset that causes all rows to be considered unique and which prevents grouping.

    You can access columns in the dataset using their respective names. For example, you can code dataset["Age"] in your Python script to access the age field.

  5. With the dataframe automatically generated by the fields you selected, you‘re ready to write a Python script that results in plotting to the Python default device. When the script is complete, select Run from the Python script editor title bar.

    Power BI Desktop replots the visual if any of the following events occur:

    • When you select Run from the Python script editor title bar
    • Whenever a data change occurs, due to data refresh, filtering, or highlighting

    When you run a Python script that results in an error, the Python visual isn‘t plotted and a canvas error message appears. For error details, select See details from the message.

    To get a larger view of the visualizations, you can minimize the Python script editor.

Ok, let‘s create some visuals.

Create a scatter plot

Let‘s create a scatter plot to see if there‘s a correlation between age and weight.

  1. Under Paste or type your script code here, enter this code:

    Python
    import matplotlib.pyplot as plt 
    dataset.plot(kind=‘scatter‘, x=‘Age‘, y=‘Weight‘, color=‘red‘)
    plt.show() 
    

    Your Python script editor pane should now look like this:

    技术图片

    The matplotlib library is imported to plot and create our visuals.

  2. When you select the Run script button, the following scatter plot generates in the placeholder Python visual image.

    技术图片

Create a line plot with multiple columns

Let‘s create a line plot for each person showing their number of children and pets. Remove or comment the code under Paste or type your script code here and enter this Python code:

Python
import matplotlib.pyplot as plt 
ax = plt.gca() 
dataset.plot(kind=‘line‘,x=‘Fname‘,y=‘Children‘,ax=ax) 
dataset.plot(kind=‘line‘,x=‘Fname‘,y=‘Pets‘, color=‘red‘, ax=ax) 
plt.show() 

When you select the Run script button, the following line plot with multiple columns generates.

技术图片

Create a bar plot

Let‘s create a bar plot for each person‘s age. Remove or comment the code under Paste or type your script code here and enter this Python code:

Python
import matplotlib.pyplot as plt 
dataset.plot(kind=‘bar‘,x=‘Fname‘,y=‘Age‘) 
plt.show() 

When you select the Run script button, the following bar plot generates:

技术图片

以上是关于下面这句话中“using”替换为“by using”后有语法错误吗?的主要内容,如果未能解决你的问题,请参考以下文章

Detect IE browser by using JavaScript

mysql group by using filesort优化

[TypeScript] Shallow copy object by using spread opreator

[PWA] Check Online Status by using the NavigatorOnLine API

Consolidate data by using multiple page fields

Analyse Linux kernel by using Perf